win32: handle control font failure

original commit: 1ce430faf70d2ab5c4dcf8ea991afb74d4684742
This commit is contained in:
Matthew Flatt 2011-01-11 19:41:52 -07:00
parent 53db50dc93
commit 407d2c5d43
2 changed files with 8 additions and 5 deletions

View File

@ -18,7 +18,9 @@
(let* ([pfont (pango_font_map_load_font display-font-map (let* ([pfont (pango_font_map_load_font display-font-map
display-context display-context
(send f get-pango))] (send f get-pango))]
[logfont (pango_win32_font_logfont pfont)]) [logfont (and pfont
(begin0 (pango_win32_font_logfont pfont))])
(pango_win32_font_cache_load font-cache logfont) (and logfont
(g_free logfont)))) (begin0
(pango_win32_font_cache_load font-cache logfont)
(g_free logfont)))))

View File

@ -338,7 +338,8 @@
(unless theme-hfont (unless theme-hfont
(set! theme-hfont (CreateFontIndirectW (get-theme-logfont)))) (set! theme-hfont (CreateFontIndirectW (get-theme-logfont))))
(let ([hfont (if font (let ([hfont (if font
(font->hfont font) (or (font->hfont font)
theme-hfont)
theme-hfont)]) theme-hfont)])
(SendMessageW hwnd WM_SETFONT (cast hfont _HFONT _LPARAM) 0))) (SendMessageW hwnd WM_SETFONT (cast hfont _HFONT _LPARAM) 0)))