diff --git a/Ladybird/FontPluginQt.cpp b/Ladybird/FontPluginQt.cpp index e6babcbe39..7242b15061 100644 --- a/Ladybird/FontPluginQt.cpp +++ b/Ladybird/FontPluginQt.cpp @@ -34,11 +34,11 @@ FontPluginQt::FontPluginQt() update_generic_fonts(); auto default_font_name = generic_font_name(Web::Platform::GenericFont::UiSansSerif); - m_default_font = Gfx::FontDatabase::the().get(default_font_name, 12.0, 400, 0); + m_default_font = Gfx::FontDatabase::the().get(default_font_name, 12.0, 400, Gfx::FontWidth::Normal, 0); VERIFY(m_default_font); auto default_fixed_width_font_name = generic_font_name(Web::Platform::GenericFont::UiMonospace); - m_default_fixed_width_font = Gfx::FontDatabase::the().get(default_fixed_width_font_name, 12.0, 400, 0); + m_default_fixed_width_font = Gfx::FontDatabase::the().get(default_fixed_width_font_name, 12.0, 400, Gfx::FontWidth::Normal, 0); VERIFY(m_default_fixed_width_font); } @@ -73,10 +73,10 @@ void FontPluginQt::update_generic_fonts() QFontInfo qt_info(qt_font); auto qt_font_family = qt_info.family(); - auto gfx_font = Gfx::FontDatabase::the().get(qt_font_family.toUtf8().data(), 16, 400, 0, Gfx::Font::AllowInexactSizeMatch::Yes); + auto gfx_font = Gfx::FontDatabase::the().get(qt_font_family.toUtf8().data(), 16, 400, Gfx::FontWidth::Normal, 0, Gfx::Font::AllowInexactSizeMatch::Yes); if (!gfx_font) { for (auto& fallback : fallbacks) { - gfx_font = Gfx::FontDatabase::the().get(fallback, 16, 400, 0, Gfx::Font::AllowInexactSizeMatch::Yes); + gfx_font = Gfx::FontDatabase::the().get(fallback, 16, 400, Gfx::FontWidth::Normal, 0, Gfx::Font::AllowInexactSizeMatch::Yes); if (gfx_font) break; } diff --git a/Tests/LibGfx/TestFontHandling.cpp b/Tests/LibGfx/TestFontHandling.cpp index ac560b0940..1aa905c3a5 100644 --- a/Tests/LibGfx/TestFontHandling.cpp +++ b/Tests/LibGfx/TestFontHandling.cpp @@ -31,7 +31,7 @@ TEST_CASE(test_fontdatabase_get) { Gfx::FontDatabase::set_default_fonts_lookup_path(TEST_INPUT("")); auto& font_database = Gfx::FontDatabase::the(); - EXPECT(!font_database.get("Family", 12, 400, 0)->name().is_null()); + EXPECT(!font_database.get("Family", 12, 400, Gfx::FontWidth::Normal, 0)->name().is_null()); } TEST_CASE(test_fontdatabase_for_each_font) diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 95efadf587..6414a3e23f 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -409,7 +409,7 @@ ErrorOr 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()); diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 47f7907a5d..a2324ba4e1 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -638,7 +638,7 @@ void TextEditor::paint_event(PaintEvent& event) } auto font = unspanned_font; if (span.attributes.bold) { - if (auto bold_font = Gfx::FontDatabase::the().get(font->family(), font->presentation_size(), 700, 0)) + if (auto bold_font = Gfx::FontDatabase::the().get(font->family(), font->presentation_size(), 700, font->width(), 0)) font = bold_font; } draw_text_helper(span_start, span_end, font, span.attributes); diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index ce0d6c1b90..0b0f5c6e37 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -815,25 +815,25 @@ void Widget::set_font(Gfx::Font const* font) void Widget::set_font_family(DeprecatedString const& family) { - set_font(Gfx::FontDatabase::the().get(family, m_font->presentation_size(), m_font->weight(), m_font->slope())); + set_font(Gfx::FontDatabase::the().get(family, m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope())); } void Widget::set_font_size(unsigned size) { - set_font(Gfx::FontDatabase::the().get(m_font->family(), size, m_font->weight(), m_font->slope())); + set_font(Gfx::FontDatabase::the().get(m_font->family(), size, m_font->weight(), m_font->width(), m_font->slope())); } void Widget::set_font_weight(unsigned weight) { - set_font(Gfx::FontDatabase::the().get(m_font->family(), m_font->presentation_size(), weight, m_font->slope())); + set_font(Gfx::FontDatabase::the().get(m_font->family(), m_font->presentation_size(), weight, m_font->width(), m_font->slope())); } void Widget::set_font_fixed_width(bool fixed_width) { if (fixed_width) - set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family(), m_font->presentation_size(), m_font->weight(), m_font->slope())); + set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope())); else - set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->slope())); + set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope())); } void Widget::set_min_size(UISize const& size) diff --git a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp index 6db5600051..338ba3e27c 100644 --- a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp +++ b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp @@ -28,7 +28,7 @@ CoverWizardPage::CoverWizardPage() m_content_widget->layout()->set_margins(20); m_header_label = m_content_widget->add