- //
- // Extract family from facename
- //
- int nFontFamily;
-
- if (strcmp(pLogFont->szFacename, "Times New Roman") == 0)
- nFontFamily = wxROMAN;
- else if (strcmp(pLogFont->szFacename, "WarpSans") == 0)
- nFontFamily = wxSWISS;
- else if (strcmp(pLogFont->szFacename, "Script") == 0)
- nFontFamily = wxSCRIPT;
- else if (strcmp(pLogFont->szFacename, "Courier New") == 0)
- nFontFamily = wxMODERN;
- else
- nFontFamily = wxSWISS;
-
- //
- // Weight and Style
- //
- int nFontWeight = wxNORMAL;
-
- switch (pFaceName->usWeightClass)
- {
- case FWEIGHT_LIGHT:
- nFontWeight = wxLIGHT;
- break;
-
- default:
- case FWEIGHT_NORMAL:
- nFontWeight = wxNORMAL;
- break;
-
- case FWEIGHT_BOLD:
- nFontWeight = wxBOLD;
- break;
- }
-
- int nFontStyle;
-
- if(pLogFont->fsSelection & FATTR_SEL_ITALIC)
- nFontStyle = wxITALIC;
- else
- nFontStyle = wxNORMAL;
-
- bool bFontUnderline = (pLogFont->fsSelection & FATTR_SEL_UNDERSCORE);
- wxString sFontFace = pLogFont->szFacename;
- int nFontPoints = pFM->lEmHeight;
- wxFontEncoding vFontEncoding;
-
- switch (pLogFont->usCodePage)
- {
- default:
- wxFAIL_MSG(wxT("unsupported charset"));
- // fall through
-
- case 850:
- vFontEncoding = wxFONTENCODING_CP1252;
- break;
-
- case 1250:
- vFontEncoding = wxFONTENCODING_CP1250;
- break;
-
- case 921:
- vFontEncoding = wxFONTENCODING_CP1257;
- break;
-
- case 866:
- vFontEncoding = wxFONTENCODING_CP1251;
- break;
-
- case 864:
- vFontEncoding = wxFONTENCODING_CP1256;
- break;
-
- case 869:
- vFontEncoding = wxFONTENCODING_CP1253;
- break;
-
- case 862:
- vFontEncoding = wxFONTENCODING_CP1255;
- break;
-
- case 857:
- vFontEncoding = wxFONTENCODING_CP1254;
- break;
-
- case 874:
- vFontEncoding = wxFONTENCODING_CP437;
- break;
-
- case 437:
- vFontEncoding = wxFONTENCODING_CP437;
- break;
- }