Bug 432071: Type 1 fonts don't print correctly, patch by Adrian Johnson <ajohnson@redneon.com>, r=stuart, a=schrep

This commit is contained in:
gavin%gavinsharp.com 2008-05-08 16:48:15 +00:00
Родитель b629e33d38
Коммит ad9a842c87
4 изменённых файлов: 39 добавлений и 2 удалений

Просмотреть файл

@ -25,6 +25,15 @@ cairo git commit ea6dbfd36f2182fda16cb82bca92007e0f7b8d77 -
cairo git commit d96fdd58abf8d6c8692dbb08ec54cdd80accba79 -
win32: Fix broken printing of type1 fonts
cairo git commit 547e2f552cff264b943803d3a1ff03d05bde35c0
Fix win32-printing show_glyphs analysis for Type 1 fonts
cairo git commit 158d24412bba99a4f57907d7fd22a86aae6e87af
Make win32-printing surface work with bitmap fonts
cairo git commit d35d6eec24c1b7ab0a49149a51bf65ea8e223203
Fix win32 bitmap font metrics when device scale != 1
max-font-size.patch: Clamp freetype font size to 1000 to avoid overflow issues
win32-logical-font-scale.patch: set CAIRO_WIN32_LOGICAL_FONT_SCALE to 1

Просмотреть файл

@ -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)
{
@ -923,9 +933,9 @@ _cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_f
cairo_win32_scaled_font_done_font (&scaled_font->base);
extents.x_bearing = 0;
extents.y_bearing = -font_extents.ascent / scaled_font->y_scale;
extents.y_bearing = scaled_font->base.ctm.yy * (-font_extents.ascent / scaled_font->y_scale);
extents.width = width / scaled_font->x_scale;
extents.height = (font_extents.ascent + font_extents.descent) / scaled_font->y_scale;
extents.height = scaled_font->base.ctm.yy * (font_extents.ascent + font_extents.descent) / scaled_font->y_scale;
extents.x_advance = extents.width;
extents.y_advance = 0;
} else if (scaled_font->preserve_axes && scaled_font->base.options.hint_style != CAIRO_HINT_METRICS_OFF) {

Просмотреть файл

@ -1311,7 +1311,22 @@ _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)) {
for (i = 0; i < num_glyphs; i++) {
status = _cairo_scaled_glyph_lookup (scaled_font,

Просмотреть файл

@ -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 */