Skip to content

Style incrementality #432

@nicoburns

Description

@nicoburns

Tracking issue for incremental application of styles in Parley.

Parley layout consists of 3 phases:

  • Construction (includes Shaping and BiDi analysis)
  • Layout (line breaking, alignment, etc)
  • Paint (parley just passes through styles)

It should be possible to update styles and rerun later phases without having to redo earlier phases. This helps to avoid the expensive shaping phase when only layout/paint has updated, and can completely avoid doing work in Parley in the case of paint-only updates.

A table of which properties affect which phase can be found below:

Property Affects
FontStack(FontStack<'a>) Shaping
FontSize(f32) Shaping
FontWidth(FontWidth) Shaping
FontStyle(FontStyle) Shaping
FontWeight(FontWeight) Shaping
FontVariations(FontSettings<'a, FontVariation>) Shaping
FontFeatures(FontSettings<'a, FontFeature>) Shaping
Locale(Option<&'a str>) Shaping
LineHeight(LineHeight) Layout (possibly actually Shaping)
WordSpacing(f32) Layout
LetterSpacing(f32) Layout
WordBreak(WordBreakStrength) Layout
OverflowWrap(OverflowWrap) Layout
TextWrapMode(TextWrapMode) Layout
VerticalAlign(VerticalAlign) Layout
Brush(B) Paint
Underline(bool) Paint
UnderlineOffset(Option) Paint
UnderlineSize(Option) Paint
UnderlineBrush(Option) Paint
Strikethrough(bool) Paint
StrikethroughOffset(Option) Paint
StrikethroughSize(Option) Paint
StrikethroughBrush(Option) Paint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions