1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/cairo/d2d.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,465 @@ 1.4 +commit 4a412c0b144ed1fdde668e0e91241bac8bedd579 1.5 +Author: Jeff Muizelaar <jmuizelaar@mozilla.com> 1.6 +Date: Sun Jan 24 14:04:33 2010 -0500 1.7 + 1.8 + d2d 1.9 + 1.10 +diff --git a/src/cairo-fixed-private.h b/src/cairo-fixed-private.h 1.11 +index c299def..a37ca6a 100644 1.12 +--- a/src/cairo-fixed-private.h 1.13 ++++ b/src/cairo-fixed-private.h 1.14 +@@ -50,6 +50,7 @@ 1.15 + 1.16 + #define CAIRO_FIXED_ONE ((cairo_fixed_t)(1 << CAIRO_FIXED_FRAC_BITS)) 1.17 + #define CAIRO_FIXED_ONE_DOUBLE ((double)(1 << CAIRO_FIXED_FRAC_BITS)) 1.18 ++#define CAIRO_FIXED_ONE_FLOAT ((float)(1 << CAIRO_FIXED_FRAC_BITS)) 1.19 + #define CAIRO_FIXED_EPSILON ((cairo_fixed_t)(1)) 1.20 + 1.21 + #define CAIRO_FIXED_FRAC_MASK (((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)) 1.22 +@@ -141,6 +142,12 @@ _cairo_fixed_to_double (cairo_fixed_t f) 1.23 + return ((double) f) / CAIRO_FIXED_ONE_DOUBLE; 1.24 + } 1.25 + 1.26 ++static inline float 1.27 ++_cairo_fixed_to_float (cairo_fixed_t f) 1.28 ++{ 1.29 ++ return ((float) f) / CAIRO_FIXED_ONE_FLOAT; 1.30 ++} 1.31 ++ 1.32 + static inline int 1.33 + _cairo_fixed_is_integer (cairo_fixed_t f) 1.34 + { 1.35 +diff --git a/src/cairo-win32-private.h b/src/cairo-win32-private.h 1.36 +index b9926bb..ba57595 100644 1.37 +--- a/src/cairo-win32-private.h 1.38 ++++ b/src/cairo-win32-private.h 1.39 +@@ -231,4 +231,19 @@ inline BOOL ModifyWorldTransform(HDC hdc, CONST XFORM * lpxf, DWORD mode) { retu 1.40 + 1.41 + #endif 1.42 + 1.43 ++#ifdef CAIRO_HAS_DWRITE_FONT 1.44 ++CAIRO_BEGIN_DECLS 1.45 ++ 1.46 ++cairo_public cairo_int_status_t 1.47 ++cairo_dwrite_show_glyphs_on_surface(void *surface, 1.48 ++ cairo_operator_t op, 1.49 ++ const cairo_pattern_t *source, 1.50 ++ cairo_glyph_t *glyphs, 1.51 ++ int num_glyphs, 1.52 ++ cairo_scaled_font_t *scaled_font, 1.53 ++ cairo_rectangle_int_t *extents); 1.54 ++ 1.55 ++ 1.56 ++CAIRO_END_DECLS 1.57 ++#endif /* CAIRO_HAS_DWRITE_FONT */ 1.58 + #endif /* CAIRO_WIN32_PRIVATE_H */ 1.59 +diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c 1.60 +index 0dc5e76..bee00b1 100644 1.61 +--- a/src/cairo-win32-surface.c 1.62 ++++ b/src/cairo-win32-surface.c 1.63 +@@ -1547,152 +1547,158 @@ _cairo_win32_surface_show_glyphs (void *surface, 1.64 + int *remaining_glyphs) 1.65 + { 1.66 + #if defined(CAIRO_HAS_WIN32_FONT) && !defined(WINCE) 1.67 +- cairo_win32_surface_t *dst = surface; 1.68 +- 1.69 +- WORD glyph_buf_stack[STACK_GLYPH_SIZE]; 1.70 +- WORD *glyph_buf = glyph_buf_stack; 1.71 +- int dxy_buf_stack[2 * STACK_GLYPH_SIZE]; 1.72 +- int *dxy_buf = dxy_buf_stack; 1.73 +- 1.74 +- BOOL win_result = 0; 1.75 +- int i, j; 1.76 ++ if (scaled_font->backend->type == CAIRO_FONT_TYPE_DWRITE) { 1.77 ++#ifdef CAIRO_HAS_DWRITE_FONT 1.78 ++ return cairo_dwrite_show_glyphs_on_surface(surface, op, source, glyphs, num_glyphs, scaled_font, clip); 1.79 ++#endif 1.80 ++ } else { 1.81 ++ cairo_win32_surface_t *dst = surface; 1.82 ++ 1.83 ++ WORD glyph_buf_stack[STACK_GLYPH_SIZE]; 1.84 ++ WORD *glyph_buf = glyph_buf_stack; 1.85 ++ int dxy_buf_stack[2 * STACK_GLYPH_SIZE]; 1.86 ++ int *dxy_buf = dxy_buf_stack; 1.87 + 1.88 +- cairo_solid_pattern_t *solid_pattern; 1.89 +- COLORREF color; 1.90 ++ BOOL win_result = 0; 1.91 ++ int i, j; 1.92 + 1.93 +- cairo_matrix_t device_to_logical; 1.94 ++ cairo_solid_pattern_t *solid_pattern; 1.95 ++ COLORREF color; 1.96 + 1.97 +- int start_x, start_y; 1.98 +- double user_x, user_y; 1.99 +- int logical_x, logical_y; 1.100 +- unsigned int glyph_index_option; 1.101 ++ cairo_matrix_t device_to_logical; 1.102 + 1.103 +- /* We can only handle win32 fonts */ 1.104 +- if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_WIN32) 1.105 +- return CAIRO_INT_STATUS_UNSUPPORTED; 1.106 ++ int start_x, start_y; 1.107 ++ double user_x, user_y; 1.108 ++ int logical_x, logical_y; 1.109 ++ unsigned int glyph_index_option; 1.110 + 1.111 +- /* We can only handle opaque solid color sources */ 1.112 +- if (!_cairo_pattern_is_opaque_solid(source)) 1.113 +- return CAIRO_INT_STATUS_UNSUPPORTED; 1.114 ++ /* We can only handle win32 fonts */ 1.115 ++ if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_WIN32) 1.116 ++ return CAIRO_INT_STATUS_UNSUPPORTED; 1.117 + 1.118 +- /* We can only handle operator SOURCE or OVER with the destination 1.119 +- * having no alpha */ 1.120 +- if ((op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER) || 1.121 +- (dst->format != CAIRO_FORMAT_RGB24)) 1.122 +- return CAIRO_INT_STATUS_UNSUPPORTED; 1.123 ++ /* We can only handle opaque solid color sources */ 1.124 ++ if (!_cairo_pattern_is_opaque_solid(source)) 1.125 ++ return CAIRO_INT_STATUS_UNSUPPORTED; 1.126 + 1.127 +- /* If we have a fallback mask clip set on the dst, we have 1.128 +- * to go through the fallback path, but only if we're not 1.129 +- * doing this for printing */ 1.130 +- if (clip != NULL) { 1.131 +- if ((dst->flags & CAIRO_WIN32_SURFACE_FOR_PRINTING) == 0) { 1.132 +- cairo_region_t *clip_region; 1.133 +- cairo_status_t status; 1.134 ++ /* We can only handle operator SOURCE or OVER with the destination 1.135 ++ * having no alpha */ 1.136 ++ if ((op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER) || 1.137 ++ (dst->format != CAIRO_FORMAT_RGB24)) 1.138 ++ return CAIRO_INT_STATUS_UNSUPPORTED; 1.139 + 1.140 +- status = _cairo_clip_get_region (clip, &clip_region); 1.141 +- assert (status != CAIRO_INT_STATUS_NOTHING_TO_DO); 1.142 +- if (status) 1.143 +- return status; 1.144 ++ /* If we have a fallback mask clip set on the dst, we have 1.145 ++ * to go through the fallback path, but only if we're not 1.146 ++ * doing this for printing */ 1.147 ++ if (clip != NULL) { 1.148 ++ if ((dst->flags & CAIRO_WIN32_SURFACE_FOR_PRINTING) == 0) { 1.149 ++ cairo_region_t *clip_region; 1.150 ++ cairo_status_t status; 1.151 ++ 1.152 ++ status = _cairo_clip_get_region (clip, &clip_region); 1.153 ++ assert (status != CAIRO_INT_STATUS_NOTHING_TO_DO); 1.154 ++ if (status) 1.155 ++ return status; 1.156 + 1.157 +- _cairo_win32_surface_set_clip_region (surface, clip_region); 1.158 ++ _cairo_win32_surface_set_clip_region (surface, clip_region); 1.159 ++ } 1.160 + } 1.161 +- } 1.162 + 1.163 +- solid_pattern = (cairo_solid_pattern_t *)source; 1.164 +- color = RGB(((int)solid_pattern->color.red_short) >> 8, 1.165 +- ((int)solid_pattern->color.green_short) >> 8, 1.166 +- ((int)solid_pattern->color.blue_short) >> 8); 1.167 ++ solid_pattern = (cairo_solid_pattern_t *)source; 1.168 ++ color = RGB(((int)solid_pattern->color.red_short) >> 8, 1.169 ++ ((int)solid_pattern->color.green_short) >> 8, 1.170 ++ ((int)solid_pattern->color.blue_short) >> 8); 1.171 + 1.172 +- cairo_win32_scaled_font_get_device_to_logical(scaled_font, &device_to_logical); 1.173 ++ cairo_win32_scaled_font_get_device_to_logical(scaled_font, &device_to_logical); 1.174 + 1.175 +- SaveDC(dst->dc); 1.176 ++ SaveDC(dst->dc); 1.177 + 1.178 +- cairo_win32_scaled_font_select_font(scaled_font, dst->dc); 1.179 +- SetTextColor(dst->dc, color); 1.180 +- SetTextAlign(dst->dc, TA_BASELINE | TA_LEFT); 1.181 +- SetBkMode(dst->dc, TRANSPARENT); 1.182 ++ cairo_win32_scaled_font_select_font(scaled_font, dst->dc); 1.183 ++ SetTextColor(dst->dc, color); 1.184 ++ SetTextAlign(dst->dc, TA_BASELINE | TA_LEFT); 1.185 ++ SetBkMode(dst->dc, TRANSPARENT); 1.186 + 1.187 +- if (num_glyphs > STACK_GLYPH_SIZE) { 1.188 +- glyph_buf = (WORD *) _cairo_malloc_ab (num_glyphs, sizeof(WORD)); 1.189 +- dxy_buf = (int *) _cairo_malloc_abc (num_glyphs, sizeof(int), 2); 1.190 +- } 1.191 ++ if (num_glyphs > STACK_GLYPH_SIZE) { 1.192 ++ glyph_buf = (WORD *) _cairo_malloc_ab (num_glyphs, sizeof(WORD)); 1.193 ++ dxy_buf = (int *) _cairo_malloc_abc (num_glyphs, sizeof(int), 2); 1.194 ++ } 1.195 + 1.196 +- /* It is vital that dx values for dxy_buf are calculated from the delta of 1.197 +- * _logical_ x coordinates (not user x coordinates) or else the sum of all 1.198 +- * previous dx values may start to diverge from the current glyph's x 1.199 +- * coordinate due to accumulated rounding error. As a result strings could 1.200 +- * be painted shorter or longer than expected. */ 1.201 ++ /* It is vital that dx values for dxy_buf are calculated from the delta of 1.202 ++ * _logical_ x coordinates (not user x coordinates) or else the sum of all 1.203 ++ * previous dx values may start to diverge from the current glyph's x 1.204 ++ * coordinate due to accumulated rounding error. As a result strings could 1.205 ++ * be painted shorter or longer than expected. */ 1.206 + 1.207 +- user_x = glyphs[0].x; 1.208 +- user_y = glyphs[0].y; 1.209 ++ user_x = glyphs[0].x; 1.210 ++ user_y = glyphs[0].y; 1.211 + 1.212 +- cairo_matrix_transform_point(&device_to_logical, 1.213 +- &user_x, &user_y); 1.214 ++ cairo_matrix_transform_point(&device_to_logical, 1.215 ++ &user_x, &user_y); 1.216 + 1.217 +- logical_x = _cairo_lround (user_x); 1.218 +- logical_y = _cairo_lround (user_y); 1.219 ++ logical_x = _cairo_lround (user_x); 1.220 ++ logical_y = _cairo_lround (user_y); 1.221 + 1.222 +- start_x = logical_x; 1.223 +- start_y = logical_y; 1.224 ++ start_x = logical_x; 1.225 ++ start_y = logical_y; 1.226 + 1.227 +- for (i = 0, j = 0; i < num_glyphs; ++i, j = 2 * i) { 1.228 +- glyph_buf[i] = (WORD) glyphs[i].index; 1.229 +- if (i == num_glyphs - 1) { 1.230 +- dxy_buf[j] = 0; 1.231 +- dxy_buf[j+1] = 0; 1.232 +- } else { 1.233 +- double next_user_x = glyphs[i+1].x; 1.234 +- double next_user_y = glyphs[i+1].y; 1.235 +- int next_logical_x, next_logical_y; 1.236 ++ for (i = 0, j = 0; i < num_glyphs; ++i, j = 2 * i) { 1.237 ++ glyph_buf[i] = (WORD) glyphs[i].index; 1.238 ++ if (i == num_glyphs - 1) { 1.239 ++ dxy_buf[j] = 0; 1.240 ++ dxy_buf[j+1] = 0; 1.241 ++ } else { 1.242 ++ double next_user_x = glyphs[i+1].x; 1.243 ++ double next_user_y = glyphs[i+1].y; 1.244 ++ int next_logical_x, next_logical_y; 1.245 + 1.246 +- cairo_matrix_transform_point(&device_to_logical, 1.247 +- &next_user_x, &next_user_y); 1.248 ++ cairo_matrix_transform_point(&device_to_logical, 1.249 ++ &next_user_x, &next_user_y); 1.250 + 1.251 +- next_logical_x = _cairo_lround (next_user_x); 1.252 +- next_logical_y = _cairo_lround (next_user_y); 1.253 ++ next_logical_x = _cairo_lround (next_user_x); 1.254 ++ next_logical_y = _cairo_lround (next_user_y); 1.255 + 1.256 +- dxy_buf[j] = _cairo_lround (next_logical_x - logical_x); 1.257 +- dxy_buf[j+1] = _cairo_lround (logical_y - next_logical_y); 1.258 +- /* note that GDI coordinate system is inverted */ 1.259 ++ dxy_buf[j] = _cairo_lround (next_logical_x - logical_x); 1.260 ++ dxy_buf[j+1] = _cairo_lround (logical_y - next_logical_y); 1.261 ++ /* note that GDI coordinate system is inverted */ 1.262 + 1.263 +- logical_x = next_logical_x; 1.264 +- logical_y = next_logical_y; 1.265 +- } 1.266 +- } 1.267 ++ logical_x = next_logical_x; 1.268 ++ logical_y = next_logical_y; 1.269 ++ } 1.270 ++ } 1.271 + 1.272 +- /* Using glyph indices for a Type 1 font does not work on a 1.273 +- * printer DC. The win32 printing surface will convert the the 1.274 +- * glyph indices of Type 1 fonts to the unicode values. 1.275 +- */ 1.276 +- if ((dst->flags & CAIRO_WIN32_SURFACE_FOR_PRINTING) && 1.277 +- _cairo_win32_scaled_font_is_type1 (scaled_font)) 1.278 +- { 1.279 +- glyph_index_option = 0; 1.280 +- } 1.281 +- else 1.282 +- { 1.283 +- glyph_index_option = ETO_GLYPH_INDEX; 1.284 +- } 1.285 ++ /* Using glyph indices for a Type 1 font does not work on a 1.286 ++ * printer DC. The win32 printing surface will convert the the 1.287 ++ * glyph indices of Type 1 fonts to the unicode values. 1.288 ++ */ 1.289 ++ if ((dst->flags & CAIRO_WIN32_SURFACE_FOR_PRINTING) && 1.290 ++ _cairo_win32_scaled_font_is_type1 (scaled_font)) 1.291 ++ { 1.292 ++ glyph_index_option = 0; 1.293 ++ } 1.294 ++ else 1.295 ++ { 1.296 ++ glyph_index_option = ETO_GLYPH_INDEX; 1.297 ++ } 1.298 + 1.299 +- win_result = ExtTextOutW(dst->dc, 1.300 +- start_x, 1.301 +- start_y, 1.302 +- glyph_index_option | ETO_PDY, 1.303 +- NULL, 1.304 +- glyph_buf, 1.305 +- num_glyphs, 1.306 +- dxy_buf); 1.307 +- if (!win_result) { 1.308 +- _cairo_win32_print_gdi_error("_cairo_win32_surface_show_glyphs(ExtTextOutW failed)"); 1.309 +- } 1.310 ++ win_result = ExtTextOutW(dst->dc, 1.311 ++ start_x, 1.312 ++ start_y, 1.313 ++ glyph_index_option | ETO_PDY, 1.314 ++ NULL, 1.315 ++ glyph_buf, 1.316 ++ num_glyphs, 1.317 ++ dxy_buf); 1.318 ++ if (!win_result) { 1.319 ++ _cairo_win32_print_gdi_error("_cairo_win32_surface_show_glyphs(ExtTextOutW failed)"); 1.320 ++ } 1.321 + 1.322 +- RestoreDC(dst->dc, -1); 1.323 ++ RestoreDC(dst->dc, -1); 1.324 + 1.325 +- if (glyph_buf != glyph_buf_stack) { 1.326 +- free(glyph_buf); 1.327 +- free(dxy_buf); 1.328 ++ if (glyph_buf != glyph_buf_stack) { 1.329 ++ free(glyph_buf); 1.330 ++ free(dxy_buf); 1.331 ++ } 1.332 ++ return (win_result) ? CAIRO_STATUS_SUCCESS : CAIRO_INT_STATUS_UNSUPPORTED; 1.333 + } 1.334 +- return (win_result) ? CAIRO_STATUS_SUCCESS : CAIRO_INT_STATUS_UNSUPPORTED; 1.335 + #else 1.336 + return CAIRO_INT_STATUS_UNSUPPORTED; 1.337 + #endif 1.338 +diff --git a/src/cairo-win32.h b/src/cairo-win32.h 1.339 +index 6b86d4e..fcf20b8 100644 1.340 +--- a/src/cairo-win32.h 1.341 ++++ b/src/cairo-win32.h 1.342 +@@ -109,6 +109,63 @@ cairo_win32_scaled_font_get_device_to_logical (cairo_scaled_font_t *scaled_font, 1.343 + 1.344 + #endif /* CAIRO_HAS_WIN32_FONT */ 1.345 + 1.346 ++#if CAIRO_HAS_DWRITE_FONT 1.347 ++ 1.348 ++/* 1.349 ++ * Win32 DirectWrite font support 1.350 ++ */ 1.351 ++cairo_public cairo_font_face_t * 1.352 ++cairo_dwrite_font_face_create_for_dwrite_fontface(void *dwrite_font, void *dwrite_font_face); 1.353 ++ 1.354 ++#endif /* CAIRO_HAS_DWRITE_FONT */ 1.355 ++ 1.356 ++#if CAIRO_HAS_D2D_SURFACE 1.357 ++ 1.358 ++/** 1.359 ++ * Create a D2D surface for an HWND 1.360 ++ * 1.361 ++ * \param wnd Handle for the window 1.362 ++ * \return New cairo surface 1.363 ++ */ 1.364 ++cairo_public cairo_surface_t * 1.365 ++cairo_d2d_surface_create_for_hwnd(HWND wnd); 1.366 ++ 1.367 ++/** 1.368 ++ * Create a D2D surface of a certain size. 1.369 ++ * 1.370 ++ * \param format Cairo format of the surface 1.371 ++ * \param width Width of the surface 1.372 ++ * \param height Height of the surface 1.373 ++ * \return New cairo surface 1.374 ++ */ 1.375 ++cairo_public cairo_surface_t * 1.376 ++cairo_d2d_surface_create(cairo_format_t format, 1.377 ++ int width, 1.378 ++ int height); 1.379 ++ 1.380 ++/** 1.381 ++ * Present the backbuffer for a surface create for an HWND. This needs 1.382 ++ * to be called when the owner of the original window surface wants to 1.383 ++ * actually present the executed drawing operations to the screen. 1.384 ++ * 1.385 ++ * \param surface D2D surface. 1.386 ++ */ 1.387 ++void cairo_d2d_present_backbuffer(cairo_surface_t *surface); 1.388 ++ 1.389 ++/** 1.390 ++ * Scroll the surface, this only moves the surface graphics, it does not 1.391 ++ * actually scroll child windows or anything like that. Nor does it invalidate 1.392 ++ * that area of the window. 1.393 ++ * 1.394 ++ * \param surface The d2d surface this operation should apply to. 1.395 ++ * \param x The x delta for the movement 1.396 ++ * \param y The y delta for the movement 1.397 ++ * \param clip The clip rectangle, the is the 'part' of the surface that needs 1.398 ++ * scrolling. 1.399 ++ */ 1.400 ++void cairo_d2d_scroll(cairo_surface_t *surface, int x, int y, cairo_rectangle_t *clip); 1.401 ++#endif 1.402 ++ 1.403 + CAIRO_END_DECLS 1.404 + 1.405 + #else /* CAIRO_HAS_WIN32_SURFACE */ 1.406 +diff --git a/src/cairo.h b/src/cairo.h 1.407 +index 3a8b8a6..21827aa 100644 1.408 +--- a/src/cairo.h 1.409 ++++ b/src/cairo.h 1.410 +@@ -1370,7 +1370,8 @@ typedef enum _cairo_font_type { 1.411 + CAIRO_FONT_TYPE_FT, 1.412 + CAIRO_FONT_TYPE_WIN32, 1.413 + CAIRO_FONT_TYPE_QUARTZ, 1.414 +- CAIRO_FONT_TYPE_USER 1.415 ++ CAIRO_FONT_TYPE_USER, 1.416 ++ CAIRO_FONT_TYPE_DWRITE 1.417 + } cairo_font_type_t; 1.418 + 1.419 + cairo_public cairo_font_type_t 1.420 +@@ -2009,7 +2010,7 @@ typedef enum _cairo_surface_type { 1.421 + CAIRO_SURFACE_TYPE_TEE, 1.422 + CAIRO_SURFACE_TYPE_XML, 1.423 + CAIRO_SURFACE_TYPE_SKIA, 1.424 +- CAIRO_SURFACE_TYPE_DDRAW 1.425 ++ CAIRO_SURFACE_TYPE_D2D 1.426 + } cairo_surface_type_t; 1.427 + 1.428 + cairo_public cairo_surface_type_t 1.429 +diff --git a/src/cairoint.h b/src/cairoint.h 1.430 +index b942b4b..58850ab 100644 1.431 +--- a/src/cairoint.h 1.432 ++++ b/src/cairoint.h 1.433 +@@ -587,6 +587,12 @@ extern const cairo_private struct _cairo_font_face_backend _cairo_win32_font_fac 1.434 + 1.435 + #endif 1.436 + 1.437 ++#if CAIRO_HAS_DWRITE_FONT 1.438 ++ 1.439 ++extern const cairo_private struct _cairo_font_face_backend _cairo_dwrite_font_face_backend; 1.440 ++ 1.441 ++#endif 1.442 ++ 1.443 + #if CAIRO_HAS_QUARTZ_FONT 1.444 + 1.445 + extern const cairo_private struct _cairo_font_face_backend _cairo_quartz_font_face_backend; 1.446 +@@ -932,7 +938,12 @@ typedef struct _cairo_traps { 1.447 + #define CAIRO_FT_FONT_FAMILY_DEFAULT "" 1.448 + #define CAIRO_USER_FONT_FAMILY_DEFAULT "@cairo:" 1.449 + 1.450 +-#if CAIRO_HAS_WIN32_FONT 1.451 ++#if CAIRO_HAS_DWRITE_FONT 1.452 ++ 1.453 ++#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT 1.454 ++#define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_dwrite_font_face_backend 1.455 ++ 1.456 ++#elif CAIRO_HAS_WIN32_FONT 1.457 + 1.458 + #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT 1.459 + #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_win32_font_face_backend 1.460 +@@ -2617,7 +2628,7 @@ cairo_private int 1.461 + _cairo_ucs4_to_utf8 (uint32_t unicode, 1.462 + char *utf8); 1.463 + 1.464 +-#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS 1.465 ++#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS || CAIRO_HAS_DW_FONT 1.466 + # define CAIRO_HAS_UTF8_TO_UTF16 1 1.467 + #endif 1.468 + #if CAIRO_HAS_UTF8_TO_UTF16