Details
-
Technical task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
We currently select fonts and fallbacks based on the writing system of the text and the ranges that indicate support in the OS/2 table of the font.
This has the limitation that characters such as Hanzi will be detected as Chinese, whereas it can also be Japanese characters (kanji), since they share the Unicode range. In the latter case, you may want a slightly different appearance for the glyphs.
The same issue (the need for regional variants on the same logical characters) exists for Farsi and for some languages that use Cyrillic characters.
The typical way of solving this in HTML is by the language property, and the font engines (such as FontConfig) often support preferring fonts based on language and not just writing system support. In addition, the shaping rules in the font may be language-specific (so the font may support local variants by special OpenType rules).
In Qt, we currently do not enable any of this, since there is no way to indicate to the system what the language of the input string is.
We should add an additional property to QFont for this, and this can also be mapped to QTextFormat and again to the HTML parser.
The level of support would of course depend on the font database and shaper in use.