Re: [JAVA2D] GlyphVectors

2006-06-05 Thread Phil Race

For text display issues where you are using using the Graphic2D class
and TextLayout
and GlyphVector this is the right place.

But there is a Java Internationalization forum
http://forum.java.sun.com/forum.jspa?forumID=16
which may be a more appropriate forum for other text processing questions

-phil.

Peter B. West wrote:


Is this the right place to ask questions concerning GlyphVectors and
other text-processing components which may overlap with I18N?

Peter

===
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.




===
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.


Re: [JAVA2D] GlyphVectors and rendering text in multiple fonts fast

2001-03-07 Thread Emmanuel Deviller

En rponse  Sampsa Mikael Sojakka [EMAIL PROTECTED]:

I am also working on a program which need complex custom layout of text.
(Desktop Publishing).

I currently use a class which cache a glyphvector (per glyph!) and its basic
fontmetrics. The creation of the glyphvector is pretty slow but the rendering
is fast enough to type while displaying 2000 glyphs. (faster than drawstring()
anyway).

Emmanuel.

And drawing this Glyphvector
 using the Graphics2D method drawGlyphVector() is very slow.

 Hi,

 I am currently in the process of writing a light HTML renderer. In
 order
 to accomplish this I obviously need to support custom layout of text
 rendered in multiple Fonts and varying sizes.

 My original idea was to use the Flyweight design pattern of caching
 glyphs and using references to these glyphs during the layout and
 positioning of the characters in the text. Unfortunately the Java API
 does not allow me to access individual Glyph objects. Instead, I can
 use
 createGlyphVector() in java.awt.Font to get a GlyphVector that
 encompasses the glyphs. The problem is that drawing this Glyphvector
 using the Graphics2D method drawGlyphVector() is very slow. In fact it
 is so slow that it is hard to imagine any practical use for this
 method
 at all. This is bewildering since the Java API documentation claims
 that
 a GlyphVector "is the fastest method to present the visual
 representation of characters to a user".

 I have also experimented with the standard drawString() method which
 achieves acceptable performance iff no bound calculations are
 performed.
 Unfortunately I need these bound calculations in order to handle the
 custom layout management of text in various fonts...

 So the question is:
 Does anyone know of a fast way of rendering styled text in Java? How
 do
 the classes in javax.swing.text and javax.swing.text.html handle this?
 Should I cache bound calculations for individual rendered characters
 or
 is there a better way I'm not seeing?


 Cheers,

 Sampsa Sojakka

===
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".