summaryrefslogtreecommitdiff
path: root/pango/pangowin32-dwrite-fontmap.cpp
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2022-12-14 12:56:05 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2022-12-14 13:10:27 +0800
commitc050fe202f1ef4657e64d48d363188240774f90f (patch)
treee19d0b2ecf417667fe1bec7a79603665c2cebf40 /pango/pangowin32-dwrite-fontmap.cpp
parentc5b5d53ae90e15c0ba74b75f08a39fa4098a03f7 (diff)
downloadpango-fix-partially-720.tar.gz
pangowin32-fontmap.c: Allow some support for loading custom fontsfix-partially-720
Previously, when using GDI, we are able to add custom fonts to the system font collection using AddFontResource()/AddFontResourceEx(), but this is not enough as we transition to DirectWrite. Allow some support for this for people that are using AddFontResource() (but not yet AddFontResourceEx()), by using the GDI interop support in DirectWrite. Let people know that currently AddFontResource() should be used for the moment for this support to work, not AddFontResourceEx().
Diffstat (limited to 'pango/pangowin32-dwrite-fontmap.cpp')
-rw-r--r--pango/pangowin32-dwrite-fontmap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/pango/pangowin32-dwrite-fontmap.cpp b/pango/pangowin32-dwrite-fontmap.cpp
index a2c03675..377544a9 100644
--- a/pango/pangowin32-dwrite-fontmap.cpp
+++ b/pango/pangowin32-dwrite-fontmap.cpp
@@ -208,8 +208,12 @@ pango_win32_logfontw_get_dwrite_font (LOGFONTW *logfontw)
hr = dwrite_items->gdi_interop->CreateFontFromLOGFONT (logfontw, &font);
if (FAILED (hr) || font == NULL)
- g_warning ("IDWriteFactory::GdiInterop::CreateFontFromLOGFONT failed with error %x\n",
- (unsigned)hr);
+ {
+ g_warning ("IDWriteFactory::GdiInterop::CreateFontFromLOGFONT failed with error %x\n",
+ (unsigned)hr);
+ if (hr == DWRITE_E_NOFONT)
+ g_message ("Did you create your LOGFONTW using AddFontResource() instead of AddFontResourceEx()?");
+ }
return font;
}