Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-51979

Font could be matched only when the family supports language, so glyph is not shown.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.4.0
    • GUI: Font handling
    • None

    Description

      This is a process when loading a font

      1) When we write text, Qt finds their code points and detects if they are in a font family (if not, load fallback font and then execute). 
      2) If their glyphs are in the font family, Qt renders that. 
      3) But at that point in Qt font engine, That has checked if the font family has "language" value that code points belong to.
      4) That is, Qt can use only the font when the font supports not the code points we want, but also their language, 
      

      This is a source code in qfontdatabase.cpp

      static int match(int script, const QFontDef &request,
                       const QString &family_name, const QString &foundry_name,
                       QtFontDesc *desc, const QList<int> &blacklistedFamilies)
      {
      ............
       for (int x = 0; x < db->count; ++x) {
              if (blacklistedFamilies.contains(x))
                  continue;
              QtFontDesc test;
              test.family = db->families[x];
      
              if (!matchFamilyName(family_name, test.family))
                  continue;
      
              test.family->ensurePopulated();
      
              // Check if family is supported in the script we want
              if (writingSystem != QFontDatabase::Any && !(test.family->writingSystems[writingSystem] & QtFontFamily::Supported))
                  continue;
      
              // as we know the script is supported, we can be sure
       // to find a matching font here.
              unsigned int newscore =
                  bestFoundry(script, score, request.styleStrategy,
                              test.family, foundry_name, styleKey, request.pixelSize, pitch,
                              &test, request.styleName);
      ......................
      

      That occurs this issue.

      • Language value that a font has is already determined by "FontConfigure"
      • FontConfigure has "*.orth" files that is specified in language code points. (ex. "en.orth" file contains English code points)
      • If a font family has all code points that "*.orth" contains, they will have the language value.

      At the present, I have a customized Dingbat font that uses "ru" language code points (from 0xA640 to 0xA653).
      But, This font does not contain all code points in "ru.orth", so they cannot have a "ru" language value.
      Therefore, when Qt renders glyphs range from 0xA640 to 0xA653 by my Dingbat font, they skip the font and select fallback font. That is why glyphs are not shown on Qt.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            chohana Hana Cho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes