1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +00:00

LibGfx: Pass font width to FontDatabase::get()

Width need to be passed to `FontDatabase::get()` to resolve font name
unambiguously.
This commit is contained in:
Aliaksandr Kalenik 2023-02-04 23:00:34 +03:00 committed by Sam Atkins
parent 79006c03b4
commit 1f4106842d
21 changed files with 71 additions and 21 deletions

View file

@ -409,7 +409,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto adjust_font_size = [&](float adjustment) {
auto& font = terminal->font();
auto new_size = max(5, font.presentation_size() + adjustment);
if (auto new_font = Gfx::FontDatabase::the().get(font.family(), new_size, font.weight(), font.slope())) {
if (auto new_font = Gfx::FontDatabase::the().get(font.family(), new_size, font.weight(), font.width(), font.slope())) {
terminal->set_font_and_resize_to_fit(*new_font);
terminal->apply_size_increments_to_window(*window);
window->resize(terminal->size());