Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Ticket] Hyphenation in paragraph text layout #2201

Closed
6 tasks done
Jocs opened this issue May 9, 2024 · 0 comments · Fixed by #2172
Closed
6 tasks done

[Feature Ticket] Hyphenation in paragraph text layout #2201

Jocs opened this issue May 9, 2024 · 0 comments · Fixed by #2172
Assignees
Labels

Comments

@Jocs
Copy link
Contributor

Jocs commented May 9, 2024

Shaping

Resources

Problem

Currently, Univer does not perform word segmentation(hyphenation) when typesetting English and other Western languages. Therefore, when aligning both ends, there will be a large gap between words. It is difficult for users to read and it is not beautiful. Therefore, through Use hyphens for word segmentation to make paragraph layout more beautiful and practical

Time Budget

This ticket is expected to be completed in 1.5 weeks, released in version 0.1.11, around May 23th.

Solution

Add hyphenation extension to LineBreaker. When obtaining break points through LineBreaker, add possible break points of hyphenation. When performing a line break, if it is a hyphenation break point, add a hyphen "-" at the end of the line.

Rabbit Holes

If the paragraph language is automatically detected, there may be certain misjudgments.

No-gos

This requirement only includes layout according to document settings, and does not include the implementation of paragraph segmentation-related functions (that is, it does not include paragraph settings and document settings)

Building

Resources

TODOs

  • Paragraph language auto detection if text run lang is omited.
  • Add word breaking plug-in to Line breaker.
  • Hyphen word breaking, adding a hyphen at the end of the line.
  • Consecutive hyphen restrictions(consecutiveHyphenLimit).
  • Do all capital letters need to be segmented(doNotHyphenateCaps).
  • Setting and function implementation of hyphenation zone(hyphenationZone).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant