mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibGfx: Add a count to FontTypes and a helper to return type names
This commit is contained in:
parent
25bd4b33a7
commit
c283429196
2 changed files with 23 additions and 5 deletions
|
@ -175,6 +175,21 @@ size_t BitmapFont::glyph_count_by_type(FontTypes type)
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
String BitmapFont::type_name_by_type(FontTypes type)
|
||||
{
|
||||
if (type == FontTypes::Default)
|
||||
return "Default";
|
||||
|
||||
if (type == FontTypes::LatinExtendedA)
|
||||
return "LatinExtendedA";
|
||||
|
||||
if (type == FontTypes::Cyrillic)
|
||||
return "Cyrillic";
|
||||
|
||||
dbgln("Unknown font type: {}", (int)type);
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
RefPtr<BitmapFont> BitmapFont::load_from_file(const StringView& path)
|
||||
{
|
||||
if (Core::File::is_device(path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue