Fix wxDFB build after the font changes
Implement the new wxFont pure virtual methods in this port version of this class. Neither arbitrary weights nor fractional point sizes are actually supported in this port however.
This commit is contained in:
@@ -72,19 +72,19 @@ public:
|
|||||||
bool Create(const wxNativeFontInfo& fontinfo);
|
bool Create(const wxNativeFontInfo& fontinfo);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual int GetPointSize() const;
|
virtual float GetFractionalPointSize() const;
|
||||||
virtual wxFontStyle GetStyle() const;
|
virtual wxFontStyle GetStyle() const;
|
||||||
virtual wxFontWeight GetWeight() const;
|
virtual int GetNumericWeight() const;
|
||||||
virtual wxString GetFaceName() const;
|
virtual wxString GetFaceName() const;
|
||||||
virtual bool GetUnderlined() const;
|
virtual bool GetUnderlined() const;
|
||||||
virtual wxFontEncoding GetEncoding() const;
|
virtual wxFontEncoding GetEncoding() const;
|
||||||
virtual bool IsFixedWidth() const;
|
virtual bool IsFixedWidth() const;
|
||||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
||||||
|
|
||||||
virtual void SetPointSize(int pointSize);
|
virtual void SetFractionalPointSize(float pointSize);
|
||||||
virtual void SetFamily(wxFontFamily family);
|
virtual void SetFamily(wxFontFamily family);
|
||||||
virtual void SetStyle(wxFontStyle style);
|
virtual void SetStyle(wxFontStyle style);
|
||||||
virtual void SetWeight(wxFontWeight weight);
|
virtual void SetNumericWeight(int weight);
|
||||||
virtual bool SetFaceName(const wxString& faceName);
|
virtual bool SetFaceName(const wxString& faceName);
|
||||||
virtual void SetUnderlined(bool underlined);
|
virtual void SetUnderlined(bool underlined);
|
||||||
virtual void SetEncoding(wxFontEncoding encoding);
|
virtual void SetEncoding(wxFontEncoding encoding);
|
||||||
|
@@ -204,7 +204,7 @@ public:
|
|||||||
wxFontMgrFontRefData(int size = wxDEFAULT,
|
wxFontMgrFontRefData(int size = wxDEFAULT,
|
||||||
wxFontFamily family = wxFONTFAMILY_DEFAULT,
|
wxFontFamily family = wxFONTFAMILY_DEFAULT,
|
||||||
wxFontStyle style = wxFONTSTYLE_NORMAL,
|
wxFontStyle style = wxFONTSTYLE_NORMAL,
|
||||||
wxFontWeight weight = wxFONTWEIGHT_NORMAL,
|
int weight = wxFONTWEIGHT_NORMAL,
|
||||||
bool underlined = false,
|
bool underlined = false,
|
||||||
const wxString& faceName = wxEmptyString,
|
const wxString& faceName = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||||
@@ -218,18 +218,18 @@ public:
|
|||||||
|
|
||||||
const wxNativeFontInfo *GetNativeFontInfo() const { return &m_info; }
|
const wxNativeFontInfo *GetNativeFontInfo() const { return &m_info; }
|
||||||
|
|
||||||
int GetPointSize() const { return m_info.pointSize; }
|
float GetFractionalPointSize() const { return m_info.pointSize; }
|
||||||
wxString GetFaceName() const { return m_info.faceName; }
|
wxString GetFaceName() const { return m_info.faceName; }
|
||||||
wxFontFamily GetFamily() const { return m_info.family; }
|
wxFontFamily GetFamily() const { return m_info.family; }
|
||||||
wxFontStyle GetStyle() const { return m_info.style; }
|
wxFontStyle GetStyle() const { return m_info.style; }
|
||||||
wxFontWeight GetWeight() const { return m_info.weight; }
|
int GetNumericWeight() const { return m_info.weight; }
|
||||||
bool GetUnderlined() const { return m_info.underlined; }
|
bool GetUnderlined() const { return m_info.underlined; }
|
||||||
wxFontEncoding GetEncoding() const { return m_info.encoding; }
|
wxFontEncoding GetEncoding() const { return m_info.encoding; }
|
||||||
|
|
||||||
void SetPointSize(int pointSize);
|
void SetFractionalPointSize(float pointSize);
|
||||||
void SetFamily(wxFontFamily family);
|
void SetFamily(wxFontFamily family);
|
||||||
void SetStyle(wxFontStyle style);
|
void SetStyle(wxFontStyle style);
|
||||||
void SetWeight(wxFontWeight weight);
|
void SetNumericWeight(int weight);
|
||||||
void SetFaceName(const wxString& faceName);
|
void SetFaceName(const wxString& faceName);
|
||||||
void SetUnderlined(bool underlined);
|
void SetUnderlined(bool underlined);
|
||||||
void SetEncoding(wxFontEncoding encoding);
|
void SetEncoding(wxFontEncoding encoding);
|
||||||
|
@@ -118,7 +118,7 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const
|
|||||||
|
|
||||||
int type = FaceType_Regular;
|
int type = FaceType_Regular;
|
||||||
|
|
||||||
if ( font.GetWeight() == wxFONTWEIGHT_BOLD )
|
if ( font.GetNumericWeight() >= wxFONTWEIGHT_BOLD )
|
||||||
type |= FaceType_Bold;
|
type |= FaceType_Bold;
|
||||||
|
|
||||||
// FIXME -- this should read "if ( font->GetStyle() == wxFONTSTYLE_ITALIC )",
|
// FIXME -- this should read "if ( font->GetStyle() == wxFONTSTYLE_ITALIC )",
|
||||||
@@ -227,7 +227,7 @@ void wxFontsManagerBase::AddBundle(wxFontBundle *bundle)
|
|||||||
wxFontMgrFontRefData::wxFontMgrFontRefData(int size,
|
wxFontMgrFontRefData::wxFontMgrFontRefData(int size,
|
||||||
wxFontFamily family,
|
wxFontFamily family,
|
||||||
wxFontStyle style,
|
wxFontStyle style,
|
||||||
wxFontWeight weight,
|
int weight,
|
||||||
bool underlined,
|
bool underlined,
|
||||||
const wxString& faceName,
|
const wxString& faceName,
|
||||||
wxFontEncoding encoding)
|
wxFontEncoding encoding)
|
||||||
@@ -240,7 +240,7 @@ wxFontMgrFontRefData::wxFontMgrFontRefData(int size,
|
|||||||
m_info.family = (wxFontFamily)family;
|
m_info.family = (wxFontFamily)family;
|
||||||
m_info.faceName = faceName;
|
m_info.faceName = faceName;
|
||||||
m_info.style = (wxFontStyle)style;
|
m_info.style = (wxFontStyle)style;
|
||||||
m_info.weight = (wxFontWeight)weight;
|
m_info.weight = weight;
|
||||||
m_info.pointSize = size;
|
m_info.pointSize = size;
|
||||||
m_info.underlined = underlined;
|
m_info.underlined = underlined;
|
||||||
m_info.encoding = encoding;
|
m_info.encoding = encoding;
|
||||||
@@ -281,7 +281,7 @@ wxFontMgrFontRefData::GetFontInstance(float scale, bool antialiased) const
|
|||||||
antialiased);
|
antialiased);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFontMgrFontRefData::SetPointSize(int pointSize)
|
void wxFontMgrFontRefData::SetFractionalPointSize(float pointSize)
|
||||||
{
|
{
|
||||||
m_info.pointSize = pointSize;
|
m_info.pointSize = pointSize;
|
||||||
m_fontValid = false;
|
m_fontValid = false;
|
||||||
@@ -299,7 +299,7 @@ void wxFontMgrFontRefData::SetStyle(wxFontStyle style)
|
|||||||
m_fontValid = false;
|
m_fontValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFontMgrFontRefData::SetWeight(wxFontWeight weight)
|
void wxFontMgrFontRefData::SetNumericWeight(int weight)
|
||||||
{
|
{
|
||||||
m_info.weight = weight;
|
m_info.weight = weight;
|
||||||
m_fontValid = false;
|
m_fontValid = false;
|
||||||
|
@@ -40,8 +40,14 @@ typedef wxFontMgrFontRefData wxFontRefData;
|
|||||||
|
|
||||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||||
{
|
{
|
||||||
return Create(info.pointSize, info.family, info.style, info.weight,
|
m_refData = new wxFontRefData(info.pointSize,
|
||||||
info.underlined, info.faceName, info.encoding);
|
info.family,
|
||||||
|
info.style,
|
||||||
|
info.weight,
|
||||||
|
info.underlined,
|
||||||
|
info.faceName,
|
||||||
|
info.encoding);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFont::Create(int pointSize,
|
bool wxFont::Create(int pointSize,
|
||||||
@@ -81,11 +87,11 @@ wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const
|
|||||||
return i ? i->GetDirectFBFont() : wxIDirectFBFontPtr();
|
return i ? i->GetDirectFBFont() : wxIDirectFBFontPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxFont::GetPointSize() const
|
float wxFont::GetFractionalPointSize() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||||
|
|
||||||
return M_FONTDATA->GetPointSize();
|
return M_FONTDATA->GetFractionalPointSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFaceName() const
|
wxString wxFont::GetFaceName() const
|
||||||
@@ -107,11 +113,11 @@ wxFontStyle wxFont::GetStyle() const
|
|||||||
return M_FONTDATA->GetStyle();
|
return M_FONTDATA->GetStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFontWeight wxFont::GetWeight() const
|
int wxFont::GetNumericWeight() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
|
wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
|
||||||
|
|
||||||
return M_FONTDATA->GetWeight();
|
return M_FONTDATA->GetNumericWeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFont::GetUnderlined() const
|
bool wxFont::GetUnderlined() const
|
||||||
@@ -147,10 +153,10 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
|
|||||||
// change font attributes
|
// change font attributes
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxFont::SetPointSize(int pointSize)
|
void wxFont::SetFractionalPointSize(float pointSize)
|
||||||
{
|
{
|
||||||
AllocExclusive();
|
AllocExclusive();
|
||||||
M_FONTDATA->SetPointSize(pointSize);
|
M_FONTDATA->SetFractionalPointSize(pointSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFont::SetFamily(wxFontFamily family)
|
void wxFont::SetFamily(wxFontFamily family)
|
||||||
@@ -165,10 +171,10 @@ void wxFont::SetStyle(wxFontStyle style)
|
|||||||
M_FONTDATA->SetStyle(style);
|
M_FONTDATA->SetStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFont::SetWeight(wxFontWeight weight)
|
void wxFont::SetNumericWeight(int weight)
|
||||||
{
|
{
|
||||||
AllocExclusive();
|
AllocExclusive();
|
||||||
M_FONTDATA->SetWeight(weight);
|
M_FONTDATA->SetNumericWeight(weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFont::SetFaceName(const wxString& faceName)
|
bool wxFont::SetFaceName(const wxString& faceName)
|
||||||
|
Reference in New Issue
Block a user