Xceed Words for .NET v5.0 Documentation
Xceed.Drawing.NET Assembly / Xceed.Drawing Namespace / Font Class / GetTextWidth Method
The text that will be evaluated.
The Name of the Font that will be used to calculate the text's width.
The Size of the Font that will be used to calculate the text's width.


In This Topic
    GetTextWidth Method
    In This Topic
    Calculates the text's width, based on the Font's NameSize.
    Syntax
    'Declaration
     
    Public Shared Function GetTextWidth( _
       ByVal text As String, _
       ByVal fontName As String, _
       ByVal fontSize As Single _
    ) As Single
    'Usage
     
    Dim text As String
    Dim fontName As String
    Dim fontSize As Single
    Dim value As Single
     
    value = Font.GetTextWidth(text, fontName, fontSize)
    public static float GetTextWidth( 
       string text,
       string fontName,
       float fontSize
    )

    Parameters

    text
    The text that will be evaluated.
    fontName
    The Name of the Font that will be used to calculate the text's width.
    fontSize
    The Size of the Font that will be used to calculate the text's width.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows, 11, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also