summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-04 08:14:53 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-04 08:14:53 +0200
commit7d08116a6dd42b5d934ffab90a1d42507f136fee (patch)
tree3328f6ddeb4a51812e06c449fb4fa5671240e173 /Libraries
parent116d551f823fdd8e6d3e334987ba9701a900e47a (diff)
downloadserenity-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.cpp11
-rw-r--r--Libraries/LibDraw/Font.h1
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;