// default ctor (default copy ctor is ok)
wxNativeFontInfo() { Init(); }
+#if wxUSE_PANGO
+ wxNativeFontInfo(const wxNativeFontInfo& info);
+ ~wxNativeFontInfo();
+#endif
+
// reset to the default state
void Init();
if ( style && style->font_desc )
{
wxNativeFontInfo info;
- info.description = style->font_desc;
+ info.description = pango_font_description_copy(style->font_desc);
attr.font = wxFont(info);
}
else
if ( def && def->font_desc )
{
wxNativeFontInfo info;
- info.description = def->font_desc;
+ info.description =
+ pango_font_description_copy(def->font_desc);
gs_objects.m_fontSystem = wxFont(info);
}
else
if ( style && style->font_desc )
{
wxNativeFontInfo info;
- info.description = style->font_desc;
+ info.description = pango_font_description_copy(style->font_desc);
attr.font = wxFont(info);
}
else
if ( def && def->font_desc )
{
wxNativeFontInfo info;
- info.description = def->font_desc;
+ info.description =
+ pango_font_description_copy(def->font_desc);
gs_objects.m_fontSystem = wxFont(info);
}
else
description = NULL;
}
+wxNativeFontInfo::wxNativeFontInfo(const wxNativeFontInfo& info)
+{
+ if (info.description)
+ description = pango_font_description_copy(info.description);
+ else
+ description = NULL;
+}
+
+wxNativeFontInfo::~wxNativeFontInfo()
+{
+ if (description)
+ pango_font_description_free(description);
+}
+
int wxNativeFontInfo::GetPointSize() const
{
return pango_font_description_get_size( description ) / PANGO_SCALE;