From 9f981bbd5f71dd2f30c64d04e4e84fe195ee774b Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Wed, 26 Aug 2026 16:40:20 +0200 Subject: [PATCH 1/2] Add support for styling U+2126 OHM SIGN --- src/styling.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/styling.rs b/src/styling.rs index 1e777743..35253ebe 100644 --- a/src/styling.rs +++ b/src/styling.rs @@ -433,7 +433,9 @@ mod conversions { #[inline] pub fn is_upper_greek(c: char) -> bool { - matches!(c, 'Α'..='Ω' | '∇' | 'ϴ') + // The last character is U+2126 OHM SIGN, which canonically + // decomposes to the regular capital Omega (U+03A9). + matches!(c, 'Α'..='Ω' | '∇' | 'ϴ' | 'Ω') } #[inline] @@ -463,6 +465,7 @@ mod conversions { 'ϴ' => 0x1D2C5, 'Σ'..='Ω' => 0x1D317, '∇' => 0x1B4BA, + 'Ω' => 0x1B59A, 'α'..='ω' => 0x1D311, // Additional bold Greek symbols (U+1D6DB..U+1D6E1) '∂' => 0x1B4D9, @@ -500,6 +503,7 @@ mod conversions { 'ϴ' => 0x1D2FF, 'Σ'..='Ω' => 0x1D351, '∇' => 0x1B4F4, + 'Ω' => 0x1B5D4, 'α'..='ω' => 0x1D34B, // Additional italic Greek symbols (U+1D715..U+1D71B) '∂' => 0x1B513, @@ -525,6 +529,7 @@ mod conversions { 'ϴ' => 0x1D339, 'Σ'..='Ω' => 0x1D38B, '∇' => 0x1B52E, + 'Ω' => 0x1B60E, 'α'..='ω' => 0x1D385, // Additional bold italic Greek symbols (U+1D74F..U+1D755) '∂' => 0x1B54D, @@ -628,6 +633,7 @@ mod conversions { 'ϴ' => 0x1D373, 'Σ'..='Ω' => 0x1D3C5, '∇' => 0x1B568, + 'Ω' => 0x1B648, 'α'..='ω' => 0x1D3BF, // Additional sans-serif bold Greek symbols (U+1D789..U+1D78F) '∂' => 0x1B587, @@ -666,6 +672,7 @@ mod conversions { 'ϴ' => 0x1D3AD, 'Σ'..='Ω' => 0x1D3FF, '∇' => 0x1B5A2, + 'Ω' => 0x1B682, 'α'..='ω' => 0x1D3F9, // Additional sans-serif bold italic Greek symbols (U+1D7C3..U+1D7C9) '∂' => 0x1B5C1, From 637dca0b2fc5413216976dcaea3d062d15ce5cc0 Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Wed, 26 Aug 2026 16:47:20 +0200 Subject: [PATCH 2/2] Add test --- src/styling.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/styling.rs b/src/styling.rs index 35253ebe..d1449a39 100644 --- a/src/styling.rs +++ b/src/styling.rs @@ -947,3 +947,26 @@ mod conversions { apply_delta(c, delta) } } + +#[cfg(test)] +mod test { + use super::*; + + /// U+2126 OHM SIGN canonically decomposes to U+03A9 GREEK CAPITAL LETTER + /// OMEGA and should therefore be styled the same way. + #[test] + fn ohm_sign_styles_like_capital_omega() { + const OHM: char = '\u{2126}'; + const OMEGA: char = '\u{03A9}'; + + for f in [ + conversions::to_bold, + conversions::to_italic, + conversions::to_bold_italic, + conversions::to_sans_serif_bold, + conversions::to_sans_serif_bold_italic, + ] { + assert_eq!(f(OHM), f(OMEGA)) + } + } +}