mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 12:50:35 +01:00
Make win32-printing surface work with bitmap fonts
The win32 printing surface has the same problem with bitmap fonts as it does with Type 1 fonts. ie ExtTextOutW() with glyph indices works for a display DC but not a printer DC. Fix this by forcing fallback for bitmap fonts.
This commit is contained in:
parent
547e2f552c
commit
158d24412b
3 changed files with 27 additions and 0 deletions
|
|
@ -500,6 +500,16 @@ _cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font)
|
|||
return win32_scaled_font->is_type1;
|
||||
}
|
||||
|
||||
cairo_bool_t
|
||||
_cairo_win32_scaled_font_is_bitmap (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_bitmap;
|
||||
}
|
||||
|
||||
static void
|
||||
_cairo_win32_scaled_font_done_unscaled_font (cairo_scaled_font_t *scaled_font)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1311,6 +1311,20 @@ _cairo_win32_printing_surface_show_glyphs (void *abstract_surfac
|
|||
}
|
||||
|
||||
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
|
||||
/* Calling ExtTextOutW() with ETO_GLYPH_INDEX and a Type 1 or
|
||||
* bitmap font on a printer DC prints garbled text. The text
|
||||
* displays correctly on a display DC. It appears that when
|
||||
* using a printer DC. ExtTextOutW() only works with
|
||||
* characters and not glyph indices.
|
||||
*
|
||||
* For now we don't use ExtTextOutW for Type 1 or bitmap
|
||||
* fonts. These fonts will go through the fallback path for
|
||||
* non Windows fonts. ie filled outlines for Type 1 fonts and
|
||||
* fallback images for bitmap fonts.
|
||||
*/
|
||||
if (_cairo_win32_scaled_font_is_bitmap (scaled_font))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
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)) {
|
||||
|
|
|
|||
|
|
@ -184,4 +184,7 @@ _cairo_win32_debug_dump_hrgn (HRGN rgn, char *header);
|
|||
cairo_bool_t
|
||||
_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font);
|
||||
|
||||
cairo_bool_t
|
||||
_cairo_win32_scaled_font_is_bitmap (cairo_scaled_font_t *scaled_font);
|
||||
|
||||
#endif /* CAIRO_WIN32_PRIVATE_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue