[tex-k] AFM2TFM: are length values handled correctly?

Frederic LOYER loyer@ensta.fr
Wed, 3 Oct 2001 22:47:37 +0200

On Wed, Oct 03, 2001 at 02:48:59PM +0400, Vladimir Volovich wrote:
>  >> in AFM files, all lengths (e.g. kerns) are expressed in 1/1000 of
>  >> postscript point, and the latter is defined as (1/72 in),
>  >> i.e. "bp" in TeX notation.
>  FL> One can think of 1000 times the ratio length/font_size... This
>  FL> ratio have no unit.
> sorry, i do not understand what do you mean. could you please
> rephrase?

In order to convert the numbers of your AFM file you should use the following

  length = font_size * numbers /1000

Only  length and font_size are dimensions. (This formula works in pt, bp, in,
anything... if both length and font_size are in the same unit).  The number
here is not a dimension... just a plain number.

In other words, AFM files don't assume any "default unit".

>  FL> which is the same length/font_size ratio.
> what is the same length/font_size ratio? designsize?
> (at least your quote could be interpreted like this)
> i'm sure i do not understand what you are saying, please explain.

Lets see a "ptmr" font... in the AFM file, you have:

C 65 ; WX 722 ; N A ; B 15 0 706 676 ;

The width of this 'A' char is 0.722 times the font size.

In the TFM file... idem

   (CHARWD R 0.722)
   (CHARHT R 0.673)

>  FL> In fact, when you ask for a Type 1 font (\font\f=ptmr), TeX see a
>  FL> 10pt font...
> TeX sees not a 10pt font generally, but whatever the design size is
> specified in the TFM file for that font (in case of ptmr, it is 10pt).
> postscript fonts could have any design sizes, couldn't they?

Afm2tfm has an hardcoded 10pt constant, and could only produce
10pt font.  It's just a convention (which must be consistant with dvips!!).

Type 1 fonts by itself hasn't any design size (PS interpretor see them
as 1bp fonts which must be scaled!). They could be designed to be at
any design size, but they will be handled like 10pt fonts by TeX if
their TFM files are from afm2tfm.

Bluesky fonts are exception... built to be compatible whith cmr TFM, their
design size is well read by TeX (the standard cmr TFM is read).
I suppose the Type1 font itself is already scaled in order to produced the
right result with dvips. This one which could think the design size is 10pt
(to be verified).

>  FL> and just read length as "pt".
> do you mean that the KRN value is read as "pt"? then this is not so.
> e.g., if a KRN is -0.07 (as reported by tftopl), then the kern value
> will be -0.07*designsize, which in this case equals -0.7pt.

No, a -0.07 KRN is seen as a number which must be multiplied
by the font size (design_size if not scaled).  -0.07 has no dimension
unit, but when multiplied by the designsize (10pt) the result has a
unit (-0.7pt).

In a TFM file the only number read as "pt" is the design size, which is
ignored when using the "at" modifier.
Frédéric Loyer <frederic.loyer@club-internet.fr>