+ UINT otmSize = GetOutlineTextMetrics(hdc, 0, NULL);
+ if ( !otmSize )
+ {
+ wxLogLastError("GetOutlineTextMetrics(NULL)");
+ return wxString();
+ }
+
+ OUTLINETEXTMETRIC * const
+ otm = static_cast<OUTLINETEXTMETRIC *>(malloc(otmSize));
+ wxON_BLOCK_EXIT1( free, otm );
+
+ otm->otmSize = otmSize;
+ if ( !GetOutlineTextMetrics(hdc, otmSize, otm) )
+ {
+ wxLogLastError("GetOutlineTextMetrics()");
+ return wxString();
+ }
+
+ // in spite of its type, the otmpFamilyName field of OUTLINETEXTMETRIC
+ // gives an offset in _bytes_ of the face (not family!) name from the
+ // struct start while the name itself is an array of TCHARs
+ //
+ // FWIW otmpFaceName contains the same thing as otmpFamilyName followed
+ // by a possible " Italic" or " Bold" or something else suffix
+ return reinterpret_cast<wxChar *>(otm) +
+ wxPtrToUInt(otm->otmpFamilyName)/sizeof(wxChar);
+ }
+
+ // are we using m_nativeFontInfo.lf.lfHeight for point size or pixel size?
+ bool m_sizeUsingPixels;
+
+ // Windows font handle, created on demand in GetHFONT()
+ HFONT m_hFont;