<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div data-marker="__QUOTED_TEXT__"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><div>Here's my take:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>If there are extra 32-bit words past the end of the standard TFM data in the header, there is documentation for a Xerox PARC bunch of info, which starts out with two BCPL identification strings stored in a 40-byte and then a 20-byte slot, respectively.<br></div><div><br></div><div>A BCPL string starts with a length byte for the remaining bytes in the string.  Everything after that number of bytes in each field should be ignored, and therefore can be garbage or nulls.  There is no requirement that it be null padding that I recall (or that any TFM parsing code should care about).  From the point of view of data integrity, though, within the string a null byte is technically legal, but not a particularly good idea.  Also, both 40 and 20 are artificially low values, so a bad length byte could be out of range.  Regardless, a null in the legal part of the string will cause problems for any parser that might try to record it as a C string.</div><div><br></div><div>But all of that is only a problem if one is assuming the extra data past what TFM cares about is in that Xerox-added format.  There's no way I can discern to tell different private extended formats apart.  I don't know about any other documented formats in this extra space, but that doesn't mean there aren't any.<br></div><div><br></div><div>Doug McKenna<br></div><div><br data-mce-bogus="1"></div></div><br><hr id="zwchr"><div><b>From: </b>"Tom Rokicki" <rokicki@gmail.com><br><b>To: </b>"Didier Verna" <didier@didierverna.net><br><b>Cc: </b>"texhax" <texhax@tug.org><br><b>Sent: </b>Friday, September 13, 2019 10:19:20 AM<br><b>Subject: </b>Re: [Q] TFM files headers<br></div><br><div><div dir="ltr">Oh, dang, looks like the TFM file format does not require bc <= ec.<div>The amsfonts/dummy example is loaded by TeX and also accepted</div><div>by tftopl.  It does require however that bc <= ec+1 and that ec<256.</div><br><div>The tftopl check reads as follows:<br></div><div><pre style="color:rgb(0,0,0);white-space:pre-wrap">if (bc>ec+1)or(ec>255) then abort('The character code range ',</pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">In TeX we see:</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><pre style="color:rgb(0,0,0);white-space:pre-wrap">if (bc>ec+1)or(ec>255) then abort;
if bc>255 then {|bc=256| and |ec=255|}
  begin bc:=1; ec:=0;
  end;</pre></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">That second part is interesting and unexpected; I believe it's there just so</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">a tfm file that is empty but using bc=256/ec=255 to indicate that, can still</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">work in an environment where bc and ec are stored in 8-bit bytes.</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">TeX also explicitly ignores extra stuff at the end:</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><pre style="color:rgb(0,0,0);white-space:pre-wrap">@ We check to see that the \.{TFM} file doesn't end prematurely; but
no error message is given for files having more than |lf| words.
</pre></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">-tom</div></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 13, 2019 at 9:04 AM Tomas Rokicki <<a href="mailto:rokicki@gmail.com" target="_blank">rokicki@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I also noticed the tfm files with the wrong length (extra stuff on the end).<br><div>While this is moderately unfortunate it's also not critical since all the</div><div>TFM parsers appear to read the TFM files front to back and just ignore</div><div>the junk.</div><br><div>I confirm (with my own TFM parser) that there are 2060 "tfm" files in the</div><div>distribution with bc > ec.  They are in the following directories (with counts</div><div>of the "bad" files).  These files may also have other issues (like bad</div><div>header lengths).  My suspicion is nobody has ever (successfully) used</div><div>any of these fonts.  A cursory test appears to show that TeX cannot load</div><div>these fonts either.</div><br><div>





<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>24 /usr/local/texlive/2019/texmf-dist/fonts/tfm/ptex-fonts/standard</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>12 /usr/local/texlive/2019/texmf-dist/fonts/tfm/ptex-fonts/nmin-ngoth</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">   </span>8 /usr/local/texlive/2019/texmf-dist/fonts/tfm/ptex-fonts/jis</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">   </span>4 /usr/local/texlive/2019/texmf-dist/fonts/tfm/ptex-fonts/dvips</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures">1080 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/japanese-otf</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space"> </span>522 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/japanese-otf-uptex</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>40 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/jlreq</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">   </span>1 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/amsfonts/dummy</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>24 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/zhmetrics-uptex</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space"> </span>260 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/pxufont</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>12 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/hfoldsty</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>25 /usr/local/texlive/2019/texmf-dist/fonts/tfm/public/morisawa</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">  </span>40 /usr/local/texlive/2019/texmf-dist/fonts/tfm/uptex-fonts/jis</span></p>
<p class="gmail-m_-485819406095484412gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-485819406095484412gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-485819406095484412gmail-Apple-converted-space">   </span>8 /usr/local/texlive/2019/texmf-dist/fonts/tfm/uptex-fonts/min</span></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 13, 2019 at 4:13 AM Didier Verna <<a href="mailto:didier@didierverna.net" target="_blank">didier@didierverna.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">"Taylor, P" <<a href="mailto:P.Taylor@rhul.ac.uk" target="_blank">P.Taylor@rhul.ac.uk</a>> wrote:<br>
<br>
> What (if anything) does TFtoPL have to say about the files that your<br>
> parser identifies as being non-compliant ? Philip Taylor<br>
<br>
  It agrees with me :-D<br>
<br>
-- <br>
Resistance is futile. You will be jazzimilated.<br>
<br>
Lisp, Jazz, Aïkido: <a href="http://www.didierverna.info" rel="noreferrer" target="_blank">http://www.didierverna.info</a><br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail-m_-485819406095484412gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>--  <a href="http://cube20.org/" target="_blank">http://cube20.org/</a>  --  <a href="http://golly.sf.net/" target="_blank">http://golly.sf.net/</a>  --</div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>--  <a href="http://cube20.org/" target="_blank">http://cube20.org/</a>  --  <a href="http://golly.sf.net/" target="_blank">http://golly.sf.net/</a>  --</div></div></div></div></div></div></div><br></div></div></body></html>