From 52683eea90cef651608606abea3ce4769cba38ef Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 30 Aug 2026 17:03:50 +0700 Subject: [PATCH] [saco] Match `CUniBuffer::Analyse` with the masked-text branch and iCharset -1 --- saco/d3d9/common/DXUTgui.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/saco/d3d9/common/DXUTgui.cpp b/saco/d3d9/common/DXUTgui.cpp index d2253c8..417f70c 100644 --- a/saco/d3d9/common/DXUTgui.cpp +++ b/saco/d3d9/common/DXUTgui.cpp @@ -7529,11 +7529,14 @@ HRESULT CUniBuffer::Analyse() if( !m_pFontNode ) return E_FAIL; - HRESULT hr = _ScriptStringAnalyse( m_pFontNode->pFont ? m_pFontNode->pFont->GetDC() : NULL, + HRESULT hr; + if( !field_12 ) + { + hr = _ScriptStringAnalyse( m_pFontNode->pFont ? m_pFontNode->pFont->GetDC() : NULL, m_pwszBuffer, lstrlenW( m_pwszBuffer ) + 1, // NULL is also analyzed. lstrlenW( m_pwszBuffer ) * 3 / 2 + 16, - DEFAULT_CHARSET, + -1, SSA_BREAK | SSA_GLYPHS | SSA_FALLBACK | SSA_LINK, 0, &ScriptControl, @@ -7542,6 +7545,23 @@ HRESULT CUniBuffer::Analyse() NULL, NULL, &m_Analysis ); + } + else + { + hr = _ScriptStringAnalyse( m_pFontNode->pFont ? m_pFontNode->pFont->GetDC() : NULL, + MaskText( m_pwszBuffer ), + lstrlenW( MaskText( m_pwszBuffer ) ) + 1, // NULL is also analyzed. + lstrlenW( MaskText( m_pwszBuffer ) ) * 3 / 2 + 16, + -1, + SSA_BREAK | SSA_GLYPHS | SSA_FALLBACK | SSA_LINK, + 0, + &ScriptControl, + &ScriptState, + NULL, + NULL, + NULL, + &m_Analysis ); + } if( SUCCEEDED( hr ) ) m_bAnalyseRequired = false; // Analysis is up-to-date return hr;