Skip to content

Commit

Permalink
LibGfx: Add support for fonts that include the Hebrew Unicode Block
Browse files Browse the repository at this point in the history
  • Loading branch information
IdanHo authored and linusg committed Apr 18, 2021
1 parent 8d490ab commit f461ee7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Userland/Libraries/LibGfx/BitmapFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ RefPtr<BitmapFont> BitmapFont::load_from_memory(const u8* data)
type = FontTypes::LatinExtendedA;
else if (header.type == 2)
type = FontTypes::Cyrillic;
else if (header.type == 3)
type = FontTypes::Hebrew;
else
VERIFY_NOT_REACHED();

Expand All @@ -171,6 +173,9 @@ size_t BitmapFont::glyph_count_by_type(FontTypes type)
if (type == FontTypes::Cyrillic)
return 1280;

if (type == FontTypes::Hebrew)
return 1536;

dbgln("Unknown font type: {}", (int)type);
VERIFY_NOT_REACHED();
}
Expand All @@ -186,6 +191,9 @@ String BitmapFont::type_name_by_type(FontTypes type)
if (type == FontTypes::Cyrillic)
return "Cyrillic";

if (type == FontTypes::Hebrew)
return "Hebrew";

dbgln("Unknown font type: {}", (int)type);
VERIFY_NOT_REACHED();
}
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibGfx/BitmapFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum FontTypes {
Default = 0,
LatinExtendedA,
Cyrillic,
Hebrew,
__Count
};

Expand Down

0 comments on commit f461ee7

Please sign in to comment.