m_macFontFamily = FMGetFontFamilyFromName( qdFontName );
if ( m_macFontFamily == kInvalidFontFamily )
{
- wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName );
+ wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName.c_str() );
m_macFontFamily = GetAppFont();
}
#endif
void wxFont::SetEncoding(wxFontEncoding encoding)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_encoding = encoding;
RealizeResource();
}
-void wxFont::Unshare()
+wxObjectRefData* wxFont::CreateRefData() const
{
- // Don't change shared data
- if (!m_refData)
- {
- m_refData = new wxFontRefData();
- }
- else
- {
- wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
- UnRef();
- m_refData = ref;
- }
+ return new wxFontRefData;
+}
+
+wxObjectRefData* wxFont::CloneRefData(const wxObjectRefData* data) const
+{
+ return new wxFontRefData(*wx_static_cast(const wxFontRefData*, data));
}
void wxFont::SetPointSize(int pointSize)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_pointSize = pointSize;
void wxFont::SetFamily(int family)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_family = family;
void wxFont::SetStyle(int style)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_style = style;
void wxFont::SetWeight(int weight)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_weight = weight;
bool wxFont::SetFaceName(const wxString& faceName)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_faceName = faceName;
void wxFont::SetUnderlined(bool underlined)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_underlined = underlined;
void wxFont::SetNoAntiAliasing( bool no )
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->SetNoAntiAliasing( no );