format of c file in case of 4bpp antialiasing font

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • format of c file in case of 4bpp antialiasing font

    Dear all,

    I am using the Font Converter in order to add some custom fonts to my application; I chose to use the antialiased version.

    As reported in the emWin manual I got a c file where the antialiased characters are described with this kind of variable:

    GUI_CONST_STORAGE unsigned char acFontSample10_0041[ 40] = { /* code 0041 */
    0x00, 0x00, 0x00, 0x00,
    0x00, 0xCF, 0xF2, 0x00,
    0x03, 0xFF, 0xF6, 0x00,
    0x09, 0xFB, 0xFB, 0x00,
    0x0E, 0xE2, 0xFE, 0x00,
    0x5F, 0x90, 0xCF, 0x40,
    0xBF, 0xFF, 0xFF, 0x90,
    0xFC, 0x00, 0x6F, 0xC0,
    0xF8, 0x00, 0x2F, 0xF2,
    0x00, 0x00, 0x00, 0x00
    };

    May be my question is a silly one but I do not understand the meaning of the acFontSample10_0041 entries; as Adrian stated

    "4-bit AntiAliasing means that the smoothed edges may contain pixels of one of 16 alpha levels: Opaque, transparent and 14 levels which require the foreground and background colors to be mixed in a certain ratio"

    so I thought the entries were related to the transparency level but that is not the case since the range is [0x00, 0xFF]

    I need to understand this because I have to implement a sort of 'palettized' user interface and currently when I change some values in the palette I loose the antialiasing effect, may be because changing only the background and foreground colors is not enough.

    May be in the above array 0x00 means background color, 0xFF foreground color and the other are intermediate colors that need to be changed as well if I want to get the antialiasing effect with a new palette.

    What do you think?

    Thanks,
    Ezio

    P.S.
    By the way this is the colour format I am using: GUICC_88666I