From eb61203f6e97e735fcef2c197cecc83a00cf2c10 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 14 Mar 2008 10:34:25 +0000 Subject: [PATCH] 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 --- src/mac/carbon/graphics.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.50.0