[cairo] freetype-py + pycairo/cairocffi examples (Re: FT_Bitmap_Convert, and FreeType's bitmap format vs Cairo's)

Hin-Tak Leung htl10 at users.sourceforge.net
Wed Apr 26 21:12:50 UTC 2017


--------------------------------------------
On Tue, 25/4/17, Bill Spitzak <spitzak at gmail.com> wrote:

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

Thanks for the tips. I have switched from CAIRO_FILTER_NEAREST to CAIRO_FILTER_BEST before I push. The code for the 7 freetype-py + pycairo examples are up at:
https://github.com/rougier/freetype-py/pull/55

All of them should work also with cairocffi, except wordle-cairo.py - it requires region_t, which is only in pycairo 1.11+ (released just over 2 weeks ago), or the older patched py3cairo shipped in Ubuntu/Debian. Fedora's unpatched, and older.

The 7 figures output are:
https://github.com/rougier/freetype-py/issues/45#issuecomment-297070166
https://github.com/rougier/freetype-py/issues/45#issuecomment-297070438
https://github.com/rougier/freetype-py/issues/45#issuecomment-297070741
https://github.com/rougier/freetype-py/issues/45#issuecomment-297071152
https://github.com/rougier/freetype-py/issues/45#issuecomment-297071653
https://github.com/rougier/freetype-py/issues/45#issuecomment-297072023
https://github.com/rougier/freetype-py/issues/45#issuecomment-297532735


More information about the cairo mailing list