Can shaping be reused for different line breaks?

Open
#4 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust

Research direction

The issue names no files, tests, or entry points. Start by locating the Rust library's shaping and line-break handling, then investigate whether shaping results can be reused across break opportunities. Done would require a decided approach, documented behavior, and tests or measurements covering the proposed reuse.

Written by the indexing model from the issue text.

Description

Can a the result of shaping a Unicode string differ from concatenating the results of shaping the two parts, after splitting that string at a line break opportunity?

Or phrased differently: when making multiple layouts of an otherwise-identical paragraph by making different choices about which line break opportunities to take, can we reuse some of the results of shaping computation? This might come up for example when resizing a window or other container.

For CSS layout specifically, we sometimes need to compute the min-content and max-content intrinsic size of an element. For text, this means measuring the width of the widest line when taking respectively all or none of the break opportunities.

Assuming that shaping is somewhat expensive, it would be good if we can avoid doing it from scratch three times. (Twice for min- and max-content, then once more for “real” layout.)

Dominant language
Rust
Stars
335
Forks
35
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linebender/skribo

All issues in linebender/skribo

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.