+ if (tmp == wxT("LIGHT")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
+ if (tmp == wxT("THIN")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
+
+ tmp = tn.GetNextToken().MakeUpper(); // slant
+ if (tmp == wxT("I")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
+ if (tmp == wxT("O")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
+
+ tn.GetNextToken(); // set width
+ tn.GetNextToken(); // add. style
+ tn.GetNextToken(); // pixel size
+
+ tmp = tn.GetNextToken(); // pointsize
+ if (tmp != wxT("*"))
+ {
+ long num = wxStrtol (tmp.mb_str(), (wxChar **) NULL, 10);
+ M_FONTDATA->m_pointSize = (int)(num / 10);
+ }
+
+ tn.GetNextToken(); // x-res
+ tn.GetNextToken(); // y-res
+
+ tmp = tn.GetNextToken().MakeUpper(); // spacing
+
+ if (tmp == wxT("M"))
+ M_FONTDATA->m_family = wxFONTFAMILY_MODERN;
+ else if (M_FONTDATA->m_faceName == wxT("TIMES"))
+ M_FONTDATA->m_family = wxFONTFAMILY_ROMAN;
+ else if (M_FONTDATA->m_faceName == wxT("HELVETICA"))
+ M_FONTDATA->m_family = wxFONTFAMILY_SWISS;
+ else if (M_FONTDATA->m_faceName == wxT("LUCIDATYPEWRITER"))
+ M_FONTDATA->m_family = wxFONTFAMILY_TELETYPE;
+ else if (M_FONTDATA->m_faceName == wxT("LUCIDA"))
+ M_FONTDATA->m_family = wxFONTFAMILY_DECORATIVE;
+ else if (M_FONTDATA->m_faceName == wxT("UTOPIA"))
+ M_FONTDATA->m_family = wxFONTFAMILY_SCRIPT;
+
+ tn.GetNextToken(); // avg width
+
+ // deal with font encoding
+ M_FONTDATA->m_encoding = enc;
+ if ( M_FONTDATA->m_encoding == wxFONTENCODING_SYSTEM )
+ {
+ wxString registry = tn.GetNextToken().MakeUpper(),
+ encoding = tn.GetNextToken().MakeUpper();
+
+ if ( registry == wxT("ISO8859") )
+ {
+ int cp;
+ if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 )
+ {
+ M_FONTDATA->m_encoding =
+ (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1);
+ }
+ }
+ else if ( registry == wxT("MICROSOFT") )
+ {
+ int cp;
+ if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 )
+ {
+ M_FONTDATA->m_encoding =
+ (wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
+ }
+ }
+ else if ( registry == wxT("KOI8") )
+ {
+ M_FONTDATA->m_encoding = wxFONTENCODING_KOI8;
+ }
+ //else: unknown encoding - may be give a warning here?
+ else
+ return false;
+ }
+ return true;