367 views
in GUI Development by
Hi,
I am getting this below warning for many languages.
The glyph range specified in the language variant 'KOREAN' of the font resource 'Application::FontRCxx' overlaps with the ranges from other language -variants. The resulting font resource, however, can contain only one glyph for one character code. This can result in text being rendered incorrectly. -Please review the 'Ranges' attribute of the font resource 'Application::FontRCxx'.

1 Answer

0 votes
by

Hello Gayathri,

as explained in the error message, your font resource is configured using same unicode code points twice. In other words, the values in the attribute Ranges overlap. This would result in the same Unicode code point representing two different glyphs. Such mapping is not possible.

I suppose, in your project you have several languages like Korean and Chinese. Then you have possibly configured the Ranges attribute of the font resource with similar ranges for both languages. To eliminate this double mapping, specify the ranges only for one of the languages.

See also the section Localize a font resource.

I hope it helps you further.

Best regards

Paul Banach

by

Hi Paul,
Thank you for your response!
Please help me out for below cases.

1) Where can I refer the proper Unicode ranges for all languages?

I am using Noto sans cjk for languages(greek,lithuvanian,latvian) , Noto sans jc(japanese), Noto sans hebrew (Hebrew) & Roboto condensed for remaining languages.
Currently I am referring the link but not get exact ranges. Character Table (character-table.netlify.app)
 

2) How do we select the ranges for special characters for different languages, if i use different font resources for different languages?

 

by

Hello Gayathri,

1) Where can I refer the proper Unicode ranges for all languages?

the page Character Table (character-table.netlify.app seems to be a good source. Please note that the Unicode mapping is standard. That means, it is not depending on the used font (Roboto, etc.). However, if the desired language is missing in a font then accessing the Unicode code points fails.

2) How do we select the ranges for special characters for different languages, if i use different font resources for different languages?

You can specify the characters in any of the language specific values of the Ranges attribute. The code generation produces one 'united' font resource consisting of the glyphs you have specified in the individual language specific values of the Ranges attribute. It doesn't matter whether Unicode codepoint X is specified in language Greek or Hebrew. It will be taken in account during the code generation.

However, if you uses different font files (Roboto, Noto sans, etc.) then ensure that the ranges and the corresponding font name are specified for one and the same language variant in the attributes Ranges and FontName. Again, it doesn't matter which of the language variants you use.

Please note, the concept of Ranges exists for optimization purpose for low-end systems providing few flash (ROM) memory. With it you can select only the (few) glyphs your application will use at the runtime. Of course, this works only when the character set is known in advance. If the application is intended to display data received via Internet, etc. it is difficult to foreseen which glyphs will be needed. Then you need to include all Unicode code points occupied by the supported languages.

if i use different font resources for different languages?

It is not clear for me what you mean with "if i use different font resources for different languages?". The font resources can be configured to support different languages at once. In this manner you can mix text containing Hebrew, English, etc. Just specify all necessray Unicode code points in the Ranges attribute.

Does it help you further?

Best regards

Paul

by

Hi Paul,

I have encountered the same problem and taken the actions based on your response. At present, I am quite confused whether this is contradictory or not?

1. I suppose, in your project you have several languages like Korean and Chinese. Then you have possibly configured the Ranges attribute of the font resource with similar ranges for both languages. To eliminate this double mapping, specify the ranges only for one of the languages.

2. However, if you uses different font files (Roboto, Noto sans, etc.) then ensure that the ranges and the corresponding font name are specified for one and the same language variant in the attributes Ranges and FontName. 

If the range is same for all languages, and need to use different font files in different languages . How to config?  

Below is the error info:

The font resource 'Fonts::Font22Mixed' seems to be configured for the language variant 'ChineseTraditional' (see its attribute 'FontName'). The associated attribute 'Ranges', however, is empty. When configuring a font resource including multiple language variants, it is obligatory to specify in its 'Ranges' attribute for each used language variant the codes of glyphs to import. If the usage of the language variant 'ChineseTraditional' is intended, please double click on this message, review the attribute 'Ranges' of the font resource and ensure that it contains a valid value for the language variant 'ChineseTraditional'.

Best regards.

Chris Zhao.

by

Hello Chris,

If the range is same for all languages, and need to use different font files in different languages . How to config?  

This is not possible. One font resource can't contain different glyphs for one and the same Unicode code point. The resulting mapping has to be 1:1. 

What in fact is confusing, the values for the attributes Ranges and FontName have the names of the languages existing in your project, e.g. Default, Chinese, etc. These names, however, have no relation to the language selection - unlike to multi-lingual bitmap resources or constants. Switching the language will not have the effect of the font using other glyphs.

The values in the attributes Ranges and FontNames are just a trick allowing the creation of one font resource composed of glyphs that come from different fonts. The resulting font resource contain thereupon all specified glyphs. It can be used to display text for all included languages. In this context, it is irrelevant whether the ranges for Chinese characters are specified in the value for Chinese language or any other language.

The only important thing is, that if you need to compose the font resource from different fonts, specify the font name and the corresponding Unicode code points in the values of the same name. See the example in the section Localize a font resource.

I hope it helps you further.

Best regards

Paul Banach

by

Hi Paul,

Is it possible to create & use different fontrange.txt files for different languages? 

 
If your answer is Yes, How to create the fontrange.txt for different languages?

Note: I added reference images just for understanding.

by
Hello Gayathri,

yes, you can specify either the ranges or a file name containing the ranges. This is true for each of the values listed below the Ranges attribute.

Best regards

Paul
by
Hi Paul,

Thanks your valuable inputs.

How to generate the Fontrange.txt file for different languages without double mapping?
by
Hello,

please have a look to the example StringTable - it contains a template of an Excel sheet to manage your strings. You can adapt the Excel macro (Visual Basic) according your needs, e.g. to create a separate FontRange.txt file for dedicated languages. But anyhow, you have to avoid that font ranges of different languages overlap.

Best regards,

Manfred.

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

...