Skip to content

Add support for styling U+2126 OHM SIGN - #183

Open
MDLC01 wants to merge 3 commits into
typst:mainfrom
MDLC01:ohm-sign-styling
Open

MDLC01 wants to merge 3 commits into
typst:mainfrom
MDLC01:ohm-sign-styling

Conversation

@MDLC01

@MDLC01 MDLC01 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

U+2126 OHM SIGN canonically decomposes to the regular capital Omega Greek letter. For this reason, I believe it should behave just like the regular capital Omega with regard to styling.

@MDLC01
MDLC01 requested a review from mkorje August 26, 2026 14:47
@MDLC01 MDLC01 added the waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews label Aug 26, 2026

@mkorje mkorje left a comment •

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.

IMO it'd be cleaner to add a new function like conversions::normalize, which converts the ohm sign to captial omega, and then call that at the top of MathStyle:select and to_style.

@MDLC01

MDLC01 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

I did that. Also, I was not able to find any other character that we might want to normalize (i.e., a character that canonically decomposes to a character that we can style), but I did not do any form of exhaustive check.

@Enivex

Enivex commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

U+212A maps to a regular K

https://www.compart.com/en/unicode/U+212A

There's also all the precomposed letters. For instance, bold() does not work on Å (precomposed), but it does work* on Å (using combining character).

*bold is currently broken when applied to combining accents, which I will report if it hasn't been already

@Enivex

Enivex commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Another one: U+1FBE (Greek Prosgegrammeni) decomposes to a regular iota.

(Though I question if anyone would actually use that...)

If Google's AI result isn't lying to me, that should be everything stylable that's not CJK or contains accents.

@MDLC01

MDLC01 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

I added support for U+212A and U+1FBE.

@mkorje mkorje left a comment

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.

Re-approving as its stale.

Comment thread src/styling.rs Outdated
@MDLC01 MDLC01 removed the waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants