Hot!Draw Text using reduced font or character set (grc and mla)

Author
gbarry
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2014/01/30 22:21:04
  • Location: 0
  • Status: offline
2017/09/13 17:37:24 (permalink)
0

Draw Text using reduced font or character set (grc and mla)

The Graphics Resource Converter lets you generate reduced fonts containing only the characters you need.  I have been able to produce such a font, but when I call GFX_TextCharDraw() on it, it rejects the string as being out of range.  It does not know that the character codes have been rearranged.
 
The resulting source file (e.g., JoesFonts_reference.c) contains an encouraging looking index table:

#ifdef GFX_CONFIG_UNICODE_INDEX_TABLE_ENABLE
const uint16_t font33_antialiasedUnicodeIndexTable[8][2] =
{
// Unicode GRC Index
// ------- ---------
     { 0x0041, 0x0020 },
    { 0x0044, 0x0021 },
    { 0x0045, 0x0022 },
    { 0x0049, 0x0023 },
    { 0x004C, 0x0024 },
    { 0x004E, 0x0025 },
    { 0x0053, 0x0026 },
    { 0x0054, 0x0027 },
};
#endif

It sure looks like it has everything it needs to make this "just work".  I set a #define for GFX_CONFIG_UNICODE_INDEX_TABLE_ENABLE in there, but nowhere does the mla code look for that.
 
I can write my own string-translator, but I don't want to find out later that there already was one in there.
 
The docs are very careful never to mention how you'd actually draw your reduced-index strings.
 
How does it work?
 
Barry
 
go ahead, ask me what MLA does if you give it character it can't render! :D 
 
 
#1

1 Reply Related Threads

    gbarry
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2014/01/30 22:21:04
    • Location: 0
    • Status: offline
    Re: Draw Text using reduced font or character set (grc and mla) 2017/09/16 15:18:39 (permalink)
    3 (1)
    Answering my own question:
     
    Your generate-display-numbers routine is a valid use of this; however, it accounts for a tiny percentage of how a reduced character set is used.  For just about everything else, your strings must be constant, because you can't accept input where you can't predict which characters you will need.  Given this constraint, GRC lets you give it the strings you want translated, and it will build for you, char arrays (strings) using the altered character codes.
     
    Author's note: As for the numbers, I did write a translator using that index table, and that part works just fine.
    #2
    Jump to:
    © 2017 APG vNext Commercial Version 4.5