> I need to get glyph widths from the physical font and
> as far as I know there's no way to do that with the
> standard Font class.
You may be right. On the other hand, the Font class has methods like createGlyphVector which returns a GlyphVector object. And that class has methods like getGlyphMetrics and getGlyphPixelBounds that appear to me to provide that sort of information. But I haven't actually used them, so I can't guarantee they will work for your particular requirements.
> You may be right. On the other hand, the Font class has methods like
> createGlyphVector which returns a GlyphVector object. And that class has
> methods like getGlyphMetrics and getGlyphPixelBounds that appear to me to
> provide that sort of information. But I haven't actually used them, so I can't
> guarantee they will work for your particular requirements.
This is oh, so close to what I need, but I can't get the kerning values from the GlyphVector. Thanks for the idea though.
So it's not just glyph widths you need, it's kerning information as well? Can we go back one more step to your actual requirement? Because if it's that you need to know the width of a particular String as represented by a particular font, you don't need to do those niggly calculations yourself. There are methods for that too.