Changes between Initial Version and Version 1 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CFont


Ignore:
Timestamp:
01/18/24 14:55:29 (11 months ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CFont

    v1 v1  
     1[[TOC]]
     2
     3= CFont (825gen2) =
     4
     5CFont is a C++ class that is provided to manage fonts for the 825gen2 indicator.
     6
     7== Constructors ==
     8
     9{{{
     10CBitmap(void);
     11CBitmap(int num);
     12}}}
     13
     14
     15
     16==== Parameters ====
     17 * num -
     18
     19==== Examples ====
     20
     21{{{
     22CFont fontBigLabel;
     23int err = fontBigLabel.Load("/usr/share/fonts/ttf/LiberationSans-Bold.ttf", 42,  62);
     24if(err) {
     25   DEBUG_MSG("Big Font load label error %d\n", err);
     26}
     27}}}
     28
     29
     30== Member Functions ==
     31
     32=== CFreetypeFont& GetFont(int zoom) ===
     33Returns the contained CFreetypeFont for the specified zoom state.
     34
     35==== Parameters ====
     36 * zoom -
     37
     38==== Return Value ====
     39
     40
     41==== Remarks ====
     42
     43
     44==== Example ====
     45
     46{{{
     47
     48}}}
     49
     50
     51=== Load ===
     52
     53{{{
     54int Load(const char* filename, int pixHeight1, int pixHeight2);
     55}}}
     56
     57==== Parameters ====
     58 * filename - path and filename of the font file
     59 * pixHeight1 - height of the font for normal state
     60 * pixHeight2 - height of the font for zoom state
     61
     62
     63==== Return Value ====
     640 if no error otherwise, freetype error value such as FT_Err_Unknown_File_Format.
     65
     66
     67=== SetPixelSize ===
     68
     69{{{
     70int GetHeight(int zoom);
     71}}}
     72
     73==== Parameters ====
     74 * zoom -
     75
     76==== Return Value ====
     77Returns the pixel height for the specified zoom state
     78
     79
     80=== GetStrWidth ===
     81
     82{{{
     83int GetStrWidth(const char* str, int len, int zoom);
     84}}}
     85
     86==== Parameters ====
     87 * str - source string
     88 * len - number of characters of the string to evaluate
     89 * zoom - zoom state
     90
     91==== Return Value ====
     92Returns the pixel height for the specified zoom state
     93
     94
     95
     96=== DisplayText ===
     97Displays a string using the specified font.
     98{{{
     99void DisplayText(const char* str, CDspArea *dspArea = NULL, int len = 0, int shortcutChar = 0);
     100void DisplayText(std::string& str, CDspArea *dspArea = NULL, int len = 0, int shortcutChar = 0);
     101void DisplayText(int x, int y, const char* str, CDspArea *dspArea = NULL, int len = 0, int shortcutChar = 0);
     102void DisplayText(int x, int y, std::string& str, CDspArea *dspArea = NULL, int len = 0, int shortcutChar = 0);
     103void DisplayText(CFormRect& rect, const char* str, int flag = 0, CDspArea* dspArea = NULL, int shortcutChar = 0);
     104void DisplayText(CFormRect& rect, std::string& str, int flag = 0, CDspArea* dspArea = NULL, int shortcutChar = 0);
     105}}}
     106
     107==== Parameters ====
     108 * str - source string
     109 * len - number of characters of the string to evaluate
     110 * zoom - zoom state
     111
     112==== Return Value ====
     113Returns the pixel height for the specified zoom state
     114
     115
     116
     117