[cairo-commit] 3 commits - meson.build src/win32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 27 08:11:55 UTC 2023


 meson.build                        |    6 -
 src/win32/cairo-dwrite-font.cpp    |  131 ++++++++++++++++++++++++++----
 src/win32/cairo-dwrite-private.hpp |   51 +++++++++--
 src/win32/dw-extra.h               |  159 ++-----------------------------------
 4 files changed, 167 insertions(+), 180 deletions(-)

New commits:
commit 17114f522b1679f8fb7e087cda6c90f55a9f43a3
Merge: 6a5f2140d c33383b10
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Feb 27 08:11:53 2023 +0000

    Merge branch 'dwrite-a8-glyph-mask' into 'master'
    
    DWrite: Support antialias and subpixel order font options
    
    See merge request cairo/cairo!460

commit c33383b10dcd168c30088cbf4285436bfac6df37
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date:   Tue Feb 14 16:13:00 2023 +0900

    DWrite: Support antialias and subpixel order font options
    
    Create a new IDWriteRenderingParams object from the given font
    options.

diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp
index d1c4e63f1..d12f7b70b 100644
--- a/src/win32/cairo-dwrite-font.cpp
+++ b/src/win32/cairo-dwrite-font.cpp
@@ -212,6 +212,9 @@ private:
 
 
 RefPtr<IDWriteFactory> DWriteFactory::mFactoryInstance;
+RefPtr<IDWriteFactory1> DWriteFactory::mFactoryInstance1;
+RefPtr<IDWriteFactory2> DWriteFactory::mFactoryInstance2;
+RefPtr<IDWriteFactory3> DWriteFactory::mFactoryInstance3;
 RefPtr<IDWriteFactory4> DWriteFactory::mFactoryInstance4;
 
 RefPtr<IWICImagingFactory> WICImagingFactory::mFactoryInstance;
@@ -221,6 +224,107 @@ RefPtr<IDWriteRenderingParams> DWriteFactory::mDefaultRenderingParams;
 RefPtr<ID2D1Factory> D2DFactory::mFactoryInstance;
 RefPtr<ID2D1DCRenderTarget> D2DFactory::mRenderTarget;
 
+static int
+_quality_from_antialias_mode(cairo_antialias_t antialias)
+{
+    switch (antialias) {
+    case CAIRO_ANTIALIAS_NONE:
+	return NONANTIALIASED_QUALITY;
+    case CAIRO_ANTIALIAS_FAST:
+    case CAIRO_ANTIALIAS_GRAY:
+	return ANTIALIASED_QUALITY;
+    default:
+	break;
+    }
+    return CLEARTYPE_QUALITY;    
+}
+
+static RefPtr<IDWriteRenderingParams>
+_create_rendering_params(IDWriteRenderingParams     *params,
+			 const cairo_font_options_t *options,
+			 cairo_antialias_t           antialias)
+{
+    if (!params)
+	params = DWriteFactory::DefaultRenderingParams();
+    FLOAT gamma = params->GetGamma();
+    FLOAT enhanced_contrast = params->GetEnhancedContrast();
+    FLOAT clear_type_level = params->GetClearTypeLevel();
+    DWRITE_PIXEL_GEOMETRY pixel_geometry = params->GetPixelGeometry();
+    DWRITE_RENDERING_MODE rendering_mode = params->GetRenderingMode();
+
+    cairo_bool_t modified = FALSE;
+    switch (antialias) {
+    case CAIRO_ANTIALIAS_NONE:
+	if (rendering_mode != DWRITE_RENDERING_MODE_ALIASED) {
+	    rendering_mode = DWRITE_RENDERING_MODE_ALIASED;
+	    modified = TRUE;
+	}
+	break;
+    case CAIRO_ANTIALIAS_FAST:
+    case CAIRO_ANTIALIAS_GRAY:
+	if (clear_type_level) {
+	    clear_type_level = 0;
+	    modified = TRUE;
+	}
+	break;
+    default:
+	break;
+    }
+    auto subpixel_order = cairo_font_options_get_subpixel_order (options);
+    switch (subpixel_order) {
+    case CAIRO_SUBPIXEL_ORDER_RGB:
+	if (pixel_geometry != DWRITE_PIXEL_GEOMETRY_RGB) {
+	    pixel_geometry = DWRITE_PIXEL_GEOMETRY_RGB;
+	    modified = TRUE;
+	}
+	break;
+    case CAIRO_SUBPIXEL_ORDER_BGR:
+	if (pixel_geometry != DWRITE_PIXEL_GEOMETRY_BGR) {
+	    pixel_geometry = DWRITE_PIXEL_GEOMETRY_BGR;
+	    modified = TRUE;
+	}
+	break;
+    default:
+	break;
+    }	
+    if (!modified)
+	return params;
+
+    HRESULT hr;
+    RefPtr<IDWriteRenderingParams1> params1;
+    hr = params->QueryInterface(&params1);
+    if (FAILED(hr)) {
+	RefPtr<IDWriteRenderingParams> ret;
+	DWriteFactory::Instance()->CreateCustomRenderingParams(gamma, enhanced_contrast, clear_type_level, pixel_geometry, rendering_mode, &ret);
+	return ret;
+    }
+
+    FLOAT grayscaleEnhancedContrast = params1->GetGrayscaleEnhancedContrast();
+    RefPtr<IDWriteRenderingParams2> params2;
+    hr = params->QueryInterface(&params2);
+    if (FAILED(hr)) {
+	RefPtr<IDWriteRenderingParams1> ret;
+	DWriteFactory::Instance1()->CreateCustomRenderingParams(gamma, enhanced_contrast, grayscaleEnhancedContrast, clear_type_level, pixel_geometry, rendering_mode, &ret);
+	return ret;
+    }    
+
+    DWRITE_GRID_FIT_MODE gridFitMode = params2->GetGridFitMode();
+    RefPtr<IDWriteRenderingParams3> params3;
+    hr = params->QueryInterface(&params3);
+    if (FAILED(hr)) {
+	RefPtr<IDWriteRenderingParams2> ret;
+	DWriteFactory::Instance2()->CreateCustomRenderingParams(gamma, enhanced_contrast, grayscaleEnhancedContrast, clear_type_level, pixel_geometry, rendering_mode, gridFitMode, &ret);
+	return ret;
+    }    
+    
+    DWRITE_RENDERING_MODE1 rendering_mode1 = params3->GetRenderingMode1();
+    if (antialias == CAIRO_ANTIALIAS_NONE)
+	rendering_mode1 = DWRITE_RENDERING_MODE1_ALIASED;
+    RefPtr<IDWriteRenderingParams3> ret;
+    DWriteFactory::Instance3()->CreateCustomRenderingParams(gamma, enhanced_contrast, grayscaleEnhancedContrast, clear_type_level, pixel_geometry, rendering_mode1, gridFitMode, &ret);
+    return ret;
+}
+
 /* Functions #cairo_font_face_backend_t */
 static cairo_status_t
 _cairo_dwrite_font_face_create_for_toy (cairo_toy_font_face_t   *toy_face,
@@ -557,13 +661,6 @@ _cairo_dwrite_font_face_scaled_font_create (void			*abstract_face,
     dwrite_font->mat_inverse = dwrite_font->mat;
     cairo_matrix_invert (&dwrite_font->mat_inverse);
 
-    dwrite_font->rendering_params = NULL;
-    if (font_face->rendering_params) {
-	dwrite_font->rendering_params = font_face->rendering_params;
-	dwrite_font->rendering_params->AddRef();
-    }
-    dwrite_font->measuring_mode = font_face->measuring_mode;
-
     cairo_font_extents_t extents;
 
     DWRITE_FONT_METRICS metrics;
@@ -612,6 +709,9 @@ _cairo_dwrite_font_face_scaled_font_create (void			*abstract_face,
 	dwrite_font->antialias_mode = options->antialias;
     }
 
+    dwrite_font->rendering_params = _create_rendering_params(font_face->rendering_params, options, dwrite_font->antialias_mode).forget().drop();
+    dwrite_font->measuring_mode = font_face->measuring_mode;
+
     return _cairo_scaled_font_set_metrics (*font, &extents);
 }
 
@@ -1199,7 +1299,7 @@ _cairo_dwrite_scaled_font_init_glyph_surface(cairo_dwrite_scaled_font_t *scaled_
 
     GdiFlush();
 
-    image = _cairo_compute_glyph_mask (&surface->base, CLEARTYPE_QUALITY);
+    image = _cairo_compute_glyph_mask (&surface->base, _quality_from_antialias_mode(scaled_font->antialias_mode));
     status = (cairo_int_status_t)image->status;
     if (status)
 	goto FAIL;
@@ -1453,6 +1553,9 @@ cairo_dwrite_font_face_get_rendering_params (cairo_font_face_t *font_face)
  * @params: The #IDWriteRenderingParams object
  *
  * Sets the #IDWriteRenderingParams object to @font_face.
+ * This #IDWriteRenderingParams is used to render glyphs if default values of font options are used.
+ * If non-defalut values of font options are specified when creating a #cairo_scaled_font_t,
+ * cairo creates a new #IDWriteRenderingParams object for the #cairo_scaled_font_t object by overwriting the corresponding parameters.
  *
  * Since: 1.18
  **/
@@ -1526,12 +1629,6 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
 	}
     }
 
-    IDWriteRenderingParams *params;
-    if (scaled_font->rendering_params)
-	params = scaled_font->rendering_params;
-    else
-	params = DWriteFactory::DefaultRenderingParams();
-
     /*
      * We set the number of pixels per DIP to 1.0. This is because we always want
      * to draw in device pixels, and not device independent pixels. On high DPI
@@ -1556,7 +1653,7 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
 	   surface->dc,
 	   area.left, area.top,
 	   SRCCOPY | NOMIRRORBITMAP);
-    rt->DrawGlyphRun(x, y, scaled_font->measuring_mode, run, params, color);
+    rt->DrawGlyphRun(x, y, scaled_font->measuring_mode, run, scaled_font->rendering_params, color);
     BitBlt(surface->dc,
 	   area.left, area.top,
 	   area.right - area.left, area.bottom - area.top,
diff --git a/src/win32/cairo-dwrite-private.hpp b/src/win32/cairo-dwrite-private.hpp
index 5e91acf42..c7a24822a 100644
--- a/src/win32/cairo-dwrite-private.hpp
+++ b/src/win32/cairo-dwrite-private.hpp
@@ -99,6 +99,36 @@ public:
 	return mFactoryInstance;
     }
 
+    static RefPtr<IDWriteFactory1> Instance1()
+    {
+	if (!mFactoryInstance1) {
+	    if (Instance()) {
+		Instance()->QueryInterface(&mFactoryInstance1);
+	    }
+	}
+	return mFactoryInstance1;
+    }
+
+    static RefPtr<IDWriteFactory2> Instance2()
+    {
+	if (!mFactoryInstance2) {
+	    if (Instance()) {
+		Instance()->QueryInterface(&mFactoryInstance2);
+	    }
+	}
+	return mFactoryInstance2;
+    }
+
+    static RefPtr<IDWriteFactory3> Instance3()
+    {
+	if (!mFactoryInstance3) {
+	    if (Instance()) {
+		Instance()->QueryInterface(&mFactoryInstance3);
+	    }
+	}
+	return mFactoryInstance3;
+    }
+
     static RefPtr<IDWriteFactory4> Instance4()
     {
 	if (!mFactoryInstance4) {
@@ -149,6 +179,9 @@ public:
 
 private:
     static RefPtr<IDWriteFactory> mFactoryInstance;
+    static RefPtr<IDWriteFactory1> mFactoryInstance1;
+    static RefPtr<IDWriteFactory2> mFactoryInstance2;
+    static RefPtr<IDWriteFactory3> mFactoryInstance3;
     static RefPtr<IDWriteFactory4> mFactoryInstance4;
     static RefPtr<IDWriteFontCollection> mSystemCollection;
     static RefPtr<IDWriteRenderingParams> mDefaultRenderingParams;
commit 950e3fb45d976e80af99cccd438568da975934d8
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date:   Fri Feb 24 10:58:40 2023 +0900

    Change the workaround of MinGW dwrite_3.h problem
    
    The DWRITE_COLOR_GLYPH_RUN1 struct definition of the old MinGW
    dwrite_3.h was invalid. To work around the problem, dw-extra.h defined
    the correct struct definition and all necessary API from dwrite_3.h.
    This approach needed to redefine all necessary API.
    
    This change added DWRITE_COLOR_GLYPH_RUN1_WORKAROUND struct and use it
    for IDWriteColorGlyphRunEnumerator1::GetCurrentRun.

diff --git a/meson.build b/meson.build
index 5b6f9ebd5..aceaa3416 100644
--- a/meson.build
+++ b/meson.build
@@ -522,7 +522,6 @@ if host_machine.system() == 'windows'
   d2d_header = cpp_compiler.has_header('d2d1.h')
   d2d_3_header = cpp_compiler.has_header('d2d1_3.h')
   dwrite_header = cpp_compiler.has_header('dwrite.h')
-  dwrite_3_header = cpp_compiler.has_header('dwrite_3.h')
   wincodec_dep = cpp_compiler.find_library('windowscodecs', required: get_option('dwrite'))
   wincodec_header = cpp_compiler.has_header('wincodec.h')
 
@@ -539,11 +538,6 @@ if host_machine.system() == 'windows'
       conf.set('HAVE_D2D1_3_H', 1)
     endif
 
-    # Exclude MinGW dwrite_3.h because it has a broken definition of DWRITE_COLOR_GLYPH_RUN1.
-    if cpp_compiler.has_header('dwrite_3.h') and cpp_compiler.get_define('__MINGW32__') == ''
-      conf.set('HAVE_DWRITE_3_H', 1)
-    endif
-
     add_project_arguments('-DWINVER=_WIN32_WINNT_WIN10', '-D_WIN32_WINNT=_WIN32_WINNT_WIN10', '-DNTDDI_VERSION=NTDDI_WIN10_RS3', language: ['c', 'cpp'])
   else
     add_project_arguments('-DWINVER=_WIN32_WINNT_WIN2K', '-D_WIN32_WINNT=_WIN32_WINNT_WIN2K', language: ['c', 'cpp'])
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp
index 33c976e08..d1c4e63f1 100644
--- a/src/win32/cairo-dwrite-font.cpp
+++ b/src/win32/cairo-dwrite-font.cpp
@@ -1044,8 +1044,8 @@ _cairo_dwrite_scaled_font_init_glyph_color_surface(cairo_dwrite_scaled_font_t *s
 	if (FAILED(hr) || !have_run)
 	    break;
 
-	DWRITE_COLOR_GLYPH_RUN1 const* color_run;
-	hr = run_enumerator->GetCurrentRun(&color_run);
+	DWRITE_COLOR_GLYPH_RUN1_WORKAROUND const* color_run;
+	hr = run_enumerator->GetCurrentRun(reinterpret_cast<const DWRITE_COLOR_GLYPH_RUN1**>(&color_run));
 	if (FAILED(hr))
 	    return _cairo_dwrite_error (hr, "GetCurrentRun failed");
 
diff --git a/src/win32/cairo-dwrite-private.hpp b/src/win32/cairo-dwrite-private.hpp
index 4857739ea..5e91acf42 100644
--- a/src/win32/cairo-dwrite-private.hpp
+++ b/src/win32/cairo-dwrite-private.hpp
@@ -36,27 +36,25 @@
 
 #include "cairoint.h"
 #include "cairo-win32-refptr.hpp"
-#include <dwrite.h>
-#include <dwrite_2.h>
+#include <dwrite_3.h>
 #include <d2d1.h>
 
-/* If either of the dwrite_3.h or d2d1_3.h headers required for color fonts
- * are not available, include our own version containing just the functions we need.
- */
-
-#if HAVE_DWRITE_3_H
-#include <dwrite_3.h>
-#else
+#ifdef __MINGW32__
 #include "dw-extra.h"
+#else
+typedef DWRITE_COLOR_GLYPH_RUN1 DWRITE_COLOR_GLYPH_RUN1_WORKAROUND;
 #endif
 
+/* If d2d1_3.h header required for color fonts is not available,
+ * include our own version containing just the functions we need.
+ */
+
 #if HAVE_D2D1_3_H
 #include <d2d1_3.h>
 #else
 #include "d2d1-extra.h"
 #endif
 
-
 // DirectWrite is not available on all platforms.
 typedef HRESULT (WINAPI*DWriteCreateFactoryFunc)(
   DWRITE_FACTORY_TYPE factoryType,
diff --git a/src/win32/dw-extra.h b/src/win32/dw-extra.h
index 4203f3427..c79e6389c 100644
--- a/src/win32/dw-extra.h
+++ b/src/win32/dw-extra.h
@@ -1,165 +1,30 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
-/* Mingw-w64 dwrite_3.h is broken
+/* MinGW workarounds
  *
- * We only need the definitions of the following functions and their dependencies.
- *   IDWriteFactory4::TranslateColorGlyphRun()
- *   IDWriteFontResource::GetDefaultFontAxisValues()
- *   IDWriteFontResource::GetFontAxisCount()
- *   IDWriteFontResource::HasVariations()
- *   IDWriteFontFace5::GetFontAxisValueCount()
- *   IDWriteFontFace5::GetFontAxisValues()
- *   IDWriteFontFace5::HasVariations()
- *   IDWriteFontFace5::GetFontResource()
- *
- * But we need to include all the prior functions in the same struct,
- * and parent structs, so that the functions are in the correct position
- * in the vtable. The parameters of the unused functions are not
- * required as we only need a function in the struct to create a
- * function pointer in the vtable.
+ * It doesn't define operators for DWRITE_GLYPH_IMAGE_FORMATS.
+ * The DWRITE_COLOR_GLYPH_RUN struct isn't valid.
+ * <https://sourceforge.net/p/mingw-w64/bugs/913/>
  */
 
 #ifndef DWRITE_EXTRA_H
 #define DWRITE_EXTRA_H
 
-#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
-
-#include <dwrite_2.h>
+#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 10
 
-interface IDWriteFactory3;
-interface IDWriteFactory4;
-interface IDWriteColorGlyphRunEnumerator1;
-
-DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS);
-
-struct DWRITE_COLOR_GLYPH_RUN1 : DWRITE_COLOR_GLYPH_RUN
+typedef struct DWRITE_COLOR_GLYPH_RUN1_WORKAROUND DWRITE_COLOR_GLYPH_RUN1_WORKAROUND;
+struct DWRITE_COLOR_GLYPH_RUN1_WORKAROUND : DWRITE_COLOR_GLYPH_RUN
 {
     DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat;
     DWRITE_MEASURING_MODE measuringMode;
 };
 
+#else
+typedef DWRITE_COLOR_GLYPH_RUN1 DWRITE_COLOR_GLYPH_RUN1_WORKAROUND;
+#error
 
-DEFINE_GUID(IID_IDWriteColorGlyphRunEnumerator1, 0x7c5f86da, 0xc7a1, 0x4f05, 0xb8,0xe1, 0x55,0xa1,0x79,0xfe,0x5a,0x35);
-MIDL_INTERFACE("7c5f86da-c7a1-4f05-b8e1-55a179fe5a35")
-IDWriteColorGlyphRunEnumerator1 : public IDWriteColorGlyphRunEnumerator
-{
-    virtual HRESULT STDMETHODCALLTYPE GetCurrentRun(
-        const DWRITE_COLOR_GLYPH_RUN1 **run) = 0;
-
-};
-__CRT_UUID_DECL(IDWriteColorGlyphRunEnumerator1, 0x7c5f86da, 0xc7a1, 0x4f05, 0xb8,0xe1, 0x55,0xa1,0x79,0xfe,0x5a,0x35)
-
-DEFINE_GUID(IID_IDWriteFactory3, 0x9a1b41c3, 0xd3bb, 0x466a, 0x87,0xfc, 0xfe,0x67,0x55,0x6a,0x3b,0x65);
-MIDL_INTERFACE("9a1b41c3-d3bb-466a-87fc-fe67556a3b65")
-IDWriteFactory3 : public IDWriteFactory2
-{
-  virtual void STDMETHODCALLTYPE CreateGlyphRunAnalysis() = 0;
-  virtual void STDMETHODCALLTYPE CreateCustomRenderingParams() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontFaceReference() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontFaceReference2() = 0;
-  virtual void STDMETHODCALLTYPE GetSystemFontSet() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontSetBuilder() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontCollectionFromFontSet() = 0;
-  virtual void STDMETHODCALLTYPE GetSystemFontCollection() = 0;
-  virtual void STDMETHODCALLTYPE GetFontDownloadQueue() = 0;
-};
-__CRT_UUID_DECL(IDWriteFactory3, 0x9a1b41c3, 0xd3bb, 0x466a, 0x87,0xfc, 0xfe,0x67,0x55,0x6a,0x3b,0x65)
-
-DEFINE_GUID(IID_IDWriteFactory4, 0x4b0b5bd3, 0x0797, 0x4549, 0x8a,0xc5, 0xfe,0x91,0x5c,0xc5,0x38,0x56);
-MIDL_INTERFACE("4b0b5bd3-0797-4549-8ac5-fe915cc53856")
-IDWriteFactory4 : public IDWriteFactory3
-{
-  virtual HRESULT STDMETHODCALLTYPE TranslateColorGlyphRun(
-    D2D1_POINT_2F                      baselineOrigin,
-    DWRITE_GLYPH_RUN const             *glyphRun,
-    DWRITE_GLYPH_RUN_DESCRIPTION const *glyphRunDescription,
-    DWRITE_GLYPH_IMAGE_FORMATS         desiredGlyphImageFormats,
-    DWRITE_MEASURING_MODE              measuringMode,
-    DWRITE_MATRIX const                *worldAndDpiTransform,
-    UINT32                             colorPaletteIndex,
-    IDWriteColorGlyphRunEnumerator1    **colorLayers) = 0;
-};
-__CRT_UUID_DECL(IDWriteFactory4, 0x4b0b5bd3, 0x0797, 0x4549, 0x8a,0xc5, 0xfe,0x91,0x5c,0xc5,0x38,0x56)
-
-typedef enum DWRITE_FONT_AXIS_TAG {
-    DWRITE_FONT_AXIS_TAG_WEIGHT = 0x74686777,
-    DWRITE_FONT_AXIS_TAG_WIDTH = 0x68746477,
-    DWRITE_FONT_AXIS_TAG_SLANT = 0x746e6c73,
-    DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE = 0x7a73706f,
-    DWRITE_FONT_AXIS_TAG_ITALIC = 0x6c617469
-} DWRITE_FONT_AXIS_TAG;
-
-typedef struct DWRITE_FONT_AXIS_VALUE {
-    DWRITE_FONT_AXIS_TAG axisTag;
-    FLOAT value;
-} DWRITE_FONT_AXIS_VALUE;
-
-DEFINE_GUID(IID_IDWriteFontResource, 0x1f803a76, 0x6871, 0x48e8, 0x98,0x7f, 0xb9,0x75,0x55,0x1c,0x50,0xf2);
-MIDL_INTERFACE("1f803a76-6871-48e8-987f-b975551c50f2")
-IDWriteFontResource : public IUnknown
-{
-  virtual void STDMETHODCALLTYPE GetFontFile() = 0;
-  virtual void STDMETHODCALLTYPE GetFontFaceIndex() = 0;
-  virtual UINT32 STDMETHODCALLTYPE GetFontAxisCount() = 0;
-  virtual HRESULT STDMETHODCALLTYPE GetDefaultFontAxisValues(
-    const DWRITE_FONT_AXIS_VALUE *values,
-    UINT32 num_values) = 0;
-  virtual void STDMETHODCALLTYPE GetFontAxisRanges() = 0;
-  virtual void STDMETHODCALLTYPE GetFontAxisAttributes() = 0;
-  virtual void STDMETHODCALLTYPE GetAxisNames() = 0;
-  virtual void STDMETHODCALLTYPE GetAxisValueNameCount() = 0;
-  virtual void STDMETHODCALLTYPE GetAxisValueNames() = 0;
-  virtual WINBOOL STDMETHODCALLTYPE HasVariations() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontFace() = 0;
-  virtual void STDMETHODCALLTYPE CreateFontFaceReference() = 0;
-};
-__CRT_UUID_DECL(IDWriteFontResource, 0x1f803a76, 0x6871, 0x48e8, 0x98,0x7f, 0xb9,0x75,0x55,0x1c,0x50,0xf2)
-
-DEFINE_GUID(IID_IDWriteFontFace3, 0xd37d7598, 0x09be, 0x4222, 0xa2,0x36, 0x20,0x81,0x34,0x1c,0xc1,0xf2);
-MIDL_INTERFACE("d37d7598-09be-4222-a236-2081341cc1f2")
-IDWriteFontFace3 : public IDWriteFontFace2
-{
-  virtual void STDMETHODCALLTYPE GetFontFaceReference() = 0;
-  virtual void STDMETHODCALLTYPE GetPanose() = 0;
-  virtual void STDMETHODCALLTYPE GetWeight() = 0;
-  virtual void STDMETHODCALLTYPE GetStretch() = 0;
-  virtual void STDMETHODCALLTYPE GetStyle() = 0;
-  virtual void STDMETHODCALLTYPE GetFamilyNames() = 0;
-  virtual void STDMETHODCALLTYPE GetFaceNames() = 0;
-  virtual void STDMETHODCALLTYPE GetInformationalStrings() = 0;
-  virtual void STDMETHODCALLTYPE HasCharacter() = 0;
-  virtual void STDMETHODCALLTYPE GetRecommendedRenderingMode() = 0;
-  virtual void STDMETHODCALLTYPE IsCharacterLocal() = 0;
-  virtual void STDMETHODCALLTYPE IsGlyphLocal() = 0;
-  virtual void STDMETHODCALLTYPE AreCharactersLocal() = 0;
-  virtual void STDMETHODCALLTYPE AreGlyphsLocal() = 0;
-};
-__CRT_UUID_DECL(IDWriteFontFace3, 0xd37d7598, 0x09be, 0x4222, 0xa2,0x36, 0x20,0x81,0x34,0x1c,0xc1,0xf2)
-
-DEFINE_GUID(IID_IDWriteFontFace4, 0x27f2a904, 0x4eb8, 0x441d, 0x96,0x78, 0x05,0x63,0xf5,0x3e,0x3e,0x2f);
-MIDL_INTERFACE("27f2a904-4eb8-441d-9678-0563f53e3e2f")
-IDWriteFontFace4 : public IDWriteFontFace3
-{
-  virtual void STDMETHODCALLTYPE GetGlyphImageFormats_() = 0;
-  virtual void STDMETHODCALLTYPE GetGlyphImageFormats() = 0;
-  virtual void STDMETHODCALLTYPE GetGlyphImageData() = 0;
-  virtual void STDMETHODCALLTYPE ReleaseGlyphImageData() = 0;
-};
-__CRT_UUID_DECL(IDWriteFontFace4, 0x27f2a904, 0x4eb8, 0x441d, 0x96,0x78, 0x05,0x63,0xf5,0x3e,0x3e,0x2f)
+#endif
 
-DEFINE_GUID(IID_IDWriteFontFace5, 0x98eff3a5, 0xb667, 0x479a, 0xb1,0x45, 0xe2,0xfa,0x5b,0x9f,0xdc,0x29);
-MIDL_INTERFACE("98eff3a5-b667-479a-b145-e2fa5b9fdc29")
-IDWriteFontFace5 : public IDWriteFontFace4
-{
-  virtual UINT32 STDMETHODCALLTYPE GetFontAxisValueCount() = 0;
-  virtual HRESULT STDMETHODCALLTYPE GetFontAxisValues(
-    DWRITE_FONT_AXIS_VALUE *values,
-    UINT32 value_count) = 0;
-  virtual WINBOOL STDMETHODCALLTYPE HasVariations() = 0;
-  virtual HRESULT STDMETHODCALLTYPE GetFontResource(
-    IDWriteFontResource **resource) = 0;
-  virtual void STDMETHODCALLTYPE Equals() = 0;
-};
-__CRT_UUID_DECL(IDWriteFontFace5, 0x98eff3a5, 0xb667, 0x479a, 0xb1,0x45, 0xe2,0xfa,0x5b,0x9f,0xdc,0x29)
+DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS);
 
 #endif /* DWRITE_EXTRA_H */


More information about the cairo-commit mailing list