<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi all,
<div class=""><br class="">
</div>
<div class="">I was writing this before Karl’s message arrived.</div>
<div class="">But I’ll send it anyway.<br class="">
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 16, 2016, at 8:57 PM, Norbert Preining <<a href="mailto:preining@logic.at" class="">preining@logic.at</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Hi all<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">    fd = epdf_create_fontdescriptor(fontmap, round(stemV->getNum()));<br class="">
</blockquote>
<br class="">
Sounds excellent.<br class="">
<br class="">
What about the other values? As far I understood Ross's email, many of the other values can be real, too.<br class="">
<br class="">
Norbert<br class="">
<br class="">
</div>
</blockquote>
</div>
<div class=""><br class="">
</div>
<div class="">With all due respect, why do anything that changes the number </div>
<div class="">that has been read from a font file?</div>
<div class=""><br class="">
</div>
<div class="">Surely all (modulo a case discussed below) pdfTeX does with  stemV  is to build</div>
<div class="">the font-descriptor dictionary, which is written into the PDF file as a string.</div>
<div class=""><br class="">
</div>
<div class="">So by all means read the  stemV  value from a font file as a number (integer or float)</div>
<div class="">but then immediately convert it into its string representation, which is how it should </div>
<div class="">be written out again, preserving the accuracy that was originally supplied.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">The problem case is surely when there is no  stemV  supplied in the font,</div>
<div class="">as with  TTF fonts, but it must be included in the font-descriptor to get valid PDF.  </div>
<div class="">See the following conversation:</div>
<div class=""><br class="">
</div>
<div class=""> <a href="https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font" class="">https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font</a></div>
<div class=""><br class="">
</div>
<div class="">If no  stemV  value is supplied, then one must be created;</div>
<div class="">e.g. estimate it using the width of a non-serifed `I’ in the font family.</div>
<div class="">If the font is italiced, multiply by cosine of the italic-angle.</div>
<div class="">Or produce some other approximate heuristic, as a truly exact value is rarely required.</div>
<div class=""><br class="">
</div>
<div class="">Something of this kind is going on here, isn’t it?</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">writefont.c-    fd->font_dim[DESCENT_CODE].val = i < 0 ? i : 0;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">writefont.c:    fd->font_dim[STEMV_CODE].val =</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">writefont.c-        dividescaled(getcharwidth(f, '.') / 3, pdffontsize[f], 3);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">writefont.c-    fd->font_dim[XHEIGHT_CODE].val =</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">writefont.c-        dividescaled(getxheight(f), pdffontsize[f], 3);</div>
</div>
<div class=""><br class="">
</div>
<div class="">but the result is an integer. </div>
<div class=""><br class="">
</div>
<div class="">If such a calculation were to produce a float, then approximate/truncate it in some fashion</div>
<div class="">and convert to a string for inclusion in the font-descriptor.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">It is clear from the following link that other software treats  stemV  as non-integer:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://documentation.devexpress.com/#CoreLibraries/DevExpressPdfPdfFontDescriptor_StemVtopic" class="">https://documentation.devexpress.com/#CoreLibraries/DevExpressPdfPdfFontDescriptor_StemVtopic</a></div>
<div class=""><br class="">
</div>
<div class="">Indeed here it is declared as a  double !!</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Hope this help,</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>Ross</div>
<br class="">
<div apple-content-edited="true" class="">
<div style="font-family: Arial, sans-serif; orphans: 2; widows: 2; " class=""><span class="Apple-style-span" style="font-size: 9px;"><b class=""><span style="font-size: 9pt;" class=""><br class="Apple-interchange-newline">
Dr Ross Moore</span></b></span></div>
<div style="font-family: Arial, sans-serif; orphans: 2; widows: 2;" class="">
<p style="font-family: Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(119, 119, 119); font-size: 7pt; margin-bottom: 3.75pt;" class="">
<font color="#000000" class=""><span style="font-size: 9pt;" class=""><b class="">Mathematics Dept </b><b class="">|</b> Level 2, S2.638 AHH<br class="">
Macquarie University, NSW 2109, Australia</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;" class=""></span></font></p>
<p style="font-family: Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(119, 119, 119); font-size: 7pt; line-height: 11.25pt; margin-bottom: 3.75pt;" class="">
<b class=""><span style="font-size: 9pt;" class=""><font color="#000000" class="">T:</font></span></b><span style="font-size: 9pt;" class=""><font color="#000000" class=""> +61 2 9850 <b class="">8955  |  F:</b> </font><a href="tel:%2B61%202%209850%209695" value="+61298509695" target="_blank" class=""><font color="#000000" class="">+61
 2 9850 8114</font></a><br class="">
<font color="#000000" class=""><b class="">M:</b><a href="tel:%2B61%20409%20125%20670" value="+61409125670" target="_blank" class="">+61 407 288 255</a><b class="">  |  </b>E: </font><a href="mailto:rick.minter@mq.edu.au" target="_blank" class=""><font color="#000000" class="">ross.moore@mq.edu.au</font><font color="#1155cc" class=""><span style="color: black;" class=""></span></font></a><font color="#1155cc" class=""><span style="color: black;" class=""></span></font><span style="color: black;" class=""></span><br class="">
</span></p>
<p style="font-family: Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(119, 119, 119); font-size: 7pt; line-height: 11.25pt; margin-bottom: 3.75pt;" class="">
<span style="font-size: 9pt;" class=""><span style="color: black;" class=""><a title="Macquarie University" href="http://mq.edu.au/" target="_blank" class="">http://www.maths.mq.edu.au</a></span></span></p>
<p style="color: rgb(0, 0, 0); font-family: Arial, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://mq.edu.au/" target="_blank" class=""><br class="Apple-interchange-newline">
<span><img height="58" width="260" apple-inline="yes" id="D5CA9C04-00AE-4155-9D45-536FD4A3C546" apple-width="yes" apple-height="yes" src="cid:image001.png@01D030BE.D37A46F0" class=""></span></a></p>
<p style="font-family: Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(119, 119, 119); font-size: 7pt;" class="">
<a href="http://mq.edu.au/" target="_blank" class=""><span style="color: rgb(119, 119, 119); font-size: 7pt;" class=""><br class="Apple-interchange-newline">
CRICOS Provider Number 00002J. Think before you print. <br class="">
Please consider the environment before printing this email.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;" class=""></span></a></p>
<p style="font-family: Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(119, 119, 119); font-size: 7pt;" class="">
<a href="http://mq.edu.au/" target="_blank" class=""><span style="color: rgb(119, 119, 119); font-size: 7pt;" class="">This message is intended for the addressee named and may <br class="">
contain confidential information. If you are not the intended <br class="">
recipient, please delete it and notify the sender. Views expressed <br class="">
in this message are those of the individual sender, and are not <br class="">
necessarily the views of Macquarie University.</span></a></p>
</div>
</div>
<br class="">
</div>
</div>
</body>
</html>