[cairo] [PDF] Strange bug with text rendering

Adrian Johnson ajohnson at redneon.com
Wed Apr 11 14:11:27 PDT 2007


Eugeniy Meshcheryakov wrote:
> Hello,
> 
> I try to render glyphs in a font on a page from top to bottom and then
> from left to right. This does not work however. Resulting pdf contains
> glyphs with both wery large vertical and horizontal distance.

The following fix has been committed. Thanks for the bug report.


-------------- next part --------------
>From d0745c08b782d79fc7ccfd59cab0ae841a56c428 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson at redneon.com>
Date: Thu, 12 Apr 2007 06:32:29 +0930
Subject: [PATCH] PDF: Fix glyph positioning bug when glyphs are not horizontal

Bug reported in
http://lists.freedesktop.org/archives/cairo/2007-April/010337.html
---
 src/cairo-pdf-surface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 38b447e..2cfad5c 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -3040,7 +3040,7 @@ _cairo_pdf_surface_show_glyphs (void			*
                         _cairo_output_stream_printf (surface->output,
                                                      "%f %f Td ",
                                                      (glyphs[i].x - Tlm_x)/scaled_font->scale.xx,
-                                                     (glyphs[i].y - Tlm_x)/-scaled_font->scale.yy);
+                                                     (glyphs[i].y - Tlm_y)/-scaled_font->scale.yy);
                         Tlm_x = glyphs[i].x;
                         Tlm_y = glyphs[i].y;
                         Tm_x = Tlm_x;
-- 
1.4.3.4



More information about the cairo mailing list