Configuration options for selecting default fonts

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

  • Configuration options for selecting default fonts

    I'm using emWin libraries that are released by NXP as an object file.

    In this case, is it possible to save some code space changing default font (GUI_DEFAULT_FONT, BUTTON_FONT_DEFAULT, ... macros in GuiConf.h)?
    I think it isn't possible because the libraries are already compiled and the default font is already referenced in object file. But I'm not sure.
  • Hello,

    Unfortunately, you are right. You can not change the default font by using #define's, because the library is already compiled.
    If you are going to use widgets, the default font can be set using the according <WIDGET>_SetDefault...() function.
    This font will be used for all widgets of the same kind which are created after the <WIDGET>_SetDefault...() was called.

    Best regards,
    Thorsten
  • Configuration options

    Hi

    I am having a similar issue.
    I am using the ST library -STemWin528_CM7_Keil.lib

    Insode in the case statement WM_INIT_DIALOG
    I am callign my item and setting the background colour.
    But I dont see any difference on the screen, any idea what I might be doing wrong?

    hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_1);
    EDIT_SetDefaultBkColor(EDIT_CI_ENABLED, GUI_RED);
    EDIT_SetText(hItem, "12345");

    Thanks
  • Hello Rosemarie,

    The default functions have to call before creating the widget. Otherwise it has no effect.
    In this case the non-default function is the right way.

    C Source Code

    1. hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_1);
    2. EDIT_SetBkColor(hItem , EDIT_CI_ENABLED, GUI_RED);
    3. EDIT_SetText(hItem, "12345");


    Best regards,
    Thorsten