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

The glyph list in QFontSubset is incomplete, resulting in some glyphs getting the wrong names in exported EPS files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.0.0
    • 4.7.4
    • GUI: Text handling
    • None
    • dd68e93de7eb1c50cc5b5779497e03f491c90373

    Description

      The glyph list at the top of QFontSubset.cpp is incomplete - it doesn't include 'trademark' for one example, so any text including that glyph in an embedded font will not be exported correctly. The glyph will be named 'uni2122' instead, which means that it won't display correctly in Adobe Illustrator.

      The correct list to use for embedded fonts is here:
      http://www.adobe.com/devnet-archive/opentype/archives/aglfn.txt

      I noticed some other oddities about the list in QFontSubset too. The glyph name 'space' appears twice, and there are entries at the end of 'unicode_to_aglindex' which seem to refer to parts of the glyph list that don't actually exist in the 'agl' array. The last entry in 'agl' is 'upsilondieresis', which is codepoint 0x03CB, but there are a further 8 entries in 'unicode_to_aglindex' after this point which as far as I can tell will run over the end of the the 'agl' array if used at runtime, causing a crash or data corruption.

      Once the full glyph list is included, it would be better if QFontSubset::glyphName used a binary rather than a linear search as this will start getting quite inefficient with more glyphs.

      I knocked up a quick Python script to make the correct glyph arrays for QFontSubset from the Adobe master - attached.

      (See also QTBUG-12727, which may need patching before you can reproduce this one.)

      Attachments

        1. qtglyphlist.cpp
          15 kB
          James Larcombe
        2. rebuildQtGlyphList.py
          4 kB
          James Larcombe
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jlarcombe James Larcombe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes