diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-10-18 01:48:00 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-10-18 01:48:00 +0000 |
commit | d616f88dbb6dd5360eebf8ab42884fb90583218b (patch) | |
tree | 0899bc99cd277dadd16e67c1456bd665a69b5cb6 /pango | |
parent | 34d2d850efdfcdea532203be375f9dd7020d65fa (diff) | |
parent | 22127fbb230b655ce493b497c2db6548f4552a0f (diff) | |
download | pango-d616f88dbb6dd5360eebf8ab42884fb90583218b.tar.gz |
Merge branch 'fix-707' into 'main'
Windows: Fix builds using HarfBuzz as subproject
Closes #707
See merge request GNOME/pango!649
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pangowin32-dwrite-fontmap.cpp | 12 | ||||
-rw-r--r-- | pango/pangowin32-private.h | 2 | ||||
-rw-r--r-- | pango/pangowin32.c | 39 |
3 files changed, 5 insertions, 48 deletions
diff --git a/pango/pangowin32-dwrite-fontmap.cpp b/pango/pangowin32-dwrite-fontmap.cpp index 6e1d9f0a..a2c03675 100644 --- a/pango/pangowin32-dwrite-fontmap.cpp +++ b/pango/pangowin32-dwrite-fontmap.cpp @@ -25,10 +25,6 @@ #include <initguid.h> #include <dwrite_1.h> -#ifdef HAVE_HARFBUZZ_DIRECT_WRITE -#include <hb-directwrite.h> -#endif - #ifdef STRICT #undef STRICT #endif @@ -563,14 +559,6 @@ pango_win32_dwrite_font_check_is_hinted (PangoWin32Font *font) return result; } -#ifdef HAVE_HARFBUZZ_DIRECT_WRITE -hb_face_t * -pango_win32_dwrite_font_face_create_hb_face (gpointer face) -{ - return hb_directwrite_face_create ((IDWriteFontFace *)face); -} -#endif - void pango_win32_dwrite_font_release (gpointer dwrite_font) { diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index f69d2b6b..1502ecd9 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -321,8 +321,6 @@ gpointer pango_win32_logfontw_get_dwrite_font (LOGFONTW PangoFontDescription * pango_win32_font_description_from_logfontw_dwrite (const LOGFONTW *logfontw); -hb_face_t *pango_win32_dwrite_font_face_create_hb_face (gpointer face); - G_END_DECLS #endif /* __PANGOWIN32_PRIVATE_H__ */ diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 09b97a55..5a26ee98 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -29,10 +29,6 @@ #include <glib.h> #include <hb.h> -#if defined (HAVE_HARFBUZZ_GDI) -#include <hb-gdi.h> -#endif - #include "pango-impl-utils.h" #include "pangowin32.h" #include "pangowin32-private.h" @@ -1289,45 +1285,20 @@ hfont_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data) static hb_font_t * pango_win32_font_create_hb_font (PangoFont *font) { - PangoWin32Font *win32font = PANGO_WIN32_FONT (font); - HFONT hfont = NULL; + PangoWin32Font *win32font = (PangoWin32Font *)font; + HFONT hfont; hb_face_t *face = NULL; hb_font_t *hb_font = NULL; - static const hb_user_data_key_t key; - hb_destroy_func_t destroy_func = NULL; - void *destroy_obj = NULL; - gpointer dwrite_font_face = NULL; g_return_val_if_fail (font != NULL, NULL); -#ifdef HAVE_HARFBUZZ_DIRECT_WRITE - dwrite_font_face = pango_win32_font_get_dwrite_font_face (win32font); - - if (dwrite_font_face != NULL) - { - face = pango_win32_dwrite_font_face_create_hb_face (dwrite_font_face); - destroy_func = pango_win32_dwrite_font_face_release; - destroy_obj = dwrite_font_face; - } -#endif - if (face == NULL) - { - hfont = _pango_win32_font_get_hfont (font); + hfont = _pango_win32_font_get_hfont (font); -#ifdef HAVE_HARFBUZZ_GDI - face = hb_gdi_face_create (hfont); -#else - face = hb_face_create_for_tables (hfont_reference_table, (void *)hfont, NULL); -#endif - } + /* We are *not* allowed to destroy the HFONT here ! */ + face = hb_face_create_for_tables (hfont_reference_table, (void *)hfont, NULL); hb_font = hb_font_create (face); hb_font_set_scale (hb_font, win32font->size, win32font->size); - - /* We are supposed to destroy the IDWriteFontFace, but *not* the HFONT! */ - if (destroy_func != NULL && destroy_obj != NULL) - hb_font_set_user_data (hb_font, &key, destroy_obj, destroy_func, TRUE); - hb_face_destroy (face); return hb_font; |