[cairo] Misplaced glyphs in PDF backend

Owen Taylor otaylor at redhat.com
Fri Aug 19 15:26:01 PDT 2005


[ Meant to Cc: the list, but forgot. Resent ]

On Mon, 2005-06-13 at 21:56 +0100, Gustavo J. A. M. Carneiro wrote:
>   OK, I think I have a real bug here.  Not sure whether it is cairo or
> pango bug.  My initial bet is on cairo.

I'd suggest you file this bug in bugs.freedesktop.org, so we don't
forget about it. It would, of course, be nicer to have a test case
that doesn't use Pango, but failing that, a pangocairo test case
would give us something to work with.

Pango doesn't know about any difference between PDF and PNG, so
if the output is different, it probably is a PDF backend bug.

Regards,
						Owen

>   The test program in attachment uses pangocairo to render a certain
> unicode glyph, called "LEFT SQUARE BRACKET EXTENSION", and the draws a
> bounding box around it, using BB information returned by the pango
> layout.  I use the same subroutine to output for both PNG and PDF
> backends; however, the resulting output files differ significantly.  As
> you can see comparing the PDF output [1,2] with the corresponding PNG
> [3], you can see the vertical bar in the PDF file is further to the left
> than in the PNG file.  The bounding boxes are correct in both cases
> (this is logical rect, not ink rect), just the position in the PDF is
> wrong.
> 
>   That said, it looks like a minor problem.  But this is just a small
> test case I wrote.  I'm working on a MathML renderer using pango +
> cairo, and there the full effect of this bug is much worse.  The problem
> is that I am implementing "vertical stretching" of operators like
> parenthesis by vertically stacking certain special glyphs found in the
> unicode map.  However, some bug in the PDF backend is causing most of
> these "pieces" to be out of place, as can be seen comparing [4] and [5].
> This has to be a bug, since I'm using exactly the same code for both PNG
> and PDF output.
> 
>   Regards.
> 
> 
> PS: example fonts containing these glyphs are FreeMono (freefonts) and
> Code2000 (http://home.att.net/~jameskass/code2000_page.htm).
> 
> [1] http://telecom.inescporto.pt/~gjc/CairoMath/BracketExtension.pdf
> [2] http://telecom.inescporto.pt/~gjc/CairoMath/Screenshot-BracketExtension.pdf.png
> [3] http://telecom.inescporto.pt/~gjc/CairoMath/BracketExtension.png
> [4] http://telecom.inescporto.pt/~gjc/CairoMath/Screenshot-test.py-1.png
> [5] http://telecom.inescporto.pt/~gjc/CairoMath/output.pdf
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.freedesktop.org/mailman/listinfo/cairo
-- 
Owen Taylor <otaylor at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050819/ee7578ba/attachment.pgp


More information about the cairo mailing list