Search Results for

    Show / Hide Table of Contents

    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 Source

    DetermineTextAlignment(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

    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

    Remarks

    Split the sentences using GetWrappedSentencesByWords(string, int) or GetWrappedSentences(string, int) and call this for every line, or wrong results will occur!

    | Edit this page View Source

    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

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX