diff options
author | Andreas Kling <kling@serenityos.org> | 2020-10-25 19:28:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-25 21:18:18 +0100 |
commit | 9d347352a1a6c47867bc8340a13d69c8272952d9 (patch) | |
tree | dc1015117b75cf743581217624bae31a2c6bc2bd /Libraries/LibVT | |
parent | 260b52215cbfc3be760e829c75ffe3aec53465bc (diff) | |
download | serenity-9d347352a1a6c47867bc8340a13d69c8272952d9.zip |
LibGfx+LibGUI+Clients: Make fonts findable by their qualified name
The qualified name of a font is "<Family> <Size> <Weight>". You can
get the QN of a Font via the Font::qualified_name() API, and you can
get any system font by QN from the GUI::FontDatabase. :^)
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r-- | Libraries/LibVT/TerminalWidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index ba13e61037..fa7d3f8f8a 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -39,6 +39,7 @@ #include <LibGUI/Application.h> #include <LibGUI/Clipboard.h> #include <LibGUI/DragOperation.h> +#include <LibGUI/FontDatabase.h> #include <LibGUI/Menu.h> #include <LibGUI/Painter.h> #include <LibGUI/ScrollBar.h> @@ -121,7 +122,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co if (font_entry == "default") set_font(Gfx::Font::default_fixed_width_font()); else - set_font(Gfx::Font::load_from_file(font_entry)); + set_font(GUI::FontDatabase::the().get_by_name(font_entry)); m_line_height = font().glyph_height() + m_line_spacing; |