Fontinst challenge...

Han The Thanh
Tue, 27 Jun 2000 17:04:41 -0400

> >and the map entries are:
> >
> >putr8ax "1.5 ExtendFont" <putr8a.pfb <8a.enc
> >putr8a <putr8a.pfb <8a.enc
> >
> The <8a.enc words here worries me, since unless something is really wrong
> the encodings should appear first, and the 8a encoding shouldn't have an
> encoding file to be downloaded at all because (i) it's the font's default
> encoding and (ii) because it is predeclared in every postscript interpreter
> (it's the StandardEncoding). Did you by any chance give a \specifypsfont
> command? It shouldn't be necessary in this case, since you can get the
> suffix .pfb simply through the command
>   \resetstr{PSfontsuffix}{.pfb}

I just created the entries by hand and didn't know that the encoding must
be specified first. I use it with pdftex and didn't test with dvips yet. 

The encoding 8a.enc could be omited. The reason why I have it here is a
workaround for a bug of earlier versions of Acrobat Reader on unix, where
fonts with AdobeStandardEncoding are treated like AdobeMacEncoding. Anyway
the encoding vector is written just once for all fonts, so it doesn't hurt
so much to have it here. 

> >Can you please provide a way to access to BBox of glyphs read from an afm?
> I notice that it's a frequent request, but it seems that you have already
> done something about it youself by now. What you sent me looks like it
> should be contrib'ed, but there are a few points I think you should think
> about:
> - What's the raw font name argument of \setglyphbbox good for?

likely for nothing. I just copied most of things from the existing macros
so the required work is minimal.

> - Is there really a need for duplicating the height and depth information
> like that? (You store it once in \g-<glyph> and once in \gb-<glyph>.)

like above, there is no need but it saves me much time to do it in that

> - Is that really the best way to transform the glyph bbox when shearing?
> (As an alternative, I would suggest considering the x-coordinates as
> coordinates of points on the baseline.)

I really don't know. I didn't test with slant font yet. In other cases
the current mechanism seems to work fine.

> - There should be an \ifglyphhasbbox test (use \if_defined).
> - Several of the commands rather belong in an MTX file (but that could well
> be generated from the same .dtx file as the .sty).
> Those are minor matters, though. On the whole it looks fine.

the stuff I did is just a quick hack. Please feel free to change what you
consider necessary. I just wanted to spend minimal time on it to get it
work for my (very particular) need.

> >I think that's better to compose glyphs based on their BBox rather than
> >width and xheight.
> Well, it's not as if the bbox is totally ignored---the standard height and
> depth of raw glyphs are almost always the top and bottom of the bbox. I
> suspect that the reason \topaccent uses the xheight for vertical
> positioning is that it is modelled after the \accent primitive.

as I mentioned in the previous mail, I would prefer manual to automatic
placement of accents. The requirement is different for different
languages. For example, aacute in czech has the acute moved slightly to
the right side instead of centered.