From 0d3c6e6983a63a1aa1fc680c4b1328e1836986ef Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 14 Mar 2008 10:33:09 +0000 Subject: [PATCH] use the same font matching fallbacks for all layout operations git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/graphics.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/graphics.cpp b/src/mac/carbon/graphics.cpp index 9cc4671ff9..e7c8e6110d 100755 --- a/src/mac/carbon/graphics.cpp +++ b/src/mac/carbon/graphics.cpp @@ -1908,6 +1908,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; @@ -1940,6 +1943,7 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr ATSUTextLayout atsuLayout; UniCharCount chars = text.length(); UniChar* ubuf = NULL; + OSStatus status = noErr; #if SIZEOF_WCHAR_T == 4 wxMBConvUTF16 converter; @@ -1965,8 +1969,12 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr #endif ATSUStyle style = (((wxMacCoreGraphicsFontData*)m_font.GetRefData())->GetATSUStyle()); - ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 0 , chars , chars , 1 , + status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 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 ++ ) {