Century gothic font support for french language

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

    • Century gothic font support for french language

      Hi ,
      I am trying to use french language in one of my project.
      I am using array converted from GOTHIC.ttf font using BIN2C tool.

      I am facing issue with Century gothic font. Final output does not give proper output for "century gothic" font but works for other fonts.
      Also tried using normal and encoded strings.

      Here is my main code and output.

      Source Code

      1. void MainTask(void) {
      2. GUI_Init();
      3. Data0.pData = &_acGOTHIC[0]; // Address
      4. Data0.NumBytes = sizeof(_acGOTHIC);
      5. Cs0.pTTF = &Data0; // Use address of GUI_TTF_DATA
      6. Cs0.PixelHeight = 12; // Pixel height
      7. Cs0.FaceIndex = 0; // Initialize to 0
      8. GUI_TTF_CreateFont(&Font0, &Cs0);
      9. //
      10. //
      11. Data1.pData = &_actimes[0]; // Address
      12. Data1.NumBytes = sizeof(_actimes);
      13. Cs1.pTTF = &Data1; // Use address of GUI_TTF_DATA
      14. Cs1.PixelHeight = 12; // Pixel height
      15. Cs1.FaceIndex = 0; // Initialize to 0
      16. GUI_TTF_CreateFont(&Font1, &Cs1);
      17. //
      18. WM_SetDesktopColor(GUI_WHITE);
      19. //
      20. // Create BUTTON widget.
      21. //
      22. hButton = BUTTON_CreateEx(10, 50, 500, 50, WM_HBKWIN, WM_CF_SHOW | WM_CF_HASTRANS, 0, GUI_ID_BUTTON0);
      23. hButton2 = BUTTON_CreateEx(10, 150, 500, 50, WM_HBKWIN, WM_CF_SHOW | WM_CF_HASTRANS, 1, GUI_ID_BUTTON0);
      24. BUTTON_SetFont(hButton, &Font0);
      25. GUI_UC_SetEncodeUTF8();
      26. BUTTON_SetText(hButton, "\xc3\x8ates vous s\xc3\xbbr, \xc3\x89tat avanc\xc3\xa9");
      27. //BUTTON_SetText(hButton, "Êtes vous sûr, État avancé");
      28. BUTTON_SetFont(hButton2, &Font1);
      29. BUTTON_SetText(hButton2, "MadeleinaSans -> \xc3\x8ates vous s\xc3\xbbr,\xc3\x89tat avanc\xc3\xa9"); //Êtes vous sûr, État avancé
      30. while (1) {
      31. GUI_Delay(100);
      32. }
      33. }
      Display All
      I have converted ttf file to array using UTF2C.exe tool.

      Any help regarding this would be helpful.

      Thank You,
      Amar
      Images
      • Capture.JPG

        47.59 kB, 854×641, viewed 345 times
    • Hi,

      To display any characters outside of the standard ASCII range (0x00-0x7F), you need to enable the UTF-8 encoding. You can do this by calling GUI_UC_SetEncodeUTF8() after GUI_Init().

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • HI Florian,
      Thanks for your reply.
      I have used this API(Line no 28)
      Also I have tried using it after GUI_init(), results are same.
      My actual concern is, same implementation is working for other fonts and only gothic is giving this issue.
      you can check attached image.

      Thanks!
    • Hi,

      I have tried to reproduce this with the Gothic font that is installed under Windows 10, located at C:\Windows\Fonts\GOTHIC.TTF and the string was displayed correctly.

      It seems odd that only one of your TTF files is affected. Could you send me the TTF file you are using?

      Thanks and best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi,

      Maybe you are using an older version of emWin and the issue has already been fixed. Can you tell me which version you are using? You can read this from the file GUI_Version.h.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi,

      The issue has been fixed with V6.18. I would recommend that you update to the latest version which is emWin V6.22.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.