Thread: Font question
View Single Post
  #1 (permalink)  
Old 05-13-2007, 01:26 AM
orchid's Avatar
orchid orchid is offline
Member
 
Join Date: Apr 2007
Location: Midwest
Posts: 60
orchid is on a distinguished road
Font question
I have a question regarding font attributes.
I need to be able to change the width and/or the height of every character I paint on the screen.

Unfortunately Java only seems to allow to set the size of the font. What I am looking for is the possibility to change either the width, or the height. (this means "taller" characters with same width, or "larger" characters with same height).

Any idea on how I can do this?
I'm using this method to paint my characters:

Code:
Graphics2D g2 = (Graphics2D) g; GlyphVector gv; FontRenderContext frc = g2.getFontRenderContext(); int oneGlyph[] = { asciiToArialSymbol[c] }; gv = fontSymbol.createGlyphVector( frc, oneGlyph ); g.setFont(fontSymbol); g.setColor(col); g2.drawGlyphVector( gv, hStart+j*hOffset, vStart+(i+1)*vOffset-vDescent);
thanks
Reply With Quote
Sponsored Links