summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/AboutDialog.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Button.cpp2
-rw-r--r--Userland/Libraries/LibGUI/HeaderView.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Wizards/WizardPage.cpp6
-rw-r--r--Userland/Libraries/LibGfx/ClassicWindowTheme.cpp12
-rw-r--r--Userland/Libraries/LibGfx/FontDatabase.cpp10
-rw-r--r--Userland/Libraries/LibGfx/FontDatabase.h1
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp2
8 files changed, 13 insertions, 24 deletions
diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp
index fcac58c045..f0118e667d 100644
--- a/Userland/Libraries/LibGUI/AboutDialog.cpp
+++ b/Userland/Libraries/LibGUI/AboutDialog.cpp
@@ -63,7 +63,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
label.set_fixed_height(14);
if (bold)
- label.set_font(Gfx::FontDatabase::default_bold_font());
+ label.set_font(Gfx::FontDatabase::default_font().bold_variant());
};
make_label(m_name, true);
// If we are displaying a dialog for an application, insert 'SerenityOS' below the application name
diff --git a/Userland/Libraries/LibGUI/Button.cpp b/Userland/Libraries/LibGUI/Button.cpp
index 7b7aa662c4..107eaccbe5 100644
--- a/Userland/Libraries/LibGUI/Button.cpp
+++ b/Userland/Libraries/LibGUI/Button.cpp
@@ -75,7 +75,7 @@ void Button::paint_event(PaintEvent& event)
painter.blit_disabled(icon_location, *m_icon, m_icon->rect(), palette());
}
}
- auto& font = is_checked() ? Gfx::FontDatabase::default_bold_font() : this->font();
+ auto& font = is_checked() ? this->font().bold_variant() : this->font();
if (m_icon && !text().is_empty()) {
content_rect.translate_by(m_icon->width() + icon_spacing(), 0);
content_rect.set_width(content_rect.width() - m_icon->width() - icon_spacing());
diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp
index cb9fe2d202..db0f704bee 100644
--- a/Userland/Libraries/LibGUI/HeaderView.cpp
+++ b/Userland/Libraries/LibGUI/HeaderView.cpp
@@ -23,7 +23,7 @@ HeaderView::HeaderView(AbstractTableView& table_view, Gfx::Orientation orientati
: m_table_view(table_view)
, m_orientation(orientation)
{
- set_font(Gfx::FontDatabase::default_bold_font());
+ set_font(Gfx::FontDatabase::default_font().bold_variant());
if (m_orientation == Gfx::Orientation::Horizontal) {
set_fixed_height(16);
diff --git a/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
index 7ea3be7c70..5ab950bf83 100644
--- a/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
+++ b/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
@@ -28,12 +28,12 @@ WizardPage::WizardPage(const String& title_text, const String& subtitle_text)
header_widget.set_layout<VerticalBoxLayout>();
header_widget.layout()->set_margins({ 30, 15, 30, 0 });
m_title_label = header_widget.add<Label>(title_text);
- m_title_label->set_font(Gfx::FontDatabase::the().default_bold_font());
- m_title_label->set_fixed_height(Gfx::FontDatabase::the().default_bold_font().glyph_height() + 2);
+ m_title_label->set_font(Gfx::FontDatabase::default_font().bold_variant());
+ m_title_label->set_fixed_height(m_title_label->font().glyph_height() + 2);
m_title_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
m_subtitle_label = header_widget.add<Label>(subtitle_text);
m_subtitle_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
- m_title_label->set_fixed_height(Gfx::FontDatabase::the().default_font().glyph_height());
+ m_subtitle_label->set_fixed_height(m_subtitle_label->font().glyph_height());
header_widget.layout()->add_spacer();
auto& separator = add<SeparatorWidget>(Gfx::Orientation::Horizontal);
diff --git a/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp b/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
index e8aa426847..185013767d 100644
--- a/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
+++ b/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
@@ -58,13 +58,13 @@ void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window
frame_rect.set_location({ 0, 0 });
Gfx::StylePainter::paint_window_frame(painter, frame_rect, palette);
- auto& title_font = FontDatabase::default_bold_font();
+ auto& title_font = FontDatabase::default_font().bold_variant();
auto titlebar_rect = this->titlebar_rect(WindowType::Normal, window_rect, palette);
auto titlebar_icon_rect = this->titlebar_icon_rect(WindowType::Normal, window_rect, palette);
auto titlebar_inner_rect = titlebar_text_rect(WindowType::Normal, window_rect, palette);
auto titlebar_title_rect = titlebar_inner_rect;
- titlebar_title_rect.set_width(FontDatabase::default_bold_font().width(window_title));
+ titlebar_title_rect.set_width(title_font.width(window_title));
auto [title_color, border_color, border_color2, stripes_color, shadow_color] = compute_frame_colors(window_state, palette);
@@ -100,12 +100,12 @@ void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState w
frame_rect.set_location({ 0, 0 });
Gfx::StylePainter::paint_window_frame(painter, frame_rect, palette);
- auto& title_font = FontDatabase::default_bold_font();
+ auto& title_font = FontDatabase::default_font().bold_variant();
auto titlebar_rect = this->titlebar_rect(WindowType::ToolWindow, window_rect, palette);
auto titlebar_inner_rect = titlebar_text_rect(WindowType::ToolWindow, window_rect, palette);
auto titlebar_title_rect = titlebar_inner_rect;
- titlebar_title_rect.set_width(FontDatabase::default_bold_font().width(title_text));
+ titlebar_title_rect.set_width(title_font.width(title_text));
auto [title_color, border_color, border_color2, stripes_color, shadow_color] = compute_frame_colors(window_state, palette);
@@ -134,7 +134,7 @@ IntRect ClassicWindowTheme::menubar_rect(WindowType window_type, const IntRect&
IntRect ClassicWindowTheme::titlebar_rect(WindowType window_type, const IntRect& window_rect, const Palette& palette) const
{
- auto& title_font = FontDatabase::default_bold_font();
+ auto& title_font = FontDatabase::default_font().bold_variant();
auto window_titlebar_height = titlebar_height(window_type, palette);
// FIXME: The top of the titlebar doesn't get redrawn properly if this padding is different
int total_vertical_padding = title_font.glyph_height() - 1;
@@ -235,7 +235,7 @@ Vector<IntRect> ClassicWindowTheme::layout_buttons(WindowType window_type, const
int ClassicWindowTheme::titlebar_height(WindowType window_type, const Palette& palette) const
{
- auto& title_font = FontDatabase::default_bold_font();
+ auto& title_font = FontDatabase::default_font().bold_variant();
switch (window_type) {
case WindowType::Normal:
case WindowType::Notification:
diff --git a/Userland/Libraries/LibGfx/FontDatabase.cpp b/Userland/Libraries/LibGfx/FontDatabase.cpp
index 44b934d109..b71bc61c01 100644
--- a/Userland/Libraries/LibGfx/FontDatabase.cpp
+++ b/Userland/Libraries/LibGfx/FontDatabase.cpp
@@ -54,16 +54,6 @@ Font& FontDatabase::default_bold_fixed_width_font()
return *font;
}
-Font& FontDatabase::default_bold_font()
-{
- static Font* font;
- if (!font) {
- font = FontDatabase::the().get_by_name("Katica 10 700");
- VERIFY(font);
- }
- return *font;
-}
-
struct FontDatabase::Private {
HashMap<String, RefPtr<Gfx::Font>> full_name_to_font_map;
Vector<RefPtr<Typeface>> typefaces;
diff --git a/Userland/Libraries/LibGfx/FontDatabase.h b/Userland/Libraries/LibGfx/FontDatabase.h
index 30e239784f..64b029dd90 100644
--- a/Userland/Libraries/LibGfx/FontDatabase.h
+++ b/Userland/Libraries/LibGfx/FontDatabase.h
@@ -35,7 +35,6 @@ public:
static FontDatabase& the();
static Font& default_font();
- static Font& default_bold_font();
static Font& default_fixed_width_font();
static Font& default_bold_fixed_width_font();
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
index 01bf6b4d68..5fa06a9b31 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
@@ -200,7 +200,7 @@ RefPtr<Gfx::Font> StyleProperties::font_fallback(bool monospace, bool bold) cons
return Gfx::FontDatabase::default_fixed_width_font();
if (bold)
- return Gfx::FontDatabase::default_bold_font();
+ return Gfx::FontDatabase::default_font().bold_variant();
return Gfx::FontDatabase::default_font();
}