wrong kerning while scaling the whole drawing

View: New views
4 Messages — Rating Filter:   Alert me  

wrong kerning while scaling the whole drawing

by Claudio Cilloni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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?

_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: wrong kerning while scaling the whole drawing

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please see:
https://bugzilla.gnome.org/show_bug.cgi?id=341481

I have a patch for this locally.  Will push it out in a release today.

behdad

On 10/26/2009 10:57 AM, Claudio Cilloni wrote:

> 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?
>
> _______________________________________________
> cairo mailing list
> cairo@...
> http://lists.cairographics.org/mailman/listinfo/cairo
>
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: wrong kerning while scaling the whole drawing

by Claudio Cilloni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 26 October 2009 20:45:59 Behdad Esfahbod wrote:
> Please see:
> https://bugzilla.gnome.org/show_bug.cgi?id=341481
>
> I have a patch for this locally.  Will push it out in a release today.
>
> behdad
>

Sorry, but I'm not able to find your patch. could you tell me where I can get
it?

thanks.
Claudio
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: wrong kerning while scaling the whole drawing

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/10/2009 08:36 AM, Claudio Cilloni wrote:

> On Monday 26 October 2009 20:45:59 Behdad Esfahbod wrote:
>> Please see:
>> https://bugzilla.gnome.org/show_bug.cgi?id=341481
>>
>> I have a patch for this locally.  Will push it out in a release today.
>>
>> behdad
>
> Sorry, but I'm not able to find your patch. could you tell me where I can get
> it?

Hi Claudio,

Sorry for not responding earlier.  Ok, it proved to be trickier than I
expected.  But the bug is fixed in pango master now, and will be in 1.26.1
that I'll release in an hour.  The patch is also attached here:

   http://bugzilla.gnome.org/show_bug.cgi?id=341481

behdad

> thanks.
> Claudio
--
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo