summaryrefslogtreecommitdiff
path: root/src/cairo-win32-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-win32-surface.c')
-rw-r--r--src/cairo-win32-surface.c64
1 files changed, 43 insertions, 21 deletions
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 660aaba..4a36226 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -124,11 +124,13 @@ _cairo_win32_print_gdi_error (const char *context)
0, NULL)) {
fprintf (stderr, "%s: Unknown GDI error", context);
} else {
- fwprintf (stderr, L"%s: %S", context, (wchar_t *)lpMsgBuf);
+ fprintf (stderr, "%s: %S", context, (wchar_t *)lpMsgBuf);
LocalFree (lpMsgBuf);
}
+ fflush (stderr);
+
/* We should switch off of last_status, but we'd either return
* CAIRO_STATUS_NO_MEMORY or CAIRO_STATUS_UNKNOWN_ERROR and there
* is no CAIRO_STATUS_UNKNOWN_ERROR.
@@ -1494,14 +1496,15 @@ _cairo_win32_surface_flush (void *abstract_surface)
#define STACK_GLYPH_SIZE 256
cairo_int_status_t
-_cairo_win32_surface_show_glyphs (void *surface,
- cairo_operator_t op,
- const cairo_pattern_t *source,
- cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_scaled_font_t *scaled_font,
- cairo_clip_t *clip,
- int *remaining_glyphs)
+_cairo_win32_surface_show_glyphs_internal (void *surface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_scaled_font_t *scaled_font,
+ cairo_clip_t *clip,
+ int *remaining_glyphs,
+ cairo_bool_t glyph_indexing)
{
#if CAIRO_HAS_WIN32_FONT
cairo_win32_surface_t *dst = surface;
@@ -1616,19 +1619,10 @@ _cairo_win32_surface_show_glyphs (void *surface,
}
}
- /* Using glyph indices for a Type 1 font does not work on a
- * printer DC. The win32 printing surface will convert the the
- * glyph indices of Type 1 fonts to the unicode values.
- */
- if ((dst->flags & CAIRO_WIN32_SURFACE_FOR_PRINTING) &&
- _cairo_win32_scaled_font_is_type1 (scaled_font))
- {
- glyph_index_option = 0;
- }
- else
- {
+ if (glyph_indexing)
glyph_index_option = ETO_GLYPH_INDEX;
- }
+ else
+ glyph_index_option = 0;
win_result = ExtTextOutW(dst->dc,
start_x,
@@ -1656,6 +1650,28 @@ _cairo_win32_surface_show_glyphs (void *surface,
#undef STACK_GLYPH_SIZE
+cairo_int_status_t
+_cairo_win32_surface_show_glyphs (void *surface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_scaled_font_t *scaled_font,
+ cairo_clip_t *clip,
+ int *remaining_glyphs)
+{
+ return _cairo_win32_surface_show_glyphs_internal (surface,
+ op,
+ source,
+ glyphs,
+ num_glyphs,
+ scaled_font,
+ clip,
+ remaining_glyphs,
+ TRUE);
+}
+
+
/**
* cairo_win32_surface_create:
* @hdc: the DC to create a surface for
@@ -1835,6 +1851,12 @@ _cairo_surface_is_win32 (cairo_surface_t *surface)
* Returns the HDC associated with this surface, or %NULL if none.
* Also returns %NULL if the surface is not a win32 surface.
*
+ * A call to cairo_surface_flush() is required before using the HDC to
+ * ensure that all pending drawing operations are finished and to
+ * restore any temporary modification cairo has made to its state. A
+ * call to cairo_surface_mark_dirty() is required after the state or
+ * the content of the HDC has been modified.
+ *
* Return value: HDC or %NULL if no HDC available.
*
* Since: 1.2