Skip to content

Add hyphenation_character method to Lang#31

Merged
laurmaedje merged 3 commits intotypst:mainfrom
santhoshtr:hyphenation-character
Apr 7, 2026
Merged

Add hyphenation_character method to Lang#31
laurmaedje merged 3 commits intotypst:mainfrom
santhoshtr:hyphenation-character

Conversation

@santhoshtr
Copy link
Copy Markdown
Contributor

Add hyphenation_character method to Lang so that typst can use Hypher for patterns and properties like bounds, hyphenation_character. Any downstream users of Hypher library can also use these characters at presentation layer.

Refer discussion at: typst/typst#8033 and #30

Following is a screenshot from typst after integrating this feature. PR for typst is coming soon. You can see that words are broken at line ends as per hyphenation rules without visible hyphen as expected. For English, hyphens are visible

image

Returns language-specific hyphenation character: SOFT HYPHEN by default,
empty string for 12 Indic scripts where visual hyphenation is not
conventional.
- Add hyphenation_character() generation to write_lang function
- Add is_indic_script helper to identify Indic scripts (Beng, Deva,
Gujr, Guru, Knda, Mlym, Orya, Taml, Telu)
- Generate None for Indic scripts, Some('\u{ad}') for all others
- Regenerate src/lang.rs with the generated method replacing manual
implementation
- Keep generated code in sync with source of truth
@laurmaedje laurmaedje merged commit babf1fc into typst:main Apr 7, 2026
3 checks passed
@laurmaedje
Copy link
Copy Markdown
Member

Thanks! If you're for now done on the hypher side, I'd be happy to cut a release. Just let me know.

@santhoshtr
Copy link
Copy Markdown
Contributor Author

Thanks! yes, a new release will help me to submit PR to typst with hypher version bump.

@laurmaedje
Copy link
Copy Markdown
Member

Done!

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.

2 participants