}
// Create font from font attributes.
-wxFont wxTextAttr::CreateFont() const
+wxFont wxTextAttr::GetFont() const
{
+ if ( !HasFont() )
+ return wxNullFont;
+
int fontSize = 10;
if (HasFontSize())
fontSize = GetFontSize();
if (flags & wxTEXT_ATTR_FONT_ENCODING)
m_fontEncoding = font.GetEncoding();
+ m_flags |= flags;
+
return true;
}
const wxTextAttr& attrDef,
const wxTextCtrlBase *text)
{
- wxFont font = attr.GetFont();
+ wxFont font;
+ if (attr.HasFont())
+ font = attr.GetFont();
+
if ( !font.Ok() )
{
- font = attrDef.GetFont();
+ if (attrDef.HasFont())
+ font = attrDef.GetFont();
if ( text && !font.Ok() )
font = text->GetFont();