From: Stefan Csomor Date: Fri, 14 Mar 2008 10:34:25 +0000 (+0000) Subject: use the same font matching fallbacks for all layout operations X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/eb61203f6e97e735fcef2c197cecc83a00cf2c10 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 --- diff --git a/src/mac/carbon/graphics.cpp b/src/mac/carbon/graphics.cpp index 5b7e4d2fea..0b6b699b4a 100644 --- a/src/mac/carbon/graphics.cpp +++ b/src/mac/carbon/graphics.cpp @@ -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") ); + status = ::ATSUSetTransientFontMatching( atsuLayout , true ); + wxASSERT_MSG( status == noErr , wxT("couldn't setup transient font matching") ); + ATSUTextMeasurement textBefore, textAfter; ATSUTextMeasurement textAscent, textDescent; @@ -2131,14 +2134,20 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr #endif #if wxMAC_USE_ATSU_TEXT { + OSStatus status = noErr; ATSUTextLayout atsuLayout; wxMacUniCharBuffer unibuf( text ); UniCharCount chars = unibuf.GetChars(); 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 ); + + 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 ++ ) { unsigned long actualNumberOfBounds = 0;