From 7d08116a6dd42b5d934ffab90a1d42507f136fee Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 4 Aug 2019 08:14:53 +0200 Subject: [PATCH] LibDraw: Add Font::default_bold_fixed_width_font() We need a way to get a bold version of the default fixed-width font. --- Libraries/LibDraw/Font.cpp | 11 +++++++++++ Libraries/LibDraw/Font.h | 1 + 2 files changed, 12 insertions(+) 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 clone() const;