Re: FT_Bitmap_Convert, and FreeType's bitmap format vs Cairo's

Bill Spitzak <[email protected]>
Newsgroups gmane.comp.lib.cairo,gmane.comp.fonts.freetype.devel
Message-ID <CAL-8oAgFi-MxXiNsc11Enhexj7sj=XiwcEF_6r90gPVLrQms1Q@mail.gmail.com>
> Also I am wondering about a little drawing issue I have - I want to scale a freetype bitmap up and draw a larger version of it (useful for illustrations for rasterization issues...) but it seems that cairo always anti-alias the edges at the original resolution, and I haven't figured out how to turn it off yet.
> Let's say, I have rendered a glyph to a 24x24 grid in FreeType, and want to draw that in cairo to 480 x 480 . I'd like cairo to render at the destination resolution - i.e. do whatever at the 1-pixel boundary in 480x480, but it seems that it is doing it in the original grid, which blows up to be extra blurry at ~20 pixels wide in 480x480. Here is how it looks (the corner S is original resolution drawn as is):
>
> http://htl10.users.sourceforge.net/tmp/S.png
>
> This is from a word-in-progress rewrite of freetype-py's glyph-alpha/glyph-monochrome examples which uses numpy and matplotlib, to using pycairo for drawing.

Possibly you want to do cairo_patter_set_filter(source,
CAIRO_FILTER_BEST) or CAIRO_FILTER_NEAREST (the difference is that
BEST will actually antialias the boundaries between the pixels which
looks nicer if the image is rotated or scaled by a non-integer).
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.