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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user