✅ Win32 EnumFontFamiliesEx doesn't call the callback I provide
I wrote a class to test if a WPF font is fixed width. But the only way I could find to do that was to get the
LOGFONT
and test it. So I went through a lot of P/Invoke hoops to get there. I created a DC for the display and asked it to enumerate the fonts. My callback is never called. Can someone tell me why? EnumFontFamiliesEx
is always returning 1. The only thing the MSDN documentation says about the return value is it's the last return value from the callback. But my callback was never called. My code is attached.2 Replies
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Well, thanks to the post https://learn.microsoft.com/en-us/answers/questions/1377392/win32-enumfontfamiliesex-doesnt-call-the-callback?page=1&orderby=helpful&comment=answer-1324364#newest-answer-comment, I managed to get it working. The new code is attached.
Win32 EnumFontFamiliesEx doesn't call the callback I provide - Micr...
I wrote a class to test if a WPF font is fixed width. But the only way I could find to do that was to get the LOGFONT and test it. So I went through a lot of P/Invoke hoops to get there. I created a DC for the display and asked it to enumerate the…