Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-17 Thread Michele Puccini
Phil, so, correct me if I'm wrong, the TextLayout.draw() rasterizes every single glyph (and its TextAttributes) to separate images before drawing them to the Graphics ? I can understand the complexity behind glyphs, fonts, graphics and text, but .. is there a specific reason why we need to

Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-17 Thread Phil Race
Michele Puccini wrote: Phil, so, correct me if I'm wrong, the TextLayout.draw() rasterizes every single glyph (and its TextAttributes) to separate images before drawing them to the Graphics ? Yes. That's the way almost all font rendering systems work. The separate images are a 'glyph cache'

Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-17 Thread David Eisner
Michele Puccini wrote: I can understand the complexity behind glyphs, fonts, graphics and text, but .. is there a specific reason why we need to align to the pixel grid ? Maybe we would get the same features of the Texlayout by rasterizing outlines and effects straight to the Graphics and

Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-16 Thread Michele Puccini
Thanks Phil, I did a little mistake: is not a problem of the outline, which is indeed correct. Well, a piece of code is worth a thousand words. The attached sample shows the animated difference between TextLayout.draw() and g2d.draw(TextLayout.getOutline). Please give it a try and see what

Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-16 Thread Jan Bösenberg (INCORS GmbH)
Michele, I have not tested your showcase but I think I know what you mean. Probably the only way to achieve what you want is to implement your own outline rendering by draw the string five times. Four times using the foreground color with x, y offsets (1, -1), (1, 1), (-1, 1), (-1, -1), and

Re: [JAVA2D] AttributedString and Outline (the return of the glyph invaders!)

2006-11-16 Thread Phil Race
First, its not a bug in TextLayout drawString behaves identically. You can prove this as follows, instead of your AttributedString use Font fo = new Font(Serif, Font.PLAIN, 12); fo = fo.deriveFont(AffineTransform.getScaleInstance(2 + scale, 3));