Fix hebrew symbol codepoints (#3375)

This commit is contained in:
Harry Smith 2024-02-11 20:04:57 +07:00 committed by GitHub
parent 713154c14b
commit a1f111dfa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 0 deletions

View File

@ -319,6 +319,8 @@ pub fn styled_char(styles: StyleChain, c: char) -> char {
'Α'..='Ω' => 'Α',
'α'..='ω' => 'α',
'0'..='9' => '0',
// Hebrew Alef -> Dalet.
'\u{05D0}'..='\u{05D3}' => '\u{05D0}',
_ => return c,
};
@ -382,6 +384,9 @@ pub fn styled_char(styles: StyleChain, c: char) -> char {
(Cal | Frak | Mono | Bb, _, _) => return c,
},
// Hebrew Alef -> Dalet.
'\u{05D0}'..='\u{05D3}' => 0x2135,
// Numbers.
'0'..='9' => match tuple {
(Serif, false, _) => 0x0030,

View File

@ -842,6 +842,8 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! {
bet: 'ב',
gimmel: 'ג',
gimel: 'ג',
daleth: 'ד',
dalet: 'ד',
shin: 'ש',
// Double-struck.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -22,6 +22,10 @@ $a/b, display(a/b), display(a)/display(b), inline(a/b), script(a/b), sscript(a/b
// Test a few style exceptions.
$h, bb(N), cal(R), Theta, italic(Theta), sans(Theta), sans(italic(Theta))$
---
// Test hebrew exceptions.
$aleph, beth, gimel, daleth$
---
// Test font fallback.
$ and 🏳🌈 $