use the same font matching fallbacks for all layout operations

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-03-14 10:34:25 +00:00
parent 7baebf867b
commit eb61203f6e

View File

@@ -2074,6 +2074,9 @@ void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *wid
wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the text") ); wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the text") );
status = ::ATSUSetTransientFontMatching( atsuLayout , true );
wxASSERT_MSG( status == noErr , wxT("couldn't setup transient font matching") );
ATSUTextMeasurement textBefore, textAfter; ATSUTextMeasurement textBefore, textAfter;
ATSUTextMeasurement textAscent, textDescent; ATSUTextMeasurement textAscent, textDescent;
@@ -2131,14 +2134,20 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr
#endif #endif
#if wxMAC_USE_ATSU_TEXT #if wxMAC_USE_ATSU_TEXT
{ {
OSStatus status = noErr;
ATSUTextLayout atsuLayout; ATSUTextLayout atsuLayout;
wxMacUniCharBuffer unibuf( text ); wxMacUniCharBuffer unibuf( text );
UniCharCount chars = unibuf.GetChars(); UniCharCount chars = unibuf.GetChars();
ATSUStyle style = (((wxMacCoreGraphicsFontData*)m_font.GetRefData())->GetATSUStyle()); ATSUStyle style = (((wxMacCoreGraphicsFontData*)m_font.GetRefData())->GetATSUStyle());
::ATSUCreateTextLayoutWithTextPtr( unibuf.GetBuffer() , 0 , chars , chars , 1 , status = ::ATSUCreateTextLayoutWithTextPtr( unibuf.GetBuffer() , 0 , chars , chars , 1 ,
&chars , &style , &atsuLayout ); &chars , &style , &atsuLayout );
wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the text") );
status = ::ATSUSetTransientFontMatching( atsuLayout , true );
wxASSERT_MSG( status == noErr , wxT("couldn't setup transient font matching") );
for ( int pos = 0; pos < (int)chars; pos ++ ) for ( int pos = 0; pos < (int)chars; pos ++ )
{ {
unsigned long actualNumberOfBounds = 0; unsigned long actualNumberOfBounds = 0;