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

Allow platform specific font matching

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • 5.2.0
    • None
    • GUI: Font handling
    • None

    Description

      We need platform specific font matching to enable locale based
      matching rules in certain font databases. For example it should be
      possible to set a default font family for given language.

      Extends QPA font database to allow platform specific font matching
      in QPlatformFontDatabase and provides the implementation in
      QFontconfigDatabase.

      It works like this: in font loading we will first call
      QPlatformFontDatabase::matchedFontEngine(). Platform font databases
      don't support it will always return 0, if it fails (or returns 0)
      then we fallback to the old routine and do the match() in
      QFontDatabase.

      In QFontconfigDatabase, we will construct a FcPattern * from the
      QFontDef request created by QFont, do the match with fontconfig. One
      special case is when 'script' is not QUnicodeTables::Common, we will
      make sure the script has a higher priority than the fontDef.family,
      so that the behavior is consistent with match() in QFontDatabase (if
      the requested family doesn't support given script we will fallback
      to the default family for that script).

      We also detect the current system locale and see if that's different
      from the script from text. We will modify the language for matching
      if it makes sense. Define QT_NO_LOCALE_FONT_MATCHING to disable it.

      and current unfinished code in https://codereview.qt-project.org/20590

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            liaqi Liang Qi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes