[cairo-commit] src/cairo-win32-font.c src/cairo-win32-printing-surface.c src/cairo-win32-private.h

Adrian Johnson ajohnson at kemper.freedesktop.org
Sun Apr 13 05:51:29 PDT 2008


 src/cairo-win32-font.c             |   10 ++++++++++
 src/cairo-win32-printing-surface.c |    1 +
 src/cairo-win32-private.h          |    3 +++
 3 files changed, 14 insertions(+)

New commits:
commit d96fdd58abf8d6c8692dbb08ec54cdd80accba79
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Apr 13 22:16:52 2008 +0930

    win32: Fix broken printing of type1 fonts
    
    ExtTextOut() does not work with Type 1 font glyph indices when
    printing. The same code works fine when dst->dc is a display. It
    appears that ExtTextOut expects unicode character values when using
    Type 1 fonts and a printer DC.
    
    Fix this by making Type 1 fonts in the win32-printing surface use the
    fallback path for non Windows fonts. ie the glyphs will be emitted as
    filled paths.

diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index 27b5819..eeba47a 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -490,6 +490,16 @@ _cairo_win32_scaled_font_select_unscaled_font (cairo_scaled_font_t *scaled_font,
     return CAIRO_STATUS_SUCCESS;
 }
 
+cairo_bool_t
+_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font)
+{
+    cairo_win32_scaled_font_t *win32_scaled_font;
+
+    win32_scaled_font = (cairo_win32_scaled_font_t *) scaled_font;
+
+    return win32_scaled_font->is_type1;
+}
+
 static void
 _cairo_win32_scaled_font_done_unscaled_font (cairo_scaled_font_t *scaled_font)
 {
diff --git a/src/cairo-win32-printing-surface.c b/src/cairo-win32-printing-surface.c
index cc3a17b..d6b2dd0 100644
--- a/src/cairo-win32-printing-surface.c
+++ b/src/cairo-win32-printing-surface.c
@@ -1341,6 +1341,7 @@ _cairo_win32_printing_surface_show_glyphs (void                 *abstract_surfac
     }
 
     if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_WIN32 &&
+	! _cairo_win32_scaled_font_is_type1 (scaled_font) &&
 	source->type == CAIRO_PATTERN_TYPE_SOLID)
     {
 	cairo_matrix_t ctm;
diff --git a/src/cairo-win32-private.h b/src/cairo-win32-private.h
index 704ec4e..0f39ea8 100644
--- a/src/cairo-win32-private.h
+++ b/src/cairo-win32-private.h
@@ -181,4 +181,7 @@ _cairo_win32_restore_initial_clip (cairo_win32_surface_t *surface);
 void
 _cairo_win32_debug_dump_hrgn (HRGN rgn, char *header);
 
+cairo_bool_t
+_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font);
+
 #endif /* CAIRO_WIN32_PRIVATE_H */


More information about the cairo-commit mailing list