Skip to content

Commit

Permalink
Dont abort if scaling is too small and we cant reduce font size enough
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Feb 19, 2025
1 parent 2907999 commit f585175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kitty/fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,11 @@ apply_scale_to_font_group(FontGroup *fg, RunFont *rf) {
float wfrac = (float)copy.fcm.cell_width / scaled_cell_width, hfrac = (float)copy.fcm.cell_height / scaled_cell_height;
float frac = MIN(wfrac, hfrac);
copy.font_sz_in_pts *= frac;
while(true) {
while (true) {
apply_scaling(&copy);
calc_cell_metrics(&copy, medium_font->face);
if (copy.fcm.cell_width <= scaled_cell_width && copy.fcm.cell_height <= scaled_cell_height) break;
if (copy.font_sz_in_pts < 1) fatal("Could not apply scale of %f to font group as font size (%f) is less than minimum threshold", scale, copy.font_sz_in_pts);
if (copy.font_sz_in_pts <= 1) break;
copy.font_sz_in_pts -= 0.1;
}
}
Expand Down

0 comments on commit f585175

Please sign in to comment.