-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedHelp implementing this feature is welcomedHelp implementing this feature is welcomed
Description
Parley doesn't currently have a way to indent the first line of a paragraph (like CSS text-indent).
I tried working around this by inserting a zero-height InlineBox at the start of the paragraph as a spacer. This mostly works, but the line breaker unconditionally marks a break opportunity after every inline box:
parley/parley/src/layout/line_break.rs
Lines 257 to 258 in df7cedc
| // We can always line break after an inline box | |
| self.state.mark_line_break_opportunity(); |
With these settings:
builder.push_default(StyleProperty::OverflowWrap(OverflowWrap::Anywhere));
builder.push_default(StyleProperty::WordBreak(WordBreakStrength::BreakAll));Filling a line with , characters causes the InlineBox to be orphaned on a line by itself — the text moves to the next line at x=0 with no indent. (This doesn't happen with A characters.)
A native text_indent parameter would avoid this problem. Negative values could give hanging indents, useful for list markers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedHelp implementing this feature is welcomedHelp implementing this feature is welcomed