Results 1 to 5 of 5

Thread: Han unification

  1. #1
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Han unification

    Hello,

    is there any solution for the different rendering of han unified glyphs in Qt?


    Thanks for any answer
    Munchhausen


    220px-CJK_variant_glyphs.png
    <copy from http://de.wikipedia.org/wiki/Han-Vereinheitlichung>
    http://en.wikipedia.org/wiki/Han_uni...ent_characters

  2. #2
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Han unification

    Quote Originally Posted by munchhausen View Post
    Hello,

    is there any solution for the different rendering of han unified glyphs in Qt?


    Thanks for any answer
    Munchhausen


    220px-CJK_variant_glyphs.png
    <copy from http://de.wikipedia.org/wiki/Han-Vereinheitlichung>
    http://en.wikipedia.org/wiki/Han_uni...ent_characters

    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

  3. #3
    Join Date
    Jun 2006
    Posts
    81
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    6
    Thanked 5 Times in 4 Posts

    Default Re: Han unification

    Not my cup of tea, but - did you have a look at QLocale::Script?

  4. #4
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Post Re: Han unification

    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/qlo...ml#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
    Last edited by munchhausen; 14th April 2014 at 18:21. Reason: spelling corrections

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Han unification

    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)?
    Last edited by ChrisW67; 15th April 2014 at 01:06.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.