Skip to content

Add styling support for Unicode 18.0's LATIN SMALL LIGATURE LONG S WITH DESCENDER S - #186

Open
MDLC01 wants to merge 2 commits into
typst:mainfrom
MDLC01:unicode18-italics
Open

MDLC01 wants to merge 2 commits into
typst:mainfrom
MDLC01:unicode18-italics

Conversation

@MDLC01

@MDLC01 MDLC01 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

This PR adds support for styling a new Latin letter that was added in Unicode 18.0. The plain letter is U+1DF95, from Latin Extended-G, and the mathematical italic form is U+1D6A6, from Mathematical Alphanumeric Symbols.

The first commit bumps the MSRV to 1.92 (same as Typst), which is necessary to use u32::strict_add_signed to support the negative delta.

This was tested with the following assertions:

const PLAIN: char = '\u{1DF95}';
const ITALIC: &str = "\u{1D6A6}";
assert_eq!(MathStyle::select(PLAIN, None, false, None), MathStyle::Italic);
assert_eq!(to_style(PLAIN, MathStyle::Italic).to_string(), ITALIC);

@MDLC01 MDLC01 added the waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews label Sep 24, 2026
Comment thread src/styling.rs
Comment on lines 68 to 71
/// Italic style. May be serif or sans-serif depending on the font.
///
/// Supported characters: latin, greek, dotless, and the extra ħ (U+0127).
Italic,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the new char to the doc comment here please?

Comment thread src/styling.rs
Comment on lines +498 to +499
// Additional Latin symbol (U+1D6A6)
'𝾕' => -0x8EF,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments I had here matched the bold header from the Unicode chart, so Ligature long s (U+1D6A6) I'd prefer.

Comment thread src/styling.rs
'Γ' => 0x1DAB,
'Π' => 0x1D9F,
// Double-struck large operator (U+2140)
'∑' => return '⅀', // delta is negative

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely related to this PR, but since you've made the change to allow negative deltas, we should change this too then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants