From 71025aaf513ee0d83c368b0df87a3f7188738c5c Mon Sep 17 00:00:00 2001 From: Brian Ferguson Date: Tue, 25 Sep 2012 17:37:28 -0600 Subject: [PATCH] Use Arial font (if installed) when FontFace is invalid. --- Library/MeterString.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index e7792c98..13de0cad 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -282,7 +282,17 @@ void CMeterString::Initialize() } else { - m_Font = new Gdiplus::Font(FontFamily::GenericSansSerif (), size, style); + // Use Arial if installed, else use a generic font + FontFamily fFamily(L"Arial"); + + if (fFamily.IsAvailable()) + { + m_Font = new Gdiplus::Font(&fFamily, size, style); + } + else + { + m_Font = new Gdiplus::Font(FontFamily::GenericSansSerif(), size, style); + } } Status status = m_Font->GetLastStatus();