Skip to content

@pdfa-lab/fontkit / DFont

Class: DFont ​

Defined in: src/d-font.ts:81

A file container for multiple TrueTypeFont programs.

Extends ​

Implements ​

Constructors ​

Constructor ​

new DFont(streamOrBuffer): DFont

Defined in: src/d-font.ts:126

Parameters ​

ParameterType
streamOrBufferUint8Array<ArrayBufferLike> | DecodeStream

Returns ​

DFont

Inherited from ​

FontCollection.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
objTypereadonly"DFont"undefinedIdentifier for DFont collection objects.FontCollection.objType FontCollection.objTypesrc/d-font.ts:85
typereadonly"DFont"undefinedDeprecated Use DFont#objType instead!FontCollection.type FontCollection.typesrc/d-font.ts:90
objTypereadonly"DFont"'DFont'Identifier for DFont collection objects, always 'DFont'.FontCollection.objTypesrc/d-font.ts:98

Accessors ​

fonts ​

Get Signature ​

get fonts(): TrueTypeFont<SFNTDirectory>[]

Defined in: src/d-font.ts:172

A lazily loaded array of fonts contained in the collection.

Returns ​

TrueTypeFont<SFNTDirectory>[]

A lazily loaded array of fonts contained in the collection.

Implementation of ​

FontCollection.fonts

Inherited from ​

FontCollection.fonts

Methods ​

getFont() ​

getFont(name): TrueTypeFont<SFNTDirectory> | null

Defined in: src/d-font.ts:151

Get a specific font with a known PostScript name.

Parameters ​

ParameterType
namestring | Uint8Array<ArrayBufferLike>

Returns ​

TrueTypeFont<SFNTDirectory> | null

Inherited from ​

FontCollection.getFont


probe() ​

static probe(buffer): boolean

Defined in: src/d-font.ts:107

Parameters ​

ParameterType
bufferBuffer

Returns ​

boolean