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

Create API to select vertical metrics on fonts

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.3
    • GUI: Font handling
    • None

    Description

      Font files contain ascent/descent metrics in multiple different locations. In the OS/2 table there is the winAscent/winDescent, which is used on Windows. In addition, there is typoAscent/typoDescent in the same table, which is used by "modern" applications for layouts when the USE_TYPO_METRICS flag is set, because winAscent/winDescent applies clipping to the glyph and is thus restrictive in what values can be used (they can not be smaller than any glyph for instance).

      In addition, the HHEA table has ascent/descent which is used on macOS.

      In well-formed, cross-platform fonts, USE_TYPO_METRICS will usually be set and the typo-metrics and the HHEA-metrics will match. But this is not always the case, causing some problems, since there is no way to know which set of metrics are intended to be used.

      We tried defaulting to OS/2 metrics on all platforms, since this is an optional table, so why include it unless you want the metrics to be usable? But it turned out that it is often left in with bogus data, notably for several macOS system fonts, so this was reverted.

      In the end, there is no way to know which metrics are bogus and which are real, so we need to default to looking system native. But since it's fairly common to have problems here, we could add style strategies that allow selecting which set of metrics to use and thus make more fonts usable cross-platform. This could be QFont::MacOSVerticalMetrics and QFont::WindowsVerticalMetrics for instance, since those are the two main platforms with clear preferences. Or HHEAVerticalMetrics/OS2VerticalMetrics.

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes