Class BdfFont
Represents Bitmap Distribution Format (BDF) font, partial implementation of specifications. Specifications can be found here: https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
public class BdfFont
- Inheritance
-
BdfFont
- Derived
Constructors
BdfFont()
public BdfFont()
Properties
CharsCount
Number of characters
public int CharsCount { get; protected set; }
Property Value
DefaultChar
Default character
public int DefaultChar { get; protected set; }
Property Value
GlyphMapper
GlyphMapper is mapping from the character number to the index of the character bitmap data in the buffer GlyphUshortData.
protected Hashtable? GlyphMapper { get; set; }
Property Value
GlyphUshortData
The buffer containing all the data
protected ushort[]? GlyphUshortData { get; set; }
Property Value
- ushort[]
Height
Character height
public int Height { get; protected set; }
Property Value
SupportedChars
Characters supported by this font
public int[] SupportedChars { get; }
Property Value
- int[]
Array of supported characters
Width
Character width
public int Width { get; protected set; }
Property Value
XDisplacement
X displacement of the character
public int XDisplacement { get; protected set; }
Property Value
YDisplacement
Y Displacement of the character
public int YDisplacement { get; protected set; }
Property Value
Methods
GetCharData(char, out SpanUshort)
Get character data or data for default character
public void GetCharData(char character, out SpanUshort charData)
Parameters
character
charCharacter whose data needs to be retrieved
charData
SpanUshortCharacter data
GetCharData(int, ref SpanInt, bool)
Get character data
public bool GetCharData(int charOrdinal, ref SpanInt data, bool useDefaultChar = true)
Parameters
charOrdinal
intCharacter ordinal
data
SpanIntBuffer to be sliced and filled with character data
useDefaultChar
boolUse default character if not found
Returns
- bool
True if data could be retrieved
Load(string)
Loads BdfFont from a specified path
public static BdfFont Load(string fontFilePath)
Parameters
fontFilePath
stringPath of the file representing the font
Returns
- BdfFont
BdfFont instance