static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize)
{
- int currentSize = 0;
int largestGood = 0;
int smallestBad = 0;
// NB: this assignment was separated from the variable definition
// in order to fix a gcc v3.3.3 compiler crash
- currentSize = font.GetPointSize();
+ int currentSize = font.GetPointSize();
while (currentSize > 0)
{
dc.SetFont(font);
);
}
-bool wxFontBase::operator!=(const wxFont& font) const
-{
- return !(*this == font);
-}
-
wxString wxFontBase::GetFamilyString() const
{
wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
}
#endif // generic or wxMSW or wxOS2
+
+
+// wxFont <-> wxString utilities, used by wxConfig
+wxString wxToString(const wxFontBase& font)
+{
+ return font.IsOk() ? font.GetNativeFontInfoDesc()
+ : wxString();
+}
+
+bool wxFromString(const wxString& str, wxFontBase *font)
+{
+ wxCHECK_MSG( font, false, _T("NULL output parameter") );
+
+ if ( str.empty() )
+ {
+ *font = wxNullFont;
+ return true;
+ }
+
+ return font->SetNativeFontInfo(str);
+}
+
+