Multiply by a glyph-to-default rounded factor when resizing fonts
When matching to a default monospace width, big fonts like those containing symbols and emojis got too small from font resizing. Adding a glyph-to-default rounded factor to the calculation should fix that issue without losing monospatiality. Fixes pop-os/cosmic-term#69. Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This commit is contained in:
parent
6aadfaddac
commit
845a66ceff
1 changed files with 4 additions and 2 deletions
|
|
@ -1254,8 +1254,10 @@ impl ShapeLine {
|
|||
(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_to_match_factor = glyph_em_width / match_em_width;
|
||||
let glyph_font_size = glyph_to_match_factor.round().max(1.0)
|
||||
/ glyph_to_match_factor
|
||||
* font_size;
|
||||
log::trace!("Adjusted glyph font size ({font_size} => {glyph_font_size})");
|
||||
glyph_font_size
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue