diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-04 08:14:53 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-04 08:14:53 +0200 |
commit | 7d08116a6dd42b5d934ffab90a1d42507f136fee (patch) | |
tree | 3328f6ddeb4a51812e06c449fb4fa5671240e173 /Libraries | |
parent | 116d551f823fdd8e6d3e334987ba9701a900e47a (diff) | |
download | serenity-7d08116a6dd42b5d934ffab90a1d42507f136fee.zip |
LibDraw: Add Font::default_bold_fixed_width_font()
We need a way to get a bold version of the default fixed-width font.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibDraw/Font.cpp | 11 | ||||
-rw-r--r-- | Libraries/LibDraw/Font.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Libraries/LibDraw/Font.cpp b/Libraries/LibDraw/Font.cpp index b46495ad3b..755400ab32 100644 --- a/Libraries/LibDraw/Font.cpp +++ b/Libraries/LibDraw/Font.cpp @@ -42,6 +42,17 @@ Font& Font::default_fixed_width_font() return *s_default_fixed_width_font; } +Font& Font::default_bold_fixed_width_font() +{ + static Font* font; + static const char* default_bold_fixed_width_font_path = "/res/fonts/CsillaBold7x10.font"; + if (!font) { + font = Font::load_from_file(default_bold_fixed_width_font_path).leak_ref(); + ASSERT(font); + } + return *font; +} + Font& Font::default_bold_font() { static Font* s_default_bold_font; diff --git a/Libraries/LibDraw/Font.h b/Libraries/LibDraw/Font.h index 3bda812159..bdc2e05846 100644 --- a/Libraries/LibDraw/Font.h +++ b/Libraries/LibDraw/Font.h @@ -46,6 +46,7 @@ public: static Font& default_bold_font(); static Font& default_fixed_width_font(); + static Font& default_bold_fixed_width_font(); RefPtr<Font> clone() const; |