[reportlab-users] blurry (dithered) lines + font height, descent etc.

Michael Steuer reportlab-users@reportlab.com
Fri, 1 Nov 2002 02:18:10 +1000


:: Last I heard, Raph Levien indicated libart was 'finished'
:: and he had no further interest in pursuing it.

Always great to hear something like that.;(

:: Mike, this is a silly question, but are you sure you
:: are "aligned with the pixel grid"?
::
:: If you are using a scaling of 1 unit = 1 pixel (the default)
:: and drawing in whole numbers then you MAY need to shift
:: things by 0.5 pixels. This could be done with a single
:: 'group' object and a translation.
::
:: Imagine a 200x200 bitmap.  A 1 pixel line from (0,50) to
:: (200,50) will actually span space from y=49.5 to y=51.5
:: resulting in 2 grey pixels rather than one black one,
:: because it has a thickness and its centre line is
:: between pixels.  But the same line from (0,49.5) to
:: (200,49.5) should a perfect 1-pixel black line. This
:: Works For Me(tm)

I tried it and it actually removed the antialiasing of the rectangles I was
drawing.*lol*

Did I miss something in the docu about that?!? If that is the case I'm sorry.

The text I was drawing as well stayed the same (as to be expected I guess) and
the problem is that I need non-antialised text as well, because it is much
easier to read. I know it is "ugly", but antialiased text is usually to "fuzzy"
to read without straining the eyes.

:: If your artwork really does blur across pixel boundaries
:: or involves curves then I would argue that antialiasing
:: is the 'right thing' to do and piddle rendering just
:: looks uglier.
::
:: We have never had a problem drawing a sharp horizontal or
:: vertical line before. Hope this helps...

Thanks that helped.

If I now could do all of the following with reportlab, I would use it:

- also draw non antialiased text
- be able to get the text height and ascent/descent in an easy fashion

and maybe (as a bonus):
- flip the coordinate system from (0,0) at bottom/left to top/left.
(I know, its not the "natural" coordinate system, but I am very used to it from
several Java and C++ project)

Please don't be offended. I really think that reportlab is a great project and I
wish there would be more open source projects of that quality out there.

Cheers,

Mike.