diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-07-07 12:36:26 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-09-26 11:04:25 +0800 |
commit | 5bc16f7896ba3eb5b37ffdb03f28c646aad5889e (patch) | |
tree | d8caafc9e81c3ab8e4628df6116a7e636a792211 /pango/pangowin32-private.h | |
parent | 6843d7fdd75382a162eefe0034d3e8e1d3b50293 (diff) | |
download | pango-5bc16f7896ba3eb5b37ffdb03f28c646aad5889e.tar.gz |
pangowin32: Use DirectWrite to enumerate system fonts
...instead of using EnumFontFamiliesEx(), and retrieve the LOGFONTW's that we
need via DirectWrite's GDI interop. Also cache up our IDWriteFont's that we
obtained, so that we can use DirectWrite to query font properties better
than what GDI/Uniscribe can do for us, such as obtaining stretch info from
the font. Also update synthesize_foreach() accordingly, since we should
also record the IDWriteFonts as well for synthesized LOGFONTWs.
Portions based on Luca Bacci's implementation of the DirectWrite fontmap
support in the upcoming Pango2.
Diffstat (limited to 'pango/pangowin32-private.h')
-rw-r--r-- | pango/pangowin32-private.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index ffd247c1..97bb6ba1 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -99,6 +99,11 @@ struct _PangoWin32FontMap */ GHashTable *fonts; + /* Map LOGFONTWs to IDWriteFonts corresponding to actual fonts + * installed, if applicable. + */ + GHashTable *dwrite_fonts; + /* keeps track of the system font aliases that we might have */ GHashTable *aliases; @@ -284,12 +289,23 @@ gpointer _pango_win32_copy_cmap (gpointer cmap, extern gboolean _pango_win32_debug; +void pango_win32_insert_font (PangoWin32FontMap *win32fontmap, + LOGFONTW *lfp, + gpointer dwrite_font, + gboolean is_synthetic); + PangoWin32DWriteItems *pango_win32_init_direct_write (void); PangoWin32DWriteItems *pango_win32_get_direct_write_items (void); +void pango_win32_dwrite_font_map_populate (PangoWin32FontMap *map); + void pango_win32_dwrite_items_destroy (PangoWin32DWriteItems *items); +void pango_win32_dwrite_font_release (gpointer dwrite_font); + +gpointer pango_win32_logfontw_get_dwrite_font (LOGFONTW *logfontw); + G_END_DECLS #endif /* __PANGOWIN32_PRIVATE_H__ */ |