Table of Contents

Class BdfFont

Namespace
Iot.Device.Graphics
Assembly
Iot.Device.CharacterLcd.dll

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

int

DefaultChar

Default character

public int DefaultChar { get; protected set; }

Property Value

int

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

Hashtable

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

int

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

int

XDisplacement

X displacement of the character

public int XDisplacement { get; protected set; }

Property Value

int

YDisplacement

Y Displacement of the character

public int YDisplacement { get; protected set; }

Property Value

int

Methods

GetCharData(char, out SpanUshort)

Get character data or data for default character

public void GetCharData(char character, out SpanUshort charData)

Parameters

character char

Character whose data needs to be retrieved

charData SpanUshort

Character data

GetCharData(int, ref SpanInt, bool)

Get character data

public bool GetCharData(int charOrdinal, ref SpanInt data, bool useDefaultChar = true)

Parameters

charOrdinal int

Character ordinal

data SpanInt

Buffer to be sliced and filled with character data

useDefaultChar bool

Use 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 string

Path of the file representing the font

Returns

BdfFont

BdfFont instance