mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 19:45:10 +00:00
LibGFX: Move default_xxx_font() methods from Font to FontDatabase
When we have an abstract font class it makes no sense to keep these methods in the Font class.
This commit is contained in:
parent
1a072a61fb
commit
b4d1390714
48 changed files with 152 additions and 115 deletions
|
@ -44,6 +44,46 @@ FontDatabase& FontDatabase::the()
|
|||
return *s_the;
|
||||
}
|
||||
|
||||
Font& FontDatabase::default_font()
|
||||
{
|
||||
static Font* font;
|
||||
if (!font) {
|
||||
font = FontDatabase::the().get_by_name("Katica 10 400");
|
||||
ASSERT(font);
|
||||
}
|
||||
return *font;
|
||||
}
|
||||
|
||||
Font& FontDatabase::default_fixed_width_font()
|
||||
{
|
||||
static Font* font;
|
||||
if (!font) {
|
||||
font = FontDatabase::the().get_by_name("Csilla 10 400");
|
||||
ASSERT(font);
|
||||
}
|
||||
return *font;
|
||||
}
|
||||
|
||||
Font& FontDatabase::default_bold_fixed_width_font()
|
||||
{
|
||||
static Font* font;
|
||||
if (!font) {
|
||||
font = FontDatabase::the().get_by_name("Csilla 10 700");
|
||||
ASSERT(font);
|
||||
}
|
||||
return *font;
|
||||
}
|
||||
|
||||
Font& FontDatabase::default_bold_font()
|
||||
{
|
||||
static Font* font;
|
||||
if (!font) {
|
||||
font = FontDatabase::the().get_by_name("Katica 10 700");
|
||||
ASSERT(font);
|
||||
}
|
||||
return *font;
|
||||
}
|
||||
|
||||
struct FontDatabase::Private {
|
||||
HashMap<String, RefPtr<Gfx::Font>> full_name_to_font_map;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue