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

Re: hidden composites



Thierry Bouche says:
> there exist some fonts (like Monotype baskerville or Lino didot) where
> the AFM declares true chars that are indeed composites built in the
> PFA by  a seac construct. These may fool some partial font downloading
> software (downloading the PFA definition of egrave in mbvr8r willnot
> download the two outlines needed to print this char). An example being
> the current pdftex.

I'd say the problem isn't the AFM, but the partial font downloader; it
should be doing a better job. (It might not even be that hard to fix
if you have the source.)

Generally, I've found that AFMs have more metric information than one
can extract (easily) from a PFA file, however. However, a quick look
at the available information seems to indicate that it might be doable
in this case.

You'd need a tool like t1disasm to look at the relevent `seac' entries
in the CharStrings dictionary, then if you see:

/<glyphname> {
        <sbx> <wx> hsbw
        <asb> <adx> <ady> <bchar> <achar> seac
        } ND

...and, if you let:
   <accentglyph> = StandardEncoding[<achar>]
   <baseglyph>   = StandardEncoding[<bchar>]
   <ax>		 = <sbx> + <adx> - <asb>
   <ay>		 = <ady>

... then you could try the following composite character entry in the AFM
file:

CC <glyphname> 2 ; PCC <baseglyph> 0 0 ; PCC <accentglyph> <ax> <ay> ; 

It shouldn't be too hard to write a perl script to do this all automatically.

This formula was derived emperically, by comparing AFM files of fonts
I had with their corresponding disassembled CharStrings; I make no claims
about its general applicability.

Anyway, I hope this helps,

    Melissa.