Meaningless Drivel is fun!*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: GlyphVector bounds and kerning, ligatures
 
Similar Threads
animation
I am trying to create dynamic text
font getting fuzzy on Graphics 2D
way to rotate without using Graphics2D.rotate()
How to force the repainting of a component