88 views
in GUI Development by

Hello EW Team,
I have a question regarding to fonts in general in Embedded Wizard.
For context, we have an application with 15 languages, including english, german, japanese, greek, chinese etc.
I am aware of the attribute range and how it should be used, but there's a question I did not found an answer to in the documentation.

We have 3 differents fonts (Roboto, Noto SC and Noto), with 19 different sizes. Let's say I have German, English and Chinese. German and English will have most of their caracters in common, therefore should go in Default. Does Chinese get thoses common caracters generated for it too?
If yes, is there a way to specify it? I tried to specify it for german and english only, but it creates conflict in font glyph (a warning in EW).

We are using v9.20 of EW.

Have a nice day,
Velas

Edit: I should add that, right now, with several glyphs that are shared between chinese and japanese, putting it in Default range does not display properly (it display a vertical rectangle).

1 Answer

0 votes
by

Helo Velas,

let me recommend you the section Localize a font resource if you don't know it yet. The interesting aspect explained in this section is that in case of a font resource configured even with different language specific values, the system generates from this information one single font.

Does Chinese get thoses common caracters generated for it too?

Yes, this is the result of the above mentioned functionality. You get one font with glyphs composed for language English, German and Chinese. The text displayed with this font can thus contain any combination of the English, German and Chinese characters - all in one string. Note the figure below which is found in the above mentioned documentation:

If yes, is there a way to specify it? I tried to specify it for german and english only, but it creates conflict in font glyph (a warning in EW).

See the mentioned documentation. The warning message probably informed you about an overlapping (conflict) in Ranges attribute. If this is the case, please note that in the finally resulting font, each glyph is 1 to 1 related to a single character code. If you specify the same character code twice in different language variants of the attribute Ranges, this will report a warning.

I should add that, right now, with several glyphs that are shared between chinese and japanese, putting it in Default range does not display properly (it display a vertical rectangle).

I suppose the font specified in the variant Default does not contain the Chinese glyphs. For example, if the Chinese glyphs should be taken from a font named e.g. 'Noto SC', select 'Noto SC' in the Chinese variant of the FontName attribute AND configure the Chinese character ranges in the Chinese variant of the Ranges attribute. Both have to correlate.

I hope it helps you further.

Best regards

Paul Banach

by

Hello Paul,
Thank you for your in depth explaination, it's more clear now.

So, if I have 2 languages, let's say greek and russian.
If I want greek displayed in Noto and russian displayed in Arial, I can have the common caracters (ф п г о м х е т а к у н в п) ,which correspond to

0x0444 0x043F 0x0433 0x043E 0x043C 0x0445 0x0435 0x0442 0x0430 0x043A 0x0443 0x043D 0x0432 0x043F

, specified in the range for each language and it would work?

Like this:
Font1 :
  Fontname :
    Russian : Arial
    Greek : Noto
    Default : Arial
  Range :
    Russian : 0x0444, 0x043F..
    Greek :  0x0444, 0x043F..
    Default : 0x20-0xFF...

From what you say, I dont think this would work but this would mean that, for common letters, if We put 0x0444, 0x043F.. in Default, the greek texts will display the common russian caracters in Arial which would look bad.

If I understood correctly, what could be a solution? (except using Noto only)

by

Hello Velas,

Font1 :
  Fontname :
    Russian : Arial
    Greek : Noto
    Default : Arial
  Range :
    Russian : 0x0444, 0x043F..
    Greek :  0x0444, 0x043F..
    Default : 0x20-0xFF...

this configuration will lead to the above mentioned overlapping problem since the character codes like 0x0444 addresses a glyph in font Arial and a second glyph in font Noto. Which glyph should be used then?

The correct configuration is demonstrated below. Note, for the sake of simplicity the configuration includes the complete block of corresponding Greek and Russian characters:

Font1 :
  Fontname :
    Russian : Arial
    Greek : Noto
    Default : Arial
  Range :
    Russian : 0x0400-0x04FF                   <<- Russian Unicode code points
    Greek :  0x0370-0x03FF                    <<- Greek Unicode code points
    Default : 0x20-0xFF...

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...