Skip to main content
Zui
Senior
June 11, 2019
Solved

Chineese and corean only shows ???

  • June 11, 2019
  • 8 replies
  • 2115 views

I need some text in chineese and corean, for example i need to write 한국어 and 汉语 , i've added those letters in my Typographies, but still get only ???, what am i missing? another strange think is that i forgot to put greek character in my typography, but the word ελληνικά is displayed correcly...

btw, not sure if corean is supported, but chineese is, according to https://touchgfx.zendesk.com/hc/en-us/articles/205452881-Languages-and-Characters

Thanks.

Stefano

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi @Zui​,

"?" indicates that the glyph wasn't found at the specific unicode specified in the text sheet (Either by static text or wildcard or wildcard range). You can check your generated/fonts cpp files. They will have the particular unicode values as comments if they were generated.

Update: The typography that was used to generate glyphs did not reference a font with chinese characters, hence no glyph data for these could be generated. See posts below for hints on how to verify that particular glyphs were generated properly.

/Martin

8 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
June 12, 2019

Hi @Zui​,

"?" indicates that the glyph wasn't found at the specific unicode specified in the text sheet (Either by static text or wildcard or wildcard range). You can check your generated/fonts cpp files. They will have the particular unicode values as comments if they were generated.

Update: The typography that was used to generate glyphs did not reference a font with chinese characters, hence no glyph data for these could be generated. See posts below for hints on how to verify that particular glyphs were generated properly.

/Martin

Martin KJELDSEN
Principal III
June 12, 2019

For instance, here is a simple generated font file for verdana, size 10, quality 4 bits per pixel:

#include <touchgfx/hal/Types.hpp>
 
FONT_LOCATION_FLASH_PRAGMA
KEEP extern const uint8_t unicodes_verdana_10_4bpp[] FONT_LOCATION_FLASH_ATTRIBUTE = {
// Unicode: [0x003F, ]
0xD2,0xDE,0x03,0x21,0x40,0x0C,0x00,0x30,0x0C,0x00,0xC1,0x05,0x00,0x4D,0x00,0x00,
0x0C,0x00,0x00,0x01,0x00,0x00,0x0F,0x00
};

0x003F is actually "?" :) So, this application has no texts and thus no glyphs generated, except for the fallback character "?".

/Martin

Martin KJELDSEN
Principal III
June 13, 2019

Also, are you sure that you've told TouchGFX to switch to the proper language?

/Martin

Zui
ZuiAuthor
Senior
June 13, 2019

i haven't switch language, cause i just need the chineese textArea to show the word "chineese" in Chineese..., so i wrote in the text area 汉语, put 汉语 also on the used typography, but only ??? are shown

Martin KJELDSEN
Principal III
June 13, 2019

Did you check your generated files for that font to see if the glyphs (unicodes) you expect are actually generated?

/Martin

Martin KJELDSEN
Principal III
June 13, 2019

Also, what i was asking (not very clear) was ... do you have more than one language defined in your text sheet? If so, is chinese the default?

/Martin

Martin KJELDSEN
Principal III
June 14, 2019

To be more explicit: 汉 is 0x6C49 in UTF-16.

I would then, in my touchgfx application folder, check generated/Font_chinese_10_4bpp.cpp. And i would see something like the following:

#include <touchgfx/hal/Types.hpp>
 
FONT_LOCATION_FLASH_PRAGMA
KEEP extern const uint8_t unicodes_chinese_10_4bpp[] FONT_LOCATION_FLASH_ATTRIBUTE =
{
 // Unicode: [0x6C49, ]
 0xD2, 0xDE, 0x03, 0x21, 0x40, 0x0C, 0x00, 0x30, 0x0C, 0x00, 0xC1, 0x05, 0x00, 0x4D, 0x00, 
 0x00, 0x0C, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0F, 0x00
};

(The glyph data is not the real data for 0x6C49, it's just an example)

/Martin

Zui
ZuiAuthor
Senior
June 17, 2019

i just checked (i kinda put aside this problem for other problems needed to be fixed,) and my fontName.cpp generates the unicode for ?,a,i,l,n,o,t when on designer i put 汉语, so how to make him genarates the crrect font?

Zui
ZuiAuthor
Senior
June 17, 2019

ok, now it works, it seems i've downloaded chinese font which wasn't in chinese... i've downloaded many fonts, and at last found one that works, glad wasn't touchGFX problem

Martin KJELDSEN
Principal III
June 17, 2019

Hurray! I should've asked some more concrete questions from the start - we could have saved some time, haha