[cairo-commit] 2 commits - src/cairo-ft-font.c test/ft-text-vertical-layout.c test/ft-text-vertical-layout-pdf-argb32-ref.png test/ft-text-vertical-layout-ps-argb32-ref.png test/ft-text-vertical-layout-ref.png test/ft-text-vertical-layout-svg-ref.png

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Aug 15 02:48:25 PDT 2006


 src/cairo-ft-font.c                             |    3 +--
 test/ft-text-vertical-layout-pdf-argb32-ref.png |binary
 test/ft-text-vertical-layout-ps-argb32-ref.png  |binary
 test/ft-text-vertical-layout-ref.png            |binary
 test/ft-text-vertical-layout-svg-ref.png        |binary
 test/ft-text-vertical-layout.c                  |   12 ++++++------
 6 files changed, 7 insertions(+), 8 deletions(-)

New commits:
diff-tree 4b3fadefc835cf627c3887a72d8cbb117d7ad5f7 (from db779b5121ae548753b4559bd59b269e489c6567)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 15 05:48:12 2006 -0400

    [FreeType] Fix comment about font coordinate

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index be9db5b..e07a59f 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1822,8 +1822,7 @@ _cairo_ft_scaled_glyph_init (void			*abs
 	    y_factor = 1 / unscaled->y_scale;
 
 	/*
-	 * Note: the font's coordinate system is upside down from ours, so the
-	 * Y coordinates of the bearing and advance need to be negated.
+	 * Note: Y coordinates of the horizontal bearing need to be negated.
 	 *
 	 * Scale metrics back to glyph space from the scaled glyph space returned
 	 * by FreeType
diff-tree db779b5121ae548753b4559bd59b269e489c6567 (from f183b835b111d23e838889178aa8106ec84663b3)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 15 05:27:59 2006 -0400

    [test] ft-text-vertical-layout: Use the string "i-W" to better show vertical metrics

diff --git a/test/ft-text-vertical-layout-pdf-argb32-ref.png b/test/ft-text-vertical-layout-pdf-argb32-ref.png
index 19f26b6..3d3faab 100644
Binary files a/test/ft-text-vertical-layout-pdf-argb32-ref.png and b/test/ft-text-vertical-layout-pdf-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-ps-argb32-ref.png b/test/ft-text-vertical-layout-ps-argb32-ref.png
index 9213bac..f5ef28e 100644
Binary files a/test/ft-text-vertical-layout-ps-argb32-ref.png and b/test/ft-text-vertical-layout-ps-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-ref.png b/test/ft-text-vertical-layout-ref.png
index 7ec34ef..05e0274 100644
Binary files a/test/ft-text-vertical-layout-ref.png and b/test/ft-text-vertical-layout-ref.png differ
diff --git a/test/ft-text-vertical-layout-svg-ref.png b/test/ft-text-vertical-layout-svg-ref.png
index 9bdba32..fb966c7 100644
Binary files a/test/ft-text-vertical-layout-svg-ref.png and b/test/ft-text-vertical-layout-svg-ref.png differ
diff --git a/test/ft-text-vertical-layout.c b/test/ft-text-vertical-layout.c
index f8958ea..9f2e98f 100644
--- a/test/ft-text-vertical-layout.c
+++ b/test/ft-text-vertical-layout.c
@@ -30,7 +30,7 @@
 #include <cairo-ft.h>
 
 #define WIDTH  40
-#define HEIGHT 30
+#define HEIGHT 40
 #define TEXT_SIZE 12
 
 static cairo_test_draw_function_t draw;
@@ -99,7 +99,7 @@ draw (cairo_t *cr, int width, int height
 {
     cairo_text_extents_t extents;
     cairo_scaled_font_t * scaled_font;
-    static char black[] = "AB", blue[] = "AB";
+    static char text[] = "i-W";
 
     /* We draw in the default black, so paint white first. */
     cairo_save (cr);
@@ -112,16 +112,16 @@ draw (cairo_t *cr, int width, int height
 
     cairo_set_line_width (cr, 1.0);
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
-    cairo_text_extents (cr, black, &extents);
+    cairo_text_extents (cr, text, &extents);
     cairo_move_to (cr,
                    width - (extents.width + extents.x_bearing),
                    -extents.y_bearing);
-    cairo_show_text (cr, black);
+    cairo_show_text (cr, text);
 
     cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
-    cairo_text_extents (cr, blue, &extents);
+    cairo_text_extents (cr, text, &extents);
     cairo_move_to (cr, -extents.x_bearing, -extents.y_bearing);
-    cairo_text_path (cr, blue);
+    cairo_text_path (cr, text);
     cairo_stroke (cr);
 
     cairo_scaled_font_destroy (scaled_font);


More information about the cairo-commit mailing list