[metapost] Uninitialized variable sometimes causing malformedTFM files

luigi scarso luigi.scarso at gmail.com
Sun Mar 24 02:08:52 CET 2019


On Wed, Mar 20, 2019 at 10:19 PM Akira Kakuto <kakuto at w32tex.org> wrote:

> > ! Inconsistent equation (off by 2.77794).
> > <to be read again>
> >                    ;
> > l.230 mm*bpppix_=2.83464;
> >                               pt*bpppix_=0.99626;
> > ?
>
> Confirmed.
>
> The command mfplain seems to work:
>
>
yes , but  we can keep the same mp source as in mplib :
so
$> mpost --ini test.mp

# cat test.mp
input mfplain;mode:=localfont;input cmr10.mf;


and

# luatex test.tex

# cat test.tex
\directlua{
local find_file
do
  local kpse = kpse.new('lualatex', 'mpost')
  find_file = function(name, mode, type)
    return mode == 'w' and name or kpse:find_file(name, type) or (type ==
'mp' and kpse:find_file(name, 'mf'))
  end
end
local mp = mplib.new{
  job_name = 'cmr10',
  find_file = find_file,
  math_mode = 'scaled',
}
local result = mp:execute'input mfplain;mode:=localfont;input cmr10.mf;'
print(result.term)
}
\bye

must give the same result.

I have made a fix that uses calloc instead of malloc, because I have found
that some nodes  can use uninitialized memory.



-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20190324/13ce13c9/attachment.html>


More information about the metapost mailing list