Skip to main content
Zui
Senior
Jun 11, 2019 1:47 PM UTC
Solved

Chineese and corean only shows ???

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.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 12, 2019 8:05 AM UTC

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

13 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 12, 2019 8:05 AM UTC

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
Jun 12, 2019 9:07 AM UTC

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
Jun 13, 2019 8:16 AM UTC

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

/Martin

Zui
ZuiAuthor
Senior
Jun 13, 2019 11:16 AM UTC

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
Jun 13, 2019 11:43 AM UTC

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
Jun 13, 2019 12:54 PM UTC

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
Jun 14, 2019 8:59 AM UTC

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
Jun 17, 2019 12:31 PM UTC

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
Jun 17, 2019 2:49 PM UTC

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
Jun 17, 2019 5:51 PM UTC

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