[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AFM font handling corrected?

From: Mats Bengtsson
Subject: Re: AFM font handling corrected?
Date: Wed, 30 Jul 2003 10:39:33 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507

OK, I checked the Adobe Font Metrics File Format Specification
document (available at, for example) and
found the following statement:

3.2 Units of Measurement

All measurements in AFM, AMFM, and ACF M fi les are given in terms
of units equal to 1/1000 of the scale factor (point size) of the font
being used. To compute actual sizes in a document (in points; with
72 points = 1 inch), these amounts should be multiplied by
( scale factor of font ) / 1000.

As far as I can understand, this means that the values should be
multiplied by 10/1000 for cmr10, right? Note that the definition
of point here is different from what TeX uses 1 inch = 72.27pt,
but that should only make a minor difference.

cmr10.afm and other AFM files can be found at CTAN in /fonts/cm/afm/.

I tried to quickly browse through the source code of afm2tfm that's
included in teTeX, but couldn't find the relevant parts.


Rune Zedeler wrote:
Han-Wen Nienhuys wrote:

IIRC the 1000 in an AFM is relative to either the design size or the
baselineskip of the font. Isn't an em 10pt in cmr10?

I tried to (dirtily) hack to multiply the sizes by 10 if the font is CMR10.
It does not give exactly the same results with and without the afm-file.
Unfortunately I made a test file which produces bad results no matter if the cmr afm-files are there or not. The result is worse with the afm-files, but it is also wrong without them :-(

\score {
    \notes <
    \context Staff \notes { c d e f g a b c' c d e f }
\context Lyrics \lyrics { this is a loooooooooooooooooooooooooong test aaaa }

the long word overlaps the next word.
Without the afm-files (i.e. on a tetex-system) it is approx "ng" that overlaps, where as with the afm-files, "oong" overlaps.
Can anybody else reproduce this bug?

The bug is also there in 1.6, so 1.8 is not in danger :-)

The font-metrics code really needs an intense look.


        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]