[Question]About use TTF Font in stm32F779I-EVAL Board

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

  • [Question]About use TTF Font in stm32F779I-EVAL Board

    HI

    I tring to display TTF font in STM32F779I-EVAL Board.


    Test Board: STM32F779I-EVAL Board
    Test code: stm cubemx sample code
    c:\user\id\ STM32Cube\Repository\STM32Cube_FW_F7_V1.6.1\Projects\STM32F769I_EVAL\Applications\STemWin\STemWin_HelloWorld

    But I use to GUI_TTF_CreateFontAA Function when broken diloag Image.


    and I don't use to GUI_TTF_CreateFontAA Function when diloag Image is OK.

    I don't understand that i don't use Font0 and use GUI_Font32_1 in BUTTON_SetDefaultFont function.

    what's problem?

    The code below is the code I tested.

    //Default Function
    GUI_Clear();
    GUI_SetFont(&GUI_Font32_1);
    GUI_DispStringAt("Hello world kim!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);

    //ADD Function
    GUI_TTF_CS Cs0, Cs1;
    GUI_TTF_DATA Data;
    GUI_FONT Font0, Font1; /* Set parameters for accessing the font file */
    Data.pData = _acASCII; /* Address */
    Data.NumBytes = sizeof(_acASCII); /* Size */ /* Set creation parameters of first font */
    Cs0.pTTF = &Data; /* Use address of GUI_TTF_DATA */
    Cs0.PixelHeight = 24; /* Pixel height */
    Cs0.FaceIndex = 0; /* Initialize to 0 */ /* Set creation parameters of second font */
    Cs1.pTTF = &Data; /* Use address of GUI_TTF_DATA */
    Cs1.PixelHeight = 24; /* Pixel height */
    Cs1.FaceIndex = 0; /* Initialize to 0 */ /* Create 2 fonts */

    if(GUI_TTF_CreateFont(&Font0, &Cs0)==0)
    return 0;

    BUTTON_SetDefaultFont(&GUI_Font20_1);
    _ShowDialog();
  • [Question]About use TTF Font in stm32F779I-EVAL Board- add

    HI

    Also I tring to display font Antialiasing TTF font ( function name is GUI_TTF_CreateFontAA)


    Error occuer to blelow

    error 1) Diolog image broken.
    error 2) Around the character is a light blue background. (I want black background... GUI_SetBkColor(0x000000); )
    error 3) There are pink dots around the letters.



    Let me know what I did wrong!

    The code below is the code I tested.

    GUI_Clear();
    GUI_SetFont(&GUI_Font32_1);
    GUI_DispStringAt("Hello world kim!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);


    GUI_TTF_CS Cs0, Cs1;
    GUI_TTF_DATA Data;
    GUI_FONT Font0, Font1; /* Set parameters for accessing the font file */
    Data.pData = _acASCII; /* Address */
    Data.NumBytes = sizeof(_acASCII); /* Size */ /* Set creation parameters of first font */
    Cs0.pTTF = &Data; /* Use address of GUI_TTF_DATA */
    Cs0.PixelHeight = 48; /* Pixel height */
    Cs0.FaceIndex = 0; /* Initialize to 0 */ /* Set creation parameters of second font */
    Cs1.pTTF = &Data; /* Use address of GUI_TTF_DATA */
    Cs1.PixelHeight = 24; /* Pixel height */
    Cs1.FaceIndex = 0; /* Initialize to 0 */ /* Create 2 fonts */
    iret1=GUI_TTF_CreateFontAA(&Font0, &Cs0);

    GUI_SetBkColor(0x000000);
    GUI_SetColor(0xFFFFFF);
    GUI_SetFont(&Font0);
    GUI_DispStringAt("Hello world bum48", 30, 324);

    BUTTON_SetDefaultFont(&Font0);
    _ShowDialog();