Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.7.4
-
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.)