Add hyphenation_character method to Lang#31
Merged
laurmaedje merged 3 commits intotypst:mainfrom Apr 7, 2026
Merged
Conversation
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
Member
|
Thanks! If you're for now done on the |
Contributor
Author
|
Thanks! yes, a new release will help me to submit PR to |
Member
|
Done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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