Am Samstag, den 22.04.2006, 23:03 +0200 schrieb Sven de Marothy:
> > Cool! Yeah fonts might be a little problem. As far as I understand from
> > the API docs, fonts are basically also rendered as shapes (a GlyphVector
> > returns shapes for each character). But how do we get the shapes into
> > the memory ..? I think Sascha's work might be a good start.
> 
> You *could* render fonts as shapes, but in general you don't want to do
> it the same way. Fonts need hinting and a different form of antialiasing
> to look good. (Perhaps you've some time run into a PS/PDF document where
> the text is rendered as shapes - seems to happen with latex docs a lot -
> in which case it tends to look like crap on the screen, but just fine
> once you print it.) Java2D has a seperate font-rendering engine, and
> GlyphVector is the final step in that, prior to rendering.

Yeah sure. But let's start with something simple and ugly :-)

> > The third big problem will be images. But at the moment I don't want to
> > think too far. The problem that I will work on next is efficient filling
> > of (arbitrary) shapes. afaics, most java2d operations boil down to
> > filling shapes (either by calling fillXXX() or by calling drawXX(),
> > which will also end up filling a shape - the stroked shape. I found some
> > interesting articles on that:
> 
> Images aren't so bad. You just draw it tiled over the whole area you
> want filled, and then use the outline shape as the clipping bounds. 
> The clipping algorithm is more or less the same as for rendering the
> shapes, you work on a scanline basis.

Well, the situation is not as easy as that. First thing is we have
BufferedImages (or RenderedImages for that matter), which should indeed
be relativly easy. OTOH we have other images (I call them
server-side-images, like offscreen images in the X-Server), which must
be rendered first. Then you must take into account that the transform
can scale, shear and rotate your pixel data and things start to become
complicated...

BTW: Thanks for the BasicStroke code. I will try it out with my
Graphics2D impl and if I get something working, I'll check it in.

Cheers, Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to