Aaron Mulder wrote:
        Okay, so far so good.  Can you take an existing font in the system
and adjust it based on the AFM metrics?  For instance, if my AFM file is
for "Times" and my system has some close but perhaps not exact match,
could I just massage the existing font so the metrics match?

Not addressing the specifics of AFM's but rather trying to keep within the bounds of the 2D APIs I have a suggestion

You could create 2 GlyphVectors's: one from the font that you want
for the glyphs, one for the font that you want the metrics.

you then assign the positions of the latter to the former and
then draw it.

The details of this are left as an exercise for the reader but
one caution is that this doesn't do full text layout.
ie directly creating a glyphvector doesn't get you corectly
re-ordered and glyph substituted arabic, but should work
just fine for Latin scripts.



Also, Font.createFont says that it only supports TrueType fonts, but you mention that Java supports Type 1 too -- how would I load a Type 1 font?

JDK reads Type1 fonts from the same locations as other fonts. Eg drop it into jre/lib/fonts or \windows\fonts

1.5 however does now support Type1 with createFont.

http://java.sun.com/j2se/1.5.0/docs/guide/2d/new_features.html#createFont




And heck, if you'll bear with me for one more, what's the difference between TTF and TTC or PFA and PFB?


TTC is a "collection" of TTF fonts.

PF = Postscript Font "A" = ascii."B=" binary

its just the way the font is stored

Go check out adobe's website

-phil.

Thanks, Aaron

On Fri, 28 May 2004, Igor Nekrestyanov wrote:

Hello Aaron,

Afm stands for Adobe Font Metrics. The afm file is a text file
that lists the postscript metrics of each character in the font in a
readable manner.

Because afm file per se does not contain enough information to
render glyphs there is no way to create java.awt.Font from afm file.

At the moment java supports TrueType fonts (ttf/ttc files) or Type1 fonts
(pfa/pfb files) only.


===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to