External latin font (from font converter) shows discoloration

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

  • External latin font (from font converter) shows discoloration

    I am seeing some discoloration of externally generated latin fonts in a horizontal band through the middle of the screen. The black text appears red-ish in the band. See the attached images.

    The latin fonts were converted with 4bpp anti-aliasing while the Japanese font was not.

    These red bands do not appear when using the default emWin latin fonts.

    Any thoughts as to what may be causing this?
    Images
    • IMG_6851.JPG

      552.06 kB, 1,280×960, viewed 315 times
    • IMG_6850.JPG

      530.49 kB, 1,280×960, viewed 342 times
  • Hi,

    Drawing AA-fonts requires the ability to read the content of the frame buffer to be able to mix the current content with the text color. How that reading operation works depends on the kind of the used display driver. Drivers with a direct interface like GUIDRV_Lin access the RAM by data- and address bus. Drivers with indirect interface like GUIDRV_FlexColor require reading functions passed by the structure GUI_PORT_API when calling GUIDRV_FlexColor_SetFunc().

    Our assumption is that reading the frame buffer does not work right. Here is a small test which checks if reading basically works:

    C Source Code

    1. #include "GUI.h"
    2. void _Test(void) {
    3. const int dx = 50;
    4. const int dy = 50;
    5. const GUI_COLOR aColor[] = { GUI_RED, GUI_GREEN, GUI_BLUE };
    6. const char * apText[] = {
    7. "Red", "Green", "Blue"
    8. };
    9. GUI_RECT Rect = { 0, 0, dx - 1, dy - 1 };
    10. int i;
    11. GUI_SetTextMode(GUI_TM_TRANS);
    12. for (i = 0; i < GUI_COUNTOF(aColor); i++) {
    13. GUI_SetColor(aColor[i]);
    14. GUI_FillRectEx(&Rect);
    15. GUI_SetColor(GUI_WHITE);
    16. GUI_DispStringInRect(apText[i], &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
    17. GUI_MoveRect(&Rect, dx, dy);
    18. }
    19. GUI_MoveRect(&Rect, -dx, -dy);
    20. GUI_InvertRect(dx / 4, dy / 4, Rect.x1 - dx / 4, Rect.y1 - dy / 4);
    21. GUI_MoveRect(&Rect, -dx, -dy);
    22. GUI_InvertRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
    23. }
    24. void MainTask(void) {
    25. GUI_Init();
    26. _Test();
    27. while(1) {
    28. GUI_Delay(100);
    29. }
    30. }
    Display All


    It should produce the attached screen.

    It would be helpful to know if that works.

    Regards, Jörg
    Images
    • Image_000.gif

      1.16 kB, 150×150, viewed 184 times