• Post Reply Bookmark Topic Watch Topic
  • New Topic

GlyphVector bounds and kerning, ligatures  RSS feed

Steve Lovelace
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
screen shot
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!