From 9eeba174be3eb7faa5db8904ebbf9705b2fcc043 Mon Sep 17 00:00:00 2001 From: Chad Brokaw Date: Fri, 6 Jun 2025 14:06:57 -0400 Subject: [PATCH] Map math script in old_tag_from_script Fixes #162 --- src/hb/common.rs | 2 +- src/hb/tag.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb/common.rs b/src/hb/common.rs index 8ca4cf14..2fc774e9 100644 --- a/src/hb/common.rs +++ b/src/hb/common.rs @@ -469,7 +469,7 @@ pub mod script { pub const TODHRI: Script = Script::from_bytes(b"Todr"); pub const TULU_TIGALARI: Script = Script::from_bytes(b"Tutg"); - pub const SCRIPT_MATH: Script = Script::from_bytes(b"Zmth"); + pub const MATH: Script = Script::from_bytes(b"Zmth"); // https://github.com/harfbuzz/harfbuzz/issues/1162 pub const MYANMAR_ZAWGYI: Script = Script::from_bytes(b"Qaag"); diff --git a/src/hb/tag.rs b/src/hb/tag.rs index 24a2f5f9..6d78033c 100644 --- a/src/hb/tag.rs +++ b/src/hb/tag.rs @@ -237,6 +237,8 @@ fn new_tag_from_script(script: Script) -> Option { fn old_tag_from_script(script: Script) -> hb_tag_t { // This seems to be accurate as of end of 2012. match script { + script::MATH => hb_tag_t::from_bytes(b"math"), + // Katakana and Hiragana both map to 'kana'. script::HIRAGANA => hb_tag_t::from_bytes(b"kana"),