[cairo] How can I activate subpixel positioning for text with `pangocairo` and `(py)cairo`?

Sebastian M. Ernst ernst at pleiszenburg.de
Thu May 7 13:59:15 UTC 2020


Hi Uli,

thanks for all the effort and the reply :) Let's continue the
conversation here if that's ok for you (?).

> Random guess: This is related to src/cairo-ft-font.c, so I took a quick
> look at the output of "git log src/cairo-ft-font.c". The third entry
> sounds like what you are looking for:

Is this the "toy" font renderer of cairo or is this also used when
interacting with pangocairo?

> Hm, doesn't seem to be in any release.

Seems like I have to build cairo from source then and test it like this.

> P.S.: Why do you need this feature anyway? My fonts look fine to me
> without it, I think...

For still images I'd say yes, you're right. But I am using cairo for
rendering frames of an animation. If the text moves around, you can
literally see it jumping line by line. It looks really awful. I can of
cause render at a higher resolution and then reduce the resolution in a
later step, but I was wondering whether there is an easier way.

>> How do I activate subpixel positioning with Cairo (pycairo) / pangocairo?
> You don't. As I understand it, it is automatically activated. The question then is: How do I deactivate it? And the answer to that also seems to be "you don't".

One of the blog posts explicitly says "To address this problem, subpixel
positioning is now optional, and off by default". I have also tested
this in much length against the latest releases of all involved
libraries: There is no subpixel positioning for text in my described
workflow ...

Thanks, best regards,
Sebastian


More information about the cairo mailing list