[tex-k] Incorrect sizes in GFtoDVI output

Yannis Haralambous yannis1962 at gmail.com
Tue Nov 16 08:25:09 CET 2021



> Le 16 nov. 2021 à 04:11, Igor Liferenko <igor.liferenko at gmail.com> a écrit :
> 
> Consider the following `x.mf'
> 
>    mode=localfont;
>    mode_setup;
>    beginchar("e",10pt#,7.5pt#,2.5pt#);
>    pickup pencircle;
>    draw origin;
>    endchar;
>    end

After pencircle you have to provide its width, for example:

pickup pencircle scaled 1pt;

> Run `mf x', `gftodvi x.600gf' and `dvitype x'
> 
> First of all, what does this line in the output mean?
> 
>    Font 1: cmr8Font 2: cmtt10Font 3: grayFont 5: logo8

That's normal, it means that your DVI file is using four fonts 1, 2, 3 and 5

> Then we have a lot of warnings:
> 
>    182: setchar77 h:=0+456126=456126, hh:=58 warning: |h|>0!
>    183: setchar69 h:=456126+360590=816716, hh:=104 warning: |h|>456126!
>    184: setchar84 h:=816716+336706=1153422, hh:=147 warning: |h|>816716!
>    etc.
> 
> Are the warnings because of GFtoDVI or because of MF?

For some reason gftodvi uses as maximum width of the DVI file the bbox of the set of glyph's pixels
(not the width of the box but the one of the pixels). When I added "scaled 1pt" to pencircle, I got
a max_h of 505200sp and the following:

182: setchar77 h:=0+456126=456126, hh:=29 
183: setchar69 h:=456126+360590=816716, hh:=52 warning: |h|>505200! 

which means that as long as the width of characters in the DVI file is less than 505200 there
is no warning (line 182), but there is a warning line 183 (where the horizontal coordinate attained is 816716sp).

So IMHO the problem is that gftodvi uses global width of the pixel set to calculate the max_h parameter
in the postamble of the produced DVI file.

But gftodvi can hardly do otherwise because there is no information on the character's box in the GF data:

This is GFtype, Version 3.1 (TeX Live 2019)
Options selected: Mnemonic output = false; pixel output = false.
' METAFONT output 2021.11.16:0806'

35: beginning of char 101

Postamble starts at byte 58.
design size = 134217728 (128pt)
check sum = 1721990706
hppp = 544093 (8.3022)
vppp = 544093 (8.3022)
min m = -4, max m = 4
min n = -4, max n = 3
Character 101: dx 5439488 (83), width 81920 (83.022), loc 35
The file had 1 character altogether.

The information about the character's width is stored in the tfm file, and gftodvi, as its name
implies, will read the gf file only, and not the tfm file.

Having a very small max_h in the DVI is weird (and one could imagine a standard max_h of 21cm or something
like that) but, after all, these are just warnings, they are not blocking in any way. And dvips does a proper job
in converting into PostScript, despite the max_h parameter's value.

Cheers,

Yannis

 <http://www.imt-atlantique.fr/>	Yannis HARALAMBOUS
Professor
Computer Science Department
UMR CNRS 6285 Lab-STICC
 <http://perso.telecom-bretagne.eu/yannisharalambous/> <https://twitter.com/y_haralambous> <https://www.linkedin.com/in/yannis-haralambous-5529073?trk=hp-identity-name>Technopôle Brest-Iroise CS 83818
29238 Brest Cedex 3, France
Une école de l'IMT <http://www.imt.fr/>
Логика –– это наука о законах мышления. Теперь я должен объяснить вам,
что такое наука, что такое закон и что такое мышление.
Что такое ‘о’, я объяснять не буду.     (Юрий И. Манин, Математика и физика)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-k/attachments/20211116/99ff6dd8/attachment-0001.html>


More information about the tex-k mailing list.