This commit is contained in:
Jeremy Soller 2024-01-17 13:26:39 -07:00
parent 329941c4a6
commit a11f68f13d
6 changed files with 66 additions and 26 deletions

View file

@ -1247,12 +1247,18 @@ impl ShapeLine {
let match_mono_em_width = match_mono_width.map(|w| w / font_size);
for glyph in included_glyphs {
let glyph_font_size = match(match_mono_em_width, glyph.font_monospace_em_width) {
(Some(match_em_width), Some(glyph_em_width)) if glyph_em_width != match_em_width => {
let glyph_font_size = font_size * (match_em_width / glyph_em_width);
let glyph_font_size = match (
match_mono_em_width,
glyph.font_monospace_em_width,
) {
(Some(match_em_width), Some(glyph_em_width))
if glyph_em_width != match_em_width =>
{
let glyph_font_size =
font_size * (match_em_width / glyph_em_width);
log::trace!("Adjusted glyph font size ({font_size} => {glyph_font_size})");
glyph_font_size
},
}
_ => font_size,
};