X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8cde57b8367b4e853fbe45d88ee23cea4a301e9..f8c5636c42238296eb67bf73d1da3c5acb010fee:/src/os2/fontutil.cpp diff --git a/src/os2/fontutil.cpp b/src/os2/fontutil.cpp index d36dbb08f5..c5e987133b 100644 --- a/src/os2/fontutil.cpp +++ b/src/os2/fontutil.cpp @@ -8,6 +8,10 @@ // Copyright: (c) 1999 Vadim Zeitlin // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// +#define DEBUG_PRINTF(NAME) { static int raz=0; \ + printf( #NAME " %i\n",raz); fflush(stdout); \ + raz++; \ + } // ============================================================================ // declarations @@ -17,6 +21,10 @@ // headers // ---------------------------------------------------------------------------- +#ifdef __GNUG__ + #pragma implementation "fontutil.h" +#endif + // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -42,12 +50,18 @@ // ---------------------------------------------------------------------------- // convert to/from the string representation: format is -// facename[;charset] +// encodingid;facename[;charset] bool wxNativeEncodingInfo::FromString(const wxString& s) { wxStringTokenizer tokenizer(s, _T(";")); + wxString encid = tokenizer.GetNextToken(); + long enc; + if ( !encid.ToLong(&enc) ) + return FALSE; + encoding = (wxFontEncoding)enc; + facename = tokenizer.GetNextToken(); if ( !facename ) return FALSE; @@ -74,7 +88,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { - wxString s(facename); + wxString s; + + s << (long)encoding << _T(';') << facename; + // TODO: what is this for OS/2? /* if ( charset != ANSI_CHARSET ) @@ -321,6 +338,8 @@ void wxFillLogFont(LOGFONT *logFont, const wxFont *font) wxFont wxCreateFontFromLogFont(const LOGFONT *logFont) { +DEBUG_PRINTF(wxCreateFontFromLogFont) + // extract family from pitch-and-family int lfFamily = logFont->lfPitchAndFamily; if ( lfFamily & FIXED_PITCH )