long yy = YLOG2DEVMAC(y);
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
+ useDrawThemeText = false ;
#endif
MacInstallFont() ;
if ( 0 )
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&frame,
teJustLeft,
nil );
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&frame,
teJustLeft,
nil );
if ( theFont )
{
- wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
-
- if ( font )
- {
- ::TextFont( font->m_macFontNum ) ;
- ::TextSize( YLOG2DEVREL( font->m_macFontSize) ) ;
- ::TextFace( font->m_macFontStyle ) ;
- }
- }
- else
- {
- MacInstallFont() ;
+ // work around the constness
+ *((wxFont*)(&m_font)) = *theFont ;
}
+ MacInstallFont() ;
+
FontInfo fi ;
::GetFontInfo( &fi ) ;
+#if TARGET_CARBON
+ bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
+ useGetThemeText = false ;
+#endif
if ( height )
*height = YDEV2LOGREL( fi.descent + fi.ascent ) ;
{
if ( height )
*height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ;
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+#if TARGET_CARBON
+ if ( useGetThemeText )
+ {
+ Point bounds={0,0} ;
+ SInt16 baseline ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ CFRelease( mString ) ;
+ curwidth = bounds.h ;
+ }
+ else
+#endif
+ {
+ curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ }
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
laststop = i+1 ;
}
i++ ;
}
-
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+
+#if TARGET_CARBON
+ if ( useGetThemeText )
+ {
+ Point bounds={0,0} ;
+ SInt16 baseline ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ CFRelease( mString ) ;
+ curwidth = bounds.h ;
+ }
+ else
+#endif
+ {
+ curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ }
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
}
if ( theFont )
{
+ // work around the constness
+ *((wxFont*)(&m_font)) = formerFont ;
m_macFontInstalled = false ;
}
}