From feda3e209cd687b1a8428d87c563ed72c0e20e8e Mon Sep 17 00:00:00 2001 From: sdottaka Date: Thu, 14 Nov 2024 08:25:12 +0900 Subject: [PATCH] Fix issue #2525: Diff renders incorrectly with "Cascadia Mono" variant (2) --- .../editlib/renderers/ccrystalrendererdirectwrite.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp b/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp index a4d29ab66fc..f08694c08c3 100644 --- a/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp +++ b/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp @@ -335,7 +335,6 @@ static void GetFontFamilyNameFromFont(IDWriteFont* pFont, wchar_t* fontFamilyNam static DWRITE_FONT_WEIGHT GetDWriteFontWeight(const LOGFONT& lf, bool bold) { - DWRITE_FONT_WEIGHT result; const long weight = bold ? (lf.lfWeight + 300) : lf.lfWeight; if (weight <= 100) return DWRITE_FONT_WEIGHT_THIN; else if (weight <= 200) return DWRITE_FONT_WEIGHT_EXTRA_LIGHT; @@ -373,7 +372,7 @@ void CCrystalRendererDirectWrite::SetFont(const LOGFONT &lf) } m_pCurrentTextFormat = m_pTextFormat[0].get(); m_pFont.reset(); - m_charSize = ::GetCharWidthHeight(m_pTextFormat[0]->Get()); + m_charSize = ::GetCharWidthHeight(m_pTextFormat[3]->Get()); } void CCrystalRendererDirectWrite::SwitchFont(bool italic, bool bold)