mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:17:35 +00:00
WindowServer: Pick font with glyphs for digits for ScreenNumberOverlay
We want to make sure we pick a font that has at least glyphs defined for all the digits that we may need to display.
This commit is contained in:
parent
bd9c4a6de5
commit
a9ec0c30eb
1 changed files with 6 additions and 0 deletions
|
@ -178,6 +178,12 @@ void ScreenNumberOverlay::pick_font()
|
|||
// with default_font.name(). But the default font currently does not provide larger sizes
|
||||
auto size = font.glyph_height();
|
||||
if (size * 2 <= screen_number_content_rect_size.height() && size > best_font_size) {
|
||||
for (unsigned ch = '0'; ch <= '9'; ch++) {
|
||||
if (!font.contains_glyph(ch)) {
|
||||
// Skip this font, it doesn't have glyphs for digits
|
||||
return;
|
||||
}
|
||||
}
|
||||
best_font_name = font.qualified_name();
|
||||
best_font_size = size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue