[cairo] wrong kerning while scaling the whole drawing

Claudio Cilloni cilloni at callegari1930.com
Mon Oct 26 07:57:13 PDT 2009


Hi all.

This is my first time signalling a bug. I apologize if I'm doing this in some 
wrong way.

I found an error in the kerning calculations while scaling the whole document.
I made a simple test-case python program:

---------------------------------------------------------------------------------
import pango, cairo, pangocairo

sf = 72 / 25.4

surface = cairo.PDFSurface('/tmp/test.pdf', 210*sf, 297*sf)
ctx = cairo.Context(surface)

ctx.scale(sf, sf)

pctx = pangocairo.CairoContext(ctx)
pctx.new_path()
pctx.move_to(20, 20)

layout = pctx.create_layout()
layout.set_text('Ve Te To')
pctx.show_layout(layout)

surface.finish()
---------------------------------------------------------------------------------

As you can see in the /tmp/test.pdf file, the lowercase letters are too near 
to the preceding uppercase letters. This behaviour can be accentuated 
increasing the value of the sf variable. With sf = 1, the letter kerning 
seems to be ok.

I'm running cairo-1.8.8, pango-1.24.5, python-2.6.2, pycairo-1.8.8.

Thanks for you help!
Ciao.

P.S.: there is a way to disable kerning?



More information about the cairo mailing list