[pdftex] pdftex core dump when including certain pdf files

Ross Moore ross.moore at mq.edu.au
Sun Jul 17 00:46:35 CEST 2016

Hi all,

I was writing this before Karl’s message arrived.
But I’ll send it anyway.

On Jul 16, 2016, at 8:57 PM, Norbert Preining <preining at logic.at<mailto:preining at logic.at>> wrote:

Hi all

    fd = epdf_create_fontdescriptor(fontmap, round(stemV->getNum()));

Sounds excellent.

What about the other values? As far I understood Ross's email, many of the other values can be real, too.


With all due respect, why do anything that changes the number
that has been read from a font file?

Surely all (modulo a case discussed below) pdfTeX does with  stemV  is to build
the font-descriptor dictionary, which is written into the PDF file as a string.

So by all means read the  stemV  value from a font file as a number (integer or float)
but then immediately convert it into its string representation, which is how it should
be written out again, preserving the accuracy that was originally supplied.

The problem case is surely when there is no  stemV  supplied in the font,
as with  TTF fonts, but it must be included in the font-descriptor to get valid PDF.
See the following conversation:


If no  stemV  value is supplied, then one must be created;
e.g. estimate it using the width of a non-serifed `I’ in the font family.
If the font is italiced, multiply by cosine of the italic-angle.
Or produce some other approximate heuristic, as a truly exact value is rarely required.

Something of this kind is going on here, isn’t it?

writefont.c-    fd->font_dim[DESCENT_CODE].val = i < 0 ? i : 0;
writefont.c:    fd->font_dim[STEMV_CODE].val =
writefont.c-        dividescaled(getcharwidth(f, '.') / 3, pdffontsize[f], 3);
writefont.c-    fd->font_dim[XHEIGHT_CODE].val =
writefont.c-        dividescaled(getxheight(f), pdffontsize[f], 3);

but the result is an integer.

If such a calculation were to produce a float, then approximate/truncate it in some fashion
and convert to a string for inclusion in the font-descriptor.

It is clear from the following link that other software treats  stemV  as non-integer:


Indeed here it is declared as a  double !!

Hope this help,


Dr Ross Moore

Mathematics Dept | Level 2, S2.638 AHH
Macquarie University, NSW 2109, Australia

T: +61 2 9850 8955  |  F: +61 2 9850 8114<tel:%2B61%202%209850%209695>
M:+61 407 288 255<tel:%2B61%20409%20125%20670>  |  E: ross.moore at mq.edu.au<mailto:rick.minter at mq.edu.au>


[cid:image001.png at 01D030BE.D37A46F0]<http://mq.edu.au/>

CRICOS Provider Number 00002J. Think before you print.
Please consider the environment before printing this email.<http://mq.edu.au/>

This message is intended for the addressee named and may
contain confidential information. If you are not the intended
recipient, please delete it and notify the sender. Views expressed
in this message are those of the individual sender, and are not
necessarily the views of Macquarie University.<http://mq.edu.au/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pdftex/attachments/20160716/39d4a7f2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4605 bytes
Desc: image001.png
URL: <http://tug.org/pipermail/pdftex/attachments/20160716/39d4a7f2/attachment-0001.png>

More information about the pdftex mailing list