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

Line break support #139

Open
my2iu opened this issue May 3, 2021 · 1 comment
Open

Line break support #139

my2iu opened this issue May 3, 2021 · 1 comment

Comments

@my2iu
Copy link

my2iu commented May 3, 2021

Please add support for line breaking to this API. This is arguably more important than word segmentation and grapheme segmentation.

It is becoming increasingly common now for web apps to have custom text rendering, and these web apps need an API for line segmentation to be able to lay out text in lines with wrapping. HTML/CSS are too high-level to provide the font support that many web apps need, so low-level API is needed. Line-breaking libraries tend to be fairly large, so it's not really practical to directly bundle them in web apps either, so it would be better if the browser could provide this functionality.

Custom text rendering is used in

  • application web apps for word processing, vector illustration, paint programs, svg visualizations, etc.
  • any web page that needs to render text in WebGL or VR/AR (via WebXR). Good-looking text in 3d engines is commonly implemented using signed-distance fields, which requires a custom text renderer

And they all need proper internationalization APIs for line breaking (or at least they need sufficient low-level APIs that a web app can build a line breaking algorithm on top of it)

@FrankYFTang
Copy link
Contributor

See https://github.com/FrankYFTang/proposal-intl-segmenter-v2
and my slide for TC39 in Dec 15 https://docs.google.com/presentation/d/1ezpdee0r_ujHXDqqT4HHNYa2Q4VU7b4cMQWg6gQxLTk/edit#slide=id.g105bff1d00b_0_8

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

No branches or pull requests

2 participants