Sign in

    ShiChengxu/moonlayout/layout does not have a README file

    Alignment

    Horizontal alignment in monospace display columns.

    BreakKind

    Reason a line ended. Forced is an emergency grapheme boundary; End is EOF.

    BreakPolicy

    Preferred boundaries. Word/Sentence intersect UAX #14; Grapheme allows every grapheme boundary. Emergency splitting still applies when a unit is too long.

    Line

    Exact source range [start,end) in UTF-8 bytes, with a lossless source copy. text is trimmed/expanded content; aligned_text is the final display string. width measures aligned_text. Wrapping initially sets aligned_text = text.

    OptimalOptions

    Per internal ASCII space: maximum added cells (stretch) and removed cells (shrink, capped at one). Negative settings become zero. Penalties are capped to keep costs finite. This is a simplified paragraph optimizer, not TeX.

    WrapAlgorithm

    Greedy fills each line; Optimal minimizes paragraph badness.

    LayoutStyle

    Logical paragraph layout configuration. Optional integrations live in their own package.

    LayoutStyle::equal

    fn LayoutStyle::equal(LayoutStyle, LayoutStyle) -> Bool

    LayoutStyle::new

    Construct a layout style (greedy by default). Nonpositive widths normalize to one column.

    LayoutStyle::not_equal

    fn LayoutStyle::not_equal(x : LayoutStyle, y : LayoutStyle) -> Bool

    layout

    fn layout(text : String, style : LayoutStyle) -> Array[
    Line
    ]

    Layout a logical paragraph into lines with source ranges and aligned text.

    layout_hyphenated

    fn[H :
    Hyphenator
    ] layout_hyphenated(text : String, style : LayoutStyle, hyphenator : H) -> Array[
    Line
    ]

    Layout with a caller-owned hyphenator. Reuse a compiled Liang trie between calls.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io