summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9a67941)
In spite of the name, we need to use otmpFamilyName member of
OUTLINETEXTMETRIC struct and not otmpFaceName to get the font face name: the
latter may contain (locale-dependent, so the changes of r62708 didn't work for
non-English versions of Windows) "Italic" or "Bold" suffix while the former
does not and is what we want.
This should really fix the unit test failures, even in French locale.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62732
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
facename = GetMSWFaceName();
if ( !facename.empty() )
{
facename = GetMSWFaceName();
if ( !facename.empty() )
{
- // the face name returned by GetOutlineTextMetrics() may have
- // these suffixes which we don't count as part of face name
- // because we have separate fields for them so remove them
- wxString basename;
- if ( facename.EndsWith(wxS(" Italic"), &basename) ||
- facename.EndsWith(wxS(" Bold"), &basename) )
- facename = basename;
-
// cache the face name, it shouldn't change unless the family
// does and wxNativeFontInfo::SetFamily() resets the face name
const_cast<wxFontRefData *>(this)->SetFaceName(facename);
// cache the face name, it shouldn't change unless the family
// does and wxNativeFontInfo::SetFamily() resets the face name
const_cast<wxFontRefData *>(this)->SetFaceName(facename);
- // in spite of its type, the otmpFaceName field of OUTLINETEXTMETRIC
- // gives an offset in _bytes_ of the face name from the struct start
- // while the name itself is an array of TCHARs
+ // 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) +
return reinterpret_cast<wxChar *>(otm) +
- wxPtrToUInt(otm->otmpFaceName)/sizeof(wxChar);
+ wxPtrToUInt(otm->otmpFamilyName)/sizeof(wxChar);
}
// are we using m_nativeFontInfo.lf.lfHeight for point size or pixel size?
}
// are we using m_nativeFontInfo.lf.lfHeight for point size or pixel size?