X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b7e6277be7c6dc21c62f3fa709bd0438df33175..823faac334c990b01975f8fcb91dc72595e6c42d:/src/mac/fontenum.cpp diff --git a/src/mac/fontenum.cpp b/src/mac/fontenum.cpp index 99cd68441a..467bc95442 100644 --- a/src/mac/fontenum.cpp +++ b/src/mac/fontenum.cpp @@ -33,8 +33,12 @@ #endif #include "wx/fontenum.h" +#include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/fontutil.h" +#include "wx/encinfo.h" + +#include "wx/mac/private.h" // ---------------------------------------------------------------------------- // private classes @@ -86,7 +90,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) wxNativeEncodingInfo info; if ( !wxGetNativeFontEncoding(encoding, &info) ) { - if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) + if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) { // no such encodings at all return FALSE; @@ -100,44 +104,46 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) void wxFontEnumeratorHelper::DoEnumerate() { - MenuHandle menu ; - Str255 name ; - short lines ; - - menu = NewMenu( 32000 , "\pFont" ) ; - AppendResMenu( menu , 'FONT' ) ; - lines = CountMenuItems( menu ) ; - - for ( int i = 1 ; i < lines+1 ; i ++ ) - { - GetMenuItemText( menu , i , name ) ; - p2cstr( name ) ; - /* - - if ( m_fixedOnly ) - { - // check that it's a fixed pitch font (there is *no* error here, the - // flag name is misleading!) - if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) - { - // not a fixed pitch font - return TRUE; - } - } - - if ( m_charset != -1 ) - { - // check that we have the right encoding - if ( lf->lfCharSet != m_charset ) - { - return TRUE; - } - } - - */ - m_fontEnum->OnFacename( name ) ; - } - DisposeMenu( menu ) ; + MenuHandle menu ; + Str255 p_name ; + + short lines ; + + menu = NewMenu( 32000 , "\pFont" ) ; + AppendResMenu( menu , 'FONT' ) ; + lines = CountMenuItems( menu ) ; + + for ( int i = 1 ; i < lines+1 ; i ++ ) + { + GetMenuItemText( menu , i , p_name ) ; + wxString c_name = wxMacMakeStringFromPascal(p_name) ; + + /* + + if ( m_fixedOnly ) + { + // check that it's a fixed pitch font (there is *no* error here, the + // flag name is misleading!) + if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) + { + // not a fixed pitch font + return TRUE; + } + } + + if ( m_charset != -1 ) + { + // check that we have the right encoding + if ( lf->lfCharSet != m_charset ) + { + return TRUE; + } + } + + */ + m_fontEnum->OnFacename( c_name ) ; + } + DisposeMenu( menu ) ; } // ---------------------------------------------------------------------------- @@ -161,7 +167,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { - wxFAIL_MSG(wxT("TODO")); + wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented")); return TRUE; }