Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.6.2
-
None
Description
From perusing the Qt source, this seems to be supported: QPdfBaseEnginePrivate::drawTextItem(..) sets up the QFontSubset and writes out the text, and the font is later embedded in QPSPrintEnginePrivate::emitPages() (and flushPage(..)) by calling QFontSubset::toType1().
However, in practice this isn't working.
The font is never embedded because it has an empty faceId, which is tested for in QPdfBaseEnginePrivate::drawTextItem(..). After digging around, I discovered that this is due to what seems like a bug in QFontEngineWin.
When QFontEngineWin::getCmap is called from the constructor, the cmap table is only retrieved for actual TrueType fonts, i.e. when the Win32 API supplies TMPF_TRUETYPE as part of the tmPitchAndFamily in the TEXTMETRIC structure. This is also the condition for setting the 'ttf' member variable, which is later checked by getSfntTable (amongst others). However, OpenType fonts share the basic sfnt file format of TrueType fonts, and a cmap table can therefore be loaded. This would result in the faceId getting set correctly in the QFontEngineWin constructor, as required for PS/PDF font embedding.
Attached is a small reproducable case.
JL 11-6-10: The lack of support for OpenType PS font's cmap tables was causing other problems - see QTBUG-11387. I've fixed it locally. My patch is attached to QTBUG-11387 but also resolves this bug.
Attachments
Issue Links
- is required for
-
QTBUG-25378 QtPrintSupport - Font Issues
- Open
-
QTBUG-25379 QtPrintSupport - PDF Issues
- Open
-
QTBUG-25384 QtPrintSupport - Windows issues
- Open
- relates to
-
QTBUG-10094 PostScript / PDF font embedding fails on Mac 64-bit due to unimplemented methods in QCoreTextFontEngine
- Closed