[dvipdfmx] Font format is determined as OFM for TFM fonts

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Wed Apr 14 14:45:39 CEST 2021


2021年4月14日(水) 11:55 Igor Liferenko <igor.liferenko at gmail.com>:
>
> Hi,
>
> The following code on lines 887--890 of dvipdfm-x/tfm.c must be removed
>
>  else if ((file_name =
>                kpse_find_file(tfm_name, kpse_ofm_format, 0)) != NULL) {
>      format = OFM_FORMAT;
>    }
>
> Firstly, this code is not necessary anyway, because OFM file is
> already searched first.

It does search OFM file without the "ofm" suffix appended. This one is
intended behavior.

> And secondly, this code causes a bug:
> if a tfm-file is found in OFMFONTS path, then
> font type is determined as OFM_FORMAT.
> So, ofm_open() is called for this tfm-file. This produces an error.

So, this is not a bug of dvipdfmx.

> I think the person who wrote this code blindly copied it from what is now
> between #if 0 ... #endif on lines 862--868 of dvipdfm-x/tfm.c
> This code has this call:
>
>      kpse_find_file(tfm_name, kpse_ofm_format, 0)
>
> which is wrong: instead of tfm_name there should be ofm_name.

No, this is not wrong. "tfm_name" here is just a font name, not
indicating either TFM or OFM (format).
"ofm_name" was introduced just to ensure that OFM files are returned
by forcing the "ofm" suffix which is actually a workaround.


Shunsaku Hirata



More information about the dvipdfmx mailing list.