You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RichTextEditor 12.3.0: custom tab stops (Block.TabStopPositions) are saved but not used in layout
#22443
I’m using the commercial RichTextEditor package (Avalonia.Controls.RichTextEditor / Avalonia.Controls.Documents 12.3.0, on Avalonia 12.1.1) in a writing app and I’d like to add a Word-style ruler for tab stops. Before building it I checked whether the editor honours custom tab stops. It stores them, but text doesn’t line up at them.
I found that Block.TabStopPositions can be set on a Paragraph, and it survives an RTF save and reload (\tx900 \tx3300 \tx5700 for 60, 220 and 380 DIPs).
In the editor, a tab in a paragraph with custom stops advances by the same fixed step as a tab in a paragraph without them.
Applying the property through editor.Selection.ApplyPropertyValue(...) made no visible difference either.
Code:
var doc = new FlowDocument();
var p = new Paragraph(new RichRun("X\tat 60\tat 220\tat 380"));
p.TabStopPositions = new double[] { 60, 220, 380 };
doc.Blocks.Add(p);
doc.Blocks.Add(new Paragraph(new RichRun("Default:\tA\tBB\tCCC")));
var editor = new RichTextEditor { AcceptsTab = true, ShowToolbar = false, Document = doc };
// Both paragraphs tab identically.
I'd appreciate any help with the following questions:
Is laying out TabStopPositions planned for the editor? Or is there a setting I’ve missed?
If it is planned, will tab alignment (left/centre/right/decimal) and leaders come with it? At the moment they only survive as DOCX/RTF metadata.
In the meantime, can the editor’s default tab interval be changed?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I’m using the commercial RichTextEditor package (Avalonia.Controls.RichTextEditor / Avalonia.Controls.Documents 12.3.0, on Avalonia 12.1.1) in a writing app and I’d like to add a Word-style ruler for tab stops. Before building it I checked whether the editor honours custom tab stops. It stores them, but text doesn’t line up at them.
I found that Block.TabStopPositions can be set on a Paragraph, and it survives an RTF save and reload (\tx900 \tx3300 \tx5700 for 60, 220 and 380 DIPs).
In the editor, a tab in a paragraph with custom stops advances by the same fixed step as a tab in a paragraph without them.
Applying the property through editor.Selection.ApplyPropertyValue(...) made no visible difference either.
Code:
var doc = new FlowDocument();
var p = new Paragraph(new RichRun("X\tat 60\tat 220\tat 380"));
p.TabStopPositions = new double[] { 60, 220, 380 };
doc.Blocks.Add(p);
doc.Blocks.Add(new Paragraph(new RichRun("Default:\tA\tBB\tCCC")));
var editor = new RichTextEditor { AcceptsTab = true, ShowToolbar = false, Document = doc };
// Both paragraphs tab identically.
I'd appreciate any help with the following questions:
Is laying out TabStopPositions planned for the editor? Or is there a setting I’ve missed?
If it is planned, will tab alignment (left/centre/right/decimal) and leaders come with it? At the moment they only survive as DOCX/RTF metadata.
In the meantime, can the editor’s default tab interval be changed?
All reactions