mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibGfx: Add support for fonts that include the Hebrew Unicode Block
This commit is contained in:
parent
8d490aba76
commit
f461ee7d01
Notes:
sideshowbarker
2024-07-18 19:26:12 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/f461ee7d01d Pull-request: https://github.com/SerenityOS/serenity/pull/6453
|
@ -147,6 +147,8 @@ RefPtr<BitmapFont> BitmapFont::load_from_memory(const u8* data)
|
||||||
type = FontTypes::LatinExtendedA;
|
type = FontTypes::LatinExtendedA;
|
||||||
else if (header.type == 2)
|
else if (header.type == 2)
|
||||||
type = FontTypes::Cyrillic;
|
type = FontTypes::Cyrillic;
|
||||||
|
else if (header.type == 3)
|
||||||
|
type = FontTypes::Hebrew;
|
||||||
else
|
else
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
|
@ -171,6 +173,9 @@ size_t BitmapFont::glyph_count_by_type(FontTypes type)
|
||||||
if (type == FontTypes::Cyrillic)
|
if (type == FontTypes::Cyrillic)
|
||||||
return 1280;
|
return 1280;
|
||||||
|
|
||||||
|
if (type == FontTypes::Hebrew)
|
||||||
|
return 1536;
|
||||||
|
|
||||||
dbgln("Unknown font type: {}", (int)type);
|
dbgln("Unknown font type: {}", (int)type);
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
@ -186,6 +191,9 @@ String BitmapFont::type_name_by_type(FontTypes type)
|
||||||
if (type == FontTypes::Cyrillic)
|
if (type == FontTypes::Cyrillic)
|
||||||
return "Cyrillic";
|
return "Cyrillic";
|
||||||
|
|
||||||
|
if (type == FontTypes::Hebrew)
|
||||||
|
return "Hebrew";
|
||||||
|
|
||||||
dbgln("Unknown font type: {}", (int)type);
|
dbgln("Unknown font type: {}", (int)type);
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ enum FontTypes {
|
||||||
Default = 0,
|
Default = 0,
|
||||||
LatinExtendedA,
|
LatinExtendedA,
|
||||||
Cyrillic,
|
Cyrillic,
|
||||||
|
Hebrew,
|
||||||
__Count
|
__Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue