Method ClipAndJustify
ClipAndJustify(string, int, Alignment, TextDirection, int, TextFormatter?, bool)
Justifies text within a specified width.
public static string ClipAndJustify(string text, int width, Alignment textAlignment, TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0, TextFormatter? textFormatter = null, bool preserveTabs = false)
Parameters
textstringThe text to justify.
widthintThe number of columns to clip the text to. Text longer than
widthwill be clipped.textAlignmentAlignmentAlignment.
textDirectionTextDirectionThe text direction.
tabWidthintThe number of columns used for a tab.
textFormatterTextFormatterTextFormatter instance to access any of his objects.
preserveTabsboolIf true tabs will be preserved, considering the spaces according to the provided TabWidth. If false, default, tabs will be replaced with spaces according to the provided TabWidth.
Returns
- string
Justified and clipped text.
ClipAndJustify(string, int, bool, TextDirection, int, TextFormatter?, bool)
Justifies text within a specified width.
public static string ClipAndJustify(string text, int width, bool justify, TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0, TextFormatter? textFormatter = null, bool preserveTabs = false)
Parameters
textstringThe text to justify.
widthintThe number of columns to clip the text to. Text longer than
widthwill be clipped.justifyboolJustify.
textDirectionTextDirectionThe text direction.
tabWidthintThe number of columns used for a tab.
textFormatterTextFormatterTextFormatter instance to access any of his objects.
preserveTabsboolIf true tabs will be preserved, considering the spaces according to the provided TabWidth. If false, default, tabs will be replaced with spaces according to the provided TabWidth.
Returns
- string
Justified and clipped text.