View Full Version : Han unification
munchhausen
9th April 2014, 19:28
Hello,
is there any solution for the different rendering of han unified glyphs in Qt?
Thanks for any answer
Munchhausen
10276
<copy from http://de.wikipedia.org/wiki/Han-Vereinheitlichung>
http://en.wikipedia.org/wiki/Han_unification#Examples_of_language_dependent_cha racters
munchhausen
10th April 2014, 17:41
Hello,
is there any solution for the different rendering of han unified glyphs in Qt?
Thanks for any answer
Munchhausen
10276
<copy from http://de.wikipedia.org/wiki/Han-Vereinheitlichung>
http://en.wikipedia.org/wiki/Han_unification#Examples_of_language_dependent_cha racters
Does anybody know, if Qt does support so called stylistic alternates resp. Han unification glyphs?
Given that Qt does support the feature, for me it looks like to set enum QFontDatabase::WritingSystem in QFontEngine, does it?
But there is no access for, isn't there?
Finally I have to set the right stylistic alternates for the languages. The font does support stylistic alternates, the glyphs for are in there.
QFontDatabase::SimplifiedChinese
QFontDatabase::TraditionalChinese
QFontDatabase::Japanese
QFontDatabase::Korean
(QFontDatabase::Vietnamese)
Is there any other way, e.g. by help of QLocale. Trials with fail up to now, unfortunately :(
Thanks for any help
Munchhausen
zaphod.b
12th April 2014, 11:18
Not my cup of tea, but - did you have a look at QLocale::Script?
munchhausen
14th April 2014, 17:14
Thanks for your answer.
I checked it. There was a big improvement from version 4.8 to 5.2:
http://qt-project.org/doc/qt-4.8/qlocale.html#Script-enum
http://doc.qt.digia.com/qt-5.2/qlocale.html#Script-enum
I use Qt 4.8.4, in my application QLocale::script() gives always 0 (Default, AnyScript), for US, Chinese, Japanese, ... language.
...
// QLocale loc( QLocale(QLocale::Japanese) );
QLocale loc( QLocale(QLocale::Chinese) );
...
QLocale::Script scr = loc.script();
stmp.sprintf(" [%3i] <%20s>\n", scr, QLocale::scriptToString(scr).toUtf8().data() ); sout.append(stmp);
...
under Qt 4.8.4 the output is:
" [ 0] < Default>",
I expected:
" [ 0] < AnyScript>"
The next I did:
"export LANG=ja_JP.utf8"
in console with the same result.
The next question is to bring parameters from QLocale to the font rendering engine?
A good idea, unfortunately it seems to be a blind alley :(
I ask myself how do Japanese people solve this kind of problem :confused:
ChrisW67
14th April 2014, 23:00
I ask myself how do Japanese people solve this kind of problem
I imagine if you use a font that contains only the Japanese glyph of the unified code points then that is what you see on the screen.
You can ask the QFontDatabase for a list of font families that support a certain writing style. If you then create a QFont using one of those families I would expect you would get the relevant glyph variant for the current system locale. A quick experiment here did not seem to work, but I am not sure of the fonts I used.
Your problem, if I read correctly, is that you have a single (unspecified) font that contains glyphs for some or all of the variants of the unified code points and you only ever get the fall-back glyph. Can you provide a small, complete example using a commonly available font that demonstrates the problem? Can you also demonstrate that the same font actually does contain multiple variants (using another program for example)?
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.