Skip to content

Improve Pretext docs/examples for hyphenation with user-generated text #91

@mneuschaefer

Description

@mneuschaefer

Hi, first of all: pretext is excellent for dynamic line routing. We’re evaluating it for a page-like productivity UI where text reflows around moving objects, and the core layout behavior is very promising.

One gap we ran into is hyphenation in a pretext-first architecture.

Our use case:

  • user-generated text in a todo / notes app
  • short editable entries, not just editorial paragraphs
  • mixed language is common
  • product names, names, brands, places, and casual phrases appear frequently
  • text is manually laid out with prepareWithSegments(...) + layoutNextLine(...)
  • dynamic obstacle-aware reflow is the priority
  • hyphenation is secondary, but still important for production quality

What we found:

  • browser hyphens: auto is not directly usable once text is rendered through pretext instead of normal DOM layout
  • external pattern-based hyphenation can help, but can also produce visibly bad breaks on user text, especially with mixed language or uncommon words
  • for app-like text, a wrong hyphenation is often worse than no hyphenation

Suggestion / request:
It would be very helpful if the docs discussed production approaches for hyphenation when using pretext for manual layout, for example:

  • recommended strategy for integrating external hyphenation before prepareWithSegments(...)
  • whether soft hyphens are the intended interoperability path
  • guidance for user-generated text vs editorial text
  • recommendations around language tagging / locale handling
  • known tradeoffs with mixed-language content, names, brands, and short UI/task text
  • whether a conservative “hyphenate only some tokens” approach is recommended
  • maybe an example demo combining layoutNextLine(...) with optional hyphenation input

A concrete docs/example page around “Pretext + hyphenation for manual layout” would be very valuable.

Thanks again for the library. The dynamic layout side is genuinely exciting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions