Dixi quod…

>$ atril moo.pdf

Further debugging reveals the cause:

When Qt5 embeds a font, it scales it to 2048 ppem, no matter if
it was 1000 ppem (PS/CFF) or 1024 ppem (TTF) before. I think this
is because [QTBUG-586] it cannot embed CFF fonts, so it always
converts to TTF (apparently even if it was TTF already).

The conversion is done not incompetently, the new metrics are
correct… but it only changes the metrics in the head table, not
in the OS/2 or hhea tables (as can be seen when loading the font
from the PDF in FontForge). Furthermore, the /FontBBox in the PDF
is constructed from the values from the original font.

I can confirm that if I prescale the font to 2048 ppem, ceteris
paribus, the bug no longer appears.

QPdfEnginePrivate::embedFont calls font->toTruetype()
but later uses font->fontEngine->properties() for metrics.

QFontSubset::toTruetype does the conversion to 2048 ppem
and others, saying it does not need to add an OS/2 table,
only to later copy the one from the original font if present
without adjusting its values.

bye,
//mirabilos
-- 
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent

Reply via email to