+void wxNativeFontInfo::Init()
+{
+ memset(&fa, '\0', sizeof(FATTRS));
+} // end of wxNativeFontInfo::Init
+
+int wxNativeFontInfo::GetPointSize() const
+{
+ return fm.lEmHeight;
+} // end of wxNativeFontInfo::GetPointSize
+
+wxFontStyle wxNativeFontInfo::GetStyle() const
+{
+ return fa.fsSelection & FATTR_SEL_ITALIC ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL;
+} // end of wxNativeFontInfo::GetStyle
+
+wxFontWeight wxNativeFontInfo::GetWeight() const
+{
+ switch(fn.usWeightClass)
+ {
+ case FWEIGHT_DONT_CARE:
+ return wxFONTWEIGHT_NORMAL;
+
+ case FWEIGHT_NORMAL:
+ return wxFONTWEIGHT_NORMAL;
+
+ case FWEIGHT_LIGHT:
+ return wxFONTWEIGHT_LIGHT;
+
+ case FWEIGHT_BOLD:
+ return wxFONTWEIGHT_BOLD;
+
+ case FWEIGHT_ULTRA_BOLD:
+ return wxFONTWEIGHT_MAX;
+ }
+ return wxFONTWEIGHT_NORMAL;
+} // end of wxNativeFontInfo::GetWeight
+
+bool wxNativeFontInfo::GetUnderlined() const
+{
+ return ((fa.fsSelection & FATTR_SEL_UNDERSCORE) != 0);
+} // end of wxNativeFontInfo::GetUnderlined
+
+wxString wxNativeFontInfo::GetFaceName() const
+{
+ return fm.szFacename;
+} // end of wxNativeFontInfo::GetFaceName
+
+wxFontFamily wxNativeFontInfo::GetFamily() const
+{
+ int nFamily;
+
+ //
+ // Extract family from facename
+ //
+ if (strcmp(fm.szFamilyname, "Times New Roman") == 0)
+ nFamily = wxROMAN;
+ else if (strcmp(fm.szFamilyname, "Times New Roman MT 30") == 0)
+ nFamily = wxROMAN;
+ else if (strcmp(fm.szFamilyname, "@Times New Roman MT 30") == 0)
+ nFamily = wxROMAN;
+ else if (strcmp(fm.szFamilyname, "Tms Rmn") == 0)
+ nFamily = wxROMAN;
+ else if (strcmp(fm.szFamilyname, "WarpSans") == 0)
+ nFamily = wxDECORATIVE;
+ else if (strcmp(fm.szFamilyname, "Helvetica") == 0)
+ nFamily = wxSWISS;
+ else if (strcmp(fm.szFamilyname, "Helv") == 0)
+ nFamily = wxSWISS;
+ else if (strcmp(fm.szFamilyname, "Script") == 0)
+ nFamily = wxSCRIPT;
+ else if (strcmp(fm.szFamilyname, "Courier New") == 0)
+ nFamily = wxTELETYPE;
+ else if (strcmp(fm.szFamilyname, "Courier") == 0)
+ nFamily = wxTELETYPE;
+ else if (strcmp(fm.szFamilyname, "System Monospaced") == 0)
+ nFamily = wxTELETYPE;
+ else if (strcmp(fm.szFamilyname, "System VIO") == 0)
+ nFamily = wxMODERN;
+ else if (strcmp(fm.szFamilyname, "System Proportional") == 0)
+ nFamily = wxMODERN;
+ else if (strcmp(fm.szFamilyname, "Arial") == 0)
+ nFamily = wxSWISS;
+ else if (strcmp(fm.szFamilyname, "Swiss") == 0)
+ nFamily = wxSWISS;
+ else
+ nFamily = wxSWISS;
+ return (wxFontFamily)nFamily;
+} // end of wxNativeFontInfo::GetFamily
+
+wxFontEncoding wxNativeFontInfo::GetEncoding() const
+{
+ return wxGetFontEncFromCharSet(fa.usCodePage);
+} // end of wxNativeFontInfo::GetEncoding
+
+void wxNativeFontInfo::SetPointSize(
+ int nPointsize
+)
+{
+ fm.lEmHeight = (LONG)nPointsize;
+} // end of wxNativeFontInfo::SetPointSize
+
+void wxNativeFontInfo::SetStyle(
+ wxFontStyle eStyle
+)
+{
+ switch (eStyle)
+ {
+ default:
+ wxFAIL_MSG( _T("unknown font style") );
+ // fall through
+
+ case wxFONTSTYLE_NORMAL:
+ break;
+
+ case wxFONTSTYLE_ITALIC:
+ case wxFONTSTYLE_SLANT:
+ fa.fsSelection |= FATTR_SEL_ITALIC;
+ break;
+ }
+} // end of wxNativeFontInfo::SetStyle
+
+void wxNativeFontInfo::SetWeight(
+ wxFontWeight eWeight
+)
+{
+ switch (eWeight)
+ {
+ default:
+ wxFAIL_MSG( _T("unknown font weight") );
+ // fall through
+
+ case wxFONTWEIGHT_NORMAL:
+ fn.usWeightClass = FWEIGHT_NORMAL;
+ break;
+
+ case wxFONTWEIGHT_LIGHT:
+ fn.usWeightClass = FWEIGHT_LIGHT;
+ break;
+
+ case wxFONTWEIGHT_BOLD:
+ fn.usWeightClass = FWEIGHT_BOLD;
+ break;
+ }
+} // end of wxNativeFontInfo::SetWeight
+
+void wxNativeFontInfo::SetUnderlined(
+ bool bUnderlined
+)
+{
+ if(bUnderlined)
+ fa.fsSelection |= FATTR_SEL_UNDERSCORE;
+} // end of wxNativeFontInfo::SetUnderlined
+
+void wxNativeFontInfo::SetFaceName(
+ wxString sFacename
+)
+{
+ wxStrncpy(fa.szFacename, sFacename, WXSIZEOF(fa.szFacename));
+} // end of wxNativeFontInfo::SetFaceName
+
+void wxNativeFontInfo::SetFamily(
+ wxFontFamily eFamily
+)
+{
+ wxString sFacename;
+
+ switch (eFamily)
+ {
+ case wxSCRIPT:
+ sFacename = wxT("Tms Rmn");
+ break;
+
+ case wxDECORATIVE:
+ sFacename = wxT("WarpSans");
+ break;
+
+ case wxROMAN:
+ sFacename = wxT("Tms Rmn");
+ break;
+
+ case wxTELETYPE:
+ sFacename = wxT("Courier") ;
+ break;
+
+ case wxMODERN:
+ sFacename = wxT("System VIO") ;
+ break;
+
+ case wxSWISS:
+ sFacename = wxT("Helv") ;
+ break;
+
+ case wxDEFAULT:
+ default:
+ sFacename = wxT("System VIO") ;
+ }
+
+ if (!wxStrlen(fa.szFacename) )