[tex-k] Unnecessary check in dvitype

Lucas Mirelmann lgalfaso at gmail.com
Sat Jul 10 18:44:23 CEST 2021


Hi,
  I would like to report an unnecessary check in dvitype.

TL;DR
  dvitype.web reads

@ @<Store character-width indices...@>=
if wp>0 then for k:=width_ptr to wp-1 do

the condition is unnecessary and this should be just

@ @<Store character-width indices...@>=
for k:=width_ptr to wp-1 do



Explanation

`wp` has the value `width_ptr+font_ec[nf]-font_bc[nf]+1`. The values
of `font_ec[nf]` and `font_bc[nf]` were already checks with `if
font_ec[nf]<font_bc[nf] then font_bc[nf]:=font_ec[nf]+1;`. This is
,the condition `wp>0` is only false whenever there are currently no
font metrics loaded _and_ the file for the current font metric does
not contain any characters. Whenever this is the case, the `for` will
handle it.

Regards,
  Lucas


More information about the tex-k mailing list.