summaryrefslogtreecommitdiff
path: root/pango2/pangodwrite-fontmap.h
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2022-07-05 16:35:12 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2022-08-01 18:23:33 +0800
commit79de98b717f841cc3343aac14c54d4f5d5755f86 (patch)
treeaffaa34cc0ba21e22d631469f4db8e848327597d /pango2/pangodwrite-fontmap.h
parenta4ed7a545f332822bd869a7ec509fa7cf8814ca3 (diff)
downloadpango-79de98b717f841cc3343aac14c54d4f5d5755f86.tar.gz
pangodwrite-fontmap: Add APIs to query font description from Windows fontspango2-windows
Add 2 APIs for querying the Pango2FontDescription that corresponds to the specified Windows LOGFONTW (GDI font) or IDWriteFont, largely using the code that we already have in the DirectWrite support. Notice that with the LOGFONTW path, we use DirectWrite's GDI interop to acquire a IDWriteFont first and then go down the same (existing) route as when we use a IDWriteFont, since it may be necessary to use LOGFONTW's since Windows APIs such as SystemParametersInfoW() return LOGFONTW's instead of IDWriteFont's, but DirectWrite has more fine-grained support for font properties than GDI.
Diffstat (limited to 'pango2/pangodwrite-fontmap.h')
-rw-r--r--pango2/pangodwrite-fontmap.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/pango2/pangodwrite-fontmap.h b/pango2/pangodwrite-fontmap.h
index c873759d..f79a0816 100644
--- a/pango2/pangodwrite-fontmap.h
+++ b/pango2/pangodwrite-fontmap.h
@@ -21,6 +21,9 @@
#pragma once
+#define WIN32_LEAN_AND_MEAN 1
+
+#include <windows.h>
#include <pango2/pango.h>
G_BEGIN_DECLS
@@ -34,7 +37,13 @@ PANGO2_DECLARE_INTERNAL_TYPE (Pango2DirectWriteFontMap,
Pango2FontMap)
PANGO2_AVAILABLE_IN_ALL
-Pango2DirectWriteFontMap * pango2_direct_write_font_map_new (void);
+Pango2DirectWriteFontMap *pango2_direct_write_font_map_new (void);
+
+PANGO2_AVAILABLE_IN_ALL
+Pango2FontDescription *pango2_direct_write_get_font_description_from_dwrite_font (gpointer dwrite_font);
+PANGO2_AVAILABLE_IN_ALL
+Pango2FontDescription *pango2_direct_write_get_font_description_from_logfontw (LOGFONTW *lfw,
+ Pango2FontMap *font_map);
G_END_DECLS