summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-18 14:20:03 +0300
committerLinus Groh <mail@linusgroh.de>2021-04-18 18:57:35 +0200
commitf461ee7d01d3a1e040579519351912cd546d1d20 (patch)
treea80691aa2132fd59d776ffb36f79ef5535488210 /Userland/Libraries/LibGfx
parent8d490aba7686a7effa291d0f450b7293b98e6924 (diff)
downloadserenity-f461ee7d01d3a1e040579519351912cd546d1d20.zip
LibGfx: Add support for fonts that include the Hebrew Unicode Block
Diffstat (limited to 'Userland/Libraries/LibGfx')
-rw-r--r--Userland/Libraries/LibGfx/BitmapFont.cpp8
-rw-r--r--Userland/Libraries/LibGfx/BitmapFont.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/BitmapFont.cpp b/Userland/Libraries/LibGfx/BitmapFont.cpp
index 5fda354fda..841cb6a87b 100644
--- a/Userland/Libraries/LibGfx/BitmapFont.cpp
+++ b/Userland/Libraries/LibGfx/BitmapFont.cpp
@@ -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();
@@ -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();
}
@@ -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();
}
diff --git a/Userland/Libraries/LibGfx/BitmapFont.h b/Userland/Libraries/LibGfx/BitmapFont.h
index 2471a0134a..c62807a4ad 100644
--- a/Userland/Libraries/LibGfx/BitmapFont.h
+++ b/Userland/Libraries/LibGfx/BitmapFont.h
@@ -42,6 +42,7 @@ enum FontTypes {
Default = 0,
LatinExtendedA,
Cyrillic,
+ Hebrew,
__Count
};