_cairo_scaled_glyph_set_path (scaled_glyph, &scaled_font->base, path);
_cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font,					  cairo_scaled_glyph_t      *scaled_glyph){    static const MAT2 matrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, -1 } };    cairo_status_t status;    GLYPHMETRICS metrics;    HDC hdc;    DWORD bytesGlyph;    unsigned char *buffer, *ptr;    cairo_path_fixed_t *path;    hdc = _get_global_font_dc ();    if (!hdc)        return CAIRO_STATUS_NO_MEMORY;    path = _cairo_path_fixed_create ();    if (!path)	return CAIRO_STATUS_NO_MEMORY;    status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);    if (status)        goto CLEANUP_PATH;        bytesGlyph = GetGlyphOutlineW (hdc, _cairo_scaled_glyph_index (scaled_glyph),				   GGO_NATIVE | GGO_GLYPH_INDEX,				   &metrics, 0, NULL, &matrix);        if (bytesGlyph == GDI_ERROR) {	status = _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_glyph_path");	goto CLEANUP_FONT;    }    ptr = buffer = malloc (bytesGlyph);        if (!buffer) {	status = CAIRO_STATUS_NO_MEMORY;	goto CLEANUP_FONT;    }    if (GetGlyphOutlineW (hdc, _cairo_scaled_glyph_index (scaled_glyph),			  GGO_NATIVE | GGO_GLYPH_INDEX,			  &metrics, bytesGlyph, buffer, &matrix) == GDI_ERROR) {	status = _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_glyph_path");	free (buffer);	goto CLEANUP_FONT;    }        while (ptr < buffer + bytesGlyph) {	TTPOLYGONHEADER *header = (TTPOLYGONHEADER *)ptr;	unsigned char *endPoly = ptr + header->cb;		ptr += sizeof (TTPOLYGONHEADER);		_cairo_path_fixed_move_to (path,				   _cairo_fixed_from_FIXED (header->pfxStart.x),				   _cairo_fixed_from_FIXED (header->pfxStart.y));	while (ptr < endPoly) {	    TTPOLYCURVE *curve = (TTPOLYCURVE *)ptr;	    POINTFX *points = curve->apfx;	    int i;	    switch (curve->wType) {	    case TT_PRIM_LINE:		for (i = 0; i < curve->cpfx; i++) {		    _cairo_path_fixed_line_to (path,					       _cairo_fixed_from_FIXED (points[i].x),					       _cairo_fixed_from_FIXED (points[i].y));		}		break;	    case TT_PRIM_QSPLINE:		for (i = 0; i < curve->cpfx - 1; i++) {		    cairo_fixed_t p1x, p1y, p2x, p2y, cx, cy, c1x, c1y, c2x, c2y;		    _cairo_path_fixed_get_current_point (path, &p1x, &p1y);		    cx = _cairo_fixed_from_FIXED (points[i].x);		    cy = _cairo_fixed_from_FIXED (points[i].y);		    		    if (i + 1 == curve->cpfx - 1) {			p2x = _cairo_fixed_from_FIXED (points[i + 1].x);			p2y = _cairo_fixed_from_FIXED (points[i + 1].y);		    } else {			/* records with more than one curve use interpolation for			   control points, per http://support.microsoft.com/kb/q87115/ */			p2x = (cx + _cairo_fixed_from_FIXED (points[i + 1].x)) / 2;			p2y = (cy + _cairo_fixed_from_FIXED (points[i + 1].y)) / 2;		    }		    		    c1x = 2 * cx / 3 + p1x / 3;		    c1y = 2 * cy / 3 + p1y / 3;		    c2x = 2 * cx / 3 + p2x / 3;		    c2y = 2 * cy / 3 + p2y / 3;		    		    _cairo_path_fixed_curve_to (path, c1x, c1y, c2x, c2y, p2x, p2y);		}		break;	    case TT_PRIM_CSPLINE:		for (i = 0; i < curve->cpfx - 2; i += 2) {		    _cairo_path_fixed_curve_to (path,						_cairo_fixed_from_FIXED (points[i].x),						_cairo_fixed_from_FIXED (points[i].y),						_cairo_fixed_from_FIXED (points[i + 1].x),						_cairo_fixed_from_FIXED (points[i + 1].y),						_cairo_fixed_from_FIXED (points[i + 2].x),						_cairo_fixed_from_FIXED (points[i + 2].y));		}		break;	    }	    ptr += sizeof(TTPOLYCURVE) + sizeof (POINTFX) * (curve->cpfx - 1);	}	_cairo_path_fixed_close_path (path);    }    free(buffer);CLEANUP_FONT:    cairo_win32_scaled_font_done_font (&scaled_font->base); CLEANUP_PATH:    if (status != CAIRO_STATUS_SUCCESS)	_cairo_path_fixed_destroy (path);    return status;}