I have an application where the drawing size is fixed but you can zoom
in and out. I want the word wrapping to stay the same whatever the
resolution, but ideally the glyphs should vary so as to be most legible.

FontRenderContext is used determine the scale between Font size and
pixels, which affects TrueType hinting, which affects the glyph
outlines, which affects how nice the characters look when they get drawn
to the screen.

FontRenderContext is also used by LineBreakMeasurer in order for it to
know when to word-wrap. This makes sense because the size of the glyphs
can affect the size of the line, which means at different resolutions
you might need to wrap at different places.

If I used a fixed FontRenderContext for word wrapping, I can pretty
easily re-create the GlyphVectors on the fly, but the length of each
GlyphVector can still change. Ideally there would be a createGlyphVector
method that also took a target length, and varied the character/word
spacing to make it fit (similar to TextLayout.getJustifiedLayout).

I've considered actually trying to use getJustifiedLayout, but the
TextLayouts are created by LineBreakMeasurer and I can't see a way to
"update" the FontRenderContext.

Any suggestions welcome!

Thanks,
Chris

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to