Skip to content

Commit

Permalink
Fix issue #2525: Diff renders incorrectly with "Cascadia Mono" varian…
Browse files Browse the repository at this point in the history
…t (2)
  • Loading branch information
sdottaka committed Nov 13, 2024
1 parent 9ef4cb2 commit feda3e2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit feda3e2

Please sign in to comment.