]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontcmn.cpp
add a comment about wxNativeFontInfo::SetFaceName return value
[wxWidgets.git] / src / common / fontcmn.cpp
index 67ee5bff6440a55d221a503934e80503ced8b86d..3b8b7fd80e12d07c0f09229b2b197f222a6326e5 100644 (file)
 
 #include "wx/tokenzr.h"
 
+// debugger helper: this function can be called from a debugger to show what
+// the date really is
+extern const char *wxDumpFont(const wxFont *font)
+{
+    static char buf[256];
+
+    const wxFontWeight weight = font->GetWeight();
+
+    wxString s;
+    s.Printf(wxS("%s-%s-%s-%d-%d"),
+             font->GetFaceName(),
+             weight == wxFONTWEIGHT_NORMAL
+                ? _T("normal")
+                : weight == wxFONTWEIGHT_BOLD
+                    ? _T("bold")
+                    : _T("light"),
+             font->GetStyle() == wxFONTSTYLE_NORMAL
+                ? _T("regular")
+                : _T("italic"),
+             font->GetPointSize(),
+             font->GetEncoding());
+
+    wxStrlcpy(buf, s.mb_str(), WXSIZEOF(buf));
+    return buf;
+}
+
 // ============================================================================
 // implementation
 // ============================================================================