Class TextWriterTools
Text writer tools
Inheritance
object
TextWriterTools
Namespace: Terminaux.Writer.CyclicWriters.Renderer.Tools
Assembly: Terminaux.dll
Syntax
public static class TextWriterTools
Methods
| Edit this page View SourceDetermineTextAlignment(string, int, TextAlignment, int)
Determines the text alignment X position (zero-based)
Declaration
public static int DetermineTextAlignment(string text, int width, TextAlignment alignment, int leftMargin = 0)
Parameters
Type | Name | Description |
---|---|---|
string | text | Text to process. Only the first line is taken, so split the sentences using GetWrappedSentencesByWords(string, int) or GetWrappedSentences(string, int). |
int | width | Target width (zero-based) |
TextAlignment | alignment | Text alignment |
int | leftMargin | Left margin (zero-based) |
Returns
Type | Description |
---|---|
int | A zero-based X position of the aligned text |
DetermineTextAlignment(string, TextAlignment, int)
Determines the text alignment X position (zero-based)
Declaration
public static int DetermineTextAlignment(string text, TextAlignment alignment, int leftMargin = 0)
Parameters
Type | Name | Description |
---|---|---|
string | text | Text to process. Only the first line is taken, so split the sentences using GetWrappedSentencesByWords(string, int) or GetWrappedSentences(string, int). |
TextAlignment | alignment | Text alignment |
int | leftMargin | Left margin (zero-based) |
Returns
Type | Description |
---|---|
int | A zero-based X position of the aligned text |