File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes GlyphVector bounds and kerning, ligatures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GlyphVector bounds and kerning, ligatures" Watch "GlyphVector bounds and kerning, ligatures" New topic
Author

GlyphVector bounds and kerning, ligatures

Steve Lovelace
Ranch Hand

Joined: Sep 03, 2003
Posts: 125
Shouldn't GlyphVector report positions/bounds for glyphs which reflect kerning and ligatures, i.e., shouldn't it yield metrics which correspond to what is actually rendered by Graphics2D.drawString() or TextLayout.draw()? Below is a little app which will throw up a frame showing a string rendered in black, the GlyphVector's logicalBounds in yellow fill, and the logicalBounds of each glyph in red. You can see the bounding rectangles creep as kerns and ligatures are encountered. I had to pick a font that actually does kerning and ligatures (DejaVu Sans) because on my system (JDK1.6-u13 on Ubuntu 9.04) the default fonts do not. Attached is a screen shot of the frame produced.

>



[Thumbnail for glyphvectorbounds.png]



The Inner that is named is not the true Inner.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GlyphVector bounds and kerning, ligatures