Re: pdftex core dump when including certain pdf files
Ross Moore <[email protected]>
| Newsgroups | gmane.comp.tex.pdftex |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]<mailto:[email protected]>> 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. Norbert 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: https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font 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: https://documentation.devexpress.com/#CoreLibraries/DevExpressPdfPdfFontDescriptor_StemVtopic Indeed here it is declared as a double !! Hope this help, Ross 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: [email protected]<mailto:[email protected]> http://www.maths.mq.edu.au<http://mq.edu.au/> [cid:[email protected]]<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/>
image001.png
(image/png, 4.5 KB) - not displayed