backport, get rid of performance warnings "For best performance, only use PostScript names when calling this API", see #15999

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2014-04-25 21:03:37 +00:00
parent f82bf771e2
commit f9abeeed90

View File

@@ -1309,4 +1309,23 @@ void wxNativeFontInfo::SetStrikethrough(bool WXUNUSED(strikethrough))
{
}
void wxNativeFontInfo::UpdateNamesMap(const wxString& familyName, CTFontDescriptorRef descr)
{
if ( gs_FontFamilyToPSName.find(familyName) == gs_FontFamilyToPSName.end() )
{
wxCFStringRef psName( (CFStringRef) CTFontDescriptorCopyAttribute(descr, kCTFontNameAttribute));
gs_FontFamilyToPSName[familyName] = psName.AsString();
}
}
void wxNativeFontInfo::UpdateNamesMap(const wxString& familyName, CTFontRef font)
{
if ( gs_FontFamilyToPSName.find(familyName) == gs_FontFamilyToPSName.end() )
{
wxCFRef<CTFontDescriptorRef> descr(CTFontCopyFontDescriptor( font ));
UpdateNamesMap(familyName, descr);
}
}