XFINIUM.PDF Documentation
GetCharWidth Method (PdfFont)



Xfinium.Pdf.Graphics Namespace > PdfFont Class : GetCharWidth Method
the char to get its width
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 PdfFont
Dim charCode As Char
Dim value As Double
 
value = instance.GetCharWidth(charCode)
public virtual double GetCharWidth( 
   char charCode
)
public:
virtual double GetCharWidth( 
   char charCode
) 

Parameters

charCode
the char to get its width

Return Value

This method returns a float 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

Supported .NET Platforms: .NET 4.0 and higher, Windows Forms, ASP.NET, Windows Presentation Foundation 4.x, Silverlight 5, WinRT, Universal Windows Platform, Xamarin Mac, iOS & Android, Portable Class Library, .NET Core, .NET Standard


Target Platforms:Windows 10, Windows 8.1, Windows 8 , Windows 7, Windows Vista SP1 or later, Windows Server 2008, Windows Server 2008 R2

See Also

Reference

PdfFont Class
PdfFont Members