PDFView4NET WinForms Edition


the char to get its width
GetCharWidth Method (PDFFontBase)
Gets the width of the given character when drawn with this font object.
Syntax
'Declaration
 
Public Overridable Function GetCharWidth( _
   ByVal charCode As Char _
) As Double
'Usage
 
Dim instance As PDFFontBase
Dim charCode As Char
Dim value As Double
 
value = instance.GetCharWidth(charCode)
public virtual double GetCharWidth( 
   char charCode
)

Parameters

charCode
the char to get its width

Return Value

This method returns a double value that represents the width, in unscaled glyph units, of the given character.
Remarks
To scale this value to font's current size, divide it by 1000 and multiply it by font size. For example, if font size is 20pt, then the width, in points, of a character for this font is 20 * GetCharWidth( charCode ) / 1000.
Requirements

Target Platforms: Windows 7, Windows 10, Windows 11, Windows Server 2022, Windows Server 2025

See Also