Skip to content

@pdfa-lab/fontkit / OpenTypeCFF1Font

Interface: OpenTypeCFF1Font ​

Defined in: src/open-type-font.ts:131

OpenType font with verified PostScript Compact Font Format (CFF) components, legacy version.

Extends ​

Properties ​

ascent ​

ascent: number

Defined in: src/open-type-font.ts:80

Inherited from ​

OpenTypeHeader.ascent


availableFeatures ​

availableFeatures: keyof Features[]

Defined in: src/font.ts:534

Inherited from ​

Font.availableFeatures


avar ​

avar: avar | null

Defined in: src/font.ts:324

Axis Variations Table. Modifies normalised coordinates across axes in variable fonts.

Inherited from ​

Font.avar


BASE ​

BASE: BASE | null

Defined in: src/font.ts:235

Baseline Data Table. Sets alignment values dynamically shifting script baselines.

Inherited from ​

Font.BASE


bbox ​

bbox: Readonly<BoundingBox>

Defined in: src/open-type-font.ts:89

Inherited from ​

OpenTypeHeader.bbox


boundingBox ​

boundingBox: Readonly<BoundingBox> | undefined

Defined in: src/font.ts:458

Inherited from ​

Font.boundingBox


bsln ​

bsln: bsln | null

Defined in: src/font.ts:330

Baseline Table. Provides baseline shift measurements for multi-script alignment.

Inherited from ​

Font.bsln


capHeight ​

capHeight: number

Defined in: src/open-type-font.ts:86

Inherited from ​

OpenTypeHeader.capHeight


CBLC ​

CBLC: EBLC | null

Defined in: src/font.ts:211

Colour Bitmap Data Table. Variant containing colour bitmap raw data blocks.

Inherited from ​

Font.CBLC


cff ​

readonly cff: CFF1Font

Defined in: src/open-type-font.ts:144

Alias for the structural OpenTypePostScriptFont CFF table.

Overrides ​

Font.cff


CFF ​

**CFF **: CFF1Font

Inherited from ​

StrictTables.CFF


CFF2 ​

CFF2: CFF2Font | null

Defined in: src/font.ts:193

PostScript Compact Font Format (CFF) Outline Table version 2.

Inherited from ​

Font.CFF2


characterSet ​

characterSet: number[] | undefined

Defined in: src/font.ts:468

An array of all of the unicode code points supported by the font.

Inherited from ​

Font.characterSet


cmap ​

cmap: cmap

Inherited from ​

StrictTables.cmap


COLR ​

COLR: COLR | null

Defined in: src/font.ts:223

Colour Table. Outlines layering configurations for multi-coloured vector icon layouts.

Inherited from ​

Font.COLR


copyright: string | null

Defined in: src/font.ts:394

The font's copyright information, or null if not present.

Inherited from ​

Font.copyright


CPAL ​

CPAL: CPAL | null

Defined in: src/font.ts:229

Colour Palette Table. Maps index arrays declaring hex colours utilised by COLR elements.

Inherited from ​

Font.CPAL


cvt ​

**cvt **: cvt | null

Defined in: src/font.ts:172

Control Value Table. Stores indexed control values used by TrueType instructions to maintain consistency when hinting glyphs.

Inherited from ​

Font.cvt


defaultLanguage ​

readonly defaultLanguage: string | null

Defined in: src/font.ts:607

The default language for strings to get from the font with getName().

See ​

Inherited from ​

Font.defaultLanguage


descent ​

descent: number

Defined in: src/open-type-font.ts:81

Inherited from ​

OpenTypeHeader.descent


directory ​

directory: SFNTDirectory

Defined in: src/font.ts:577

The structural binary wrapper tracking offset blocks and table pointers.

Inherited from ​

Omit.directory


DSIG ​

DSIG: DSIG | null

Defined in: src/font.ts:271

Digital Signature Table. Encapsulates cryptographic signatures validating binary authenticity.

Inherited from ​

Font.DSIG


EBLC ​

EBLC: EBLC | null

Defined in: src/font.ts:205

Embedded Bitmap Data Table. Stores bitmap images for specific point sizes.

Inherited from ​

Font.EBLC


familyName ​

familyName: string | null

Defined in: src/font.ts:384

The font's family name, e.g. "Helvetica", or null if not present.

Inherited from ​

Font.familyName


feat ​

feat: feat | null

Defined in: src/font.ts:336

Feature Name Table. Maps AAT feature selectors to localised string references.

Inherited from ​

Font.feat


fpgm ​

fpgm: fpgm | null

Defined in: src/font.ts:154

Font Program Table. Contains low-level hints executing instruction sets across grid points.

Inherited from ​

Font.fpgm


fullName ​

fullName: string | null

Defined in: src/font.ts:379

The font's full name, e.g. "Helvetica Bold", or null if not present.

Inherited from ​

Font.fullName


fvar ​

fvar: fvar | null

Defined in: src/font.ts:342

Font Variations Table. Declares design axes and instance configurations in variable fonts.

Inherited from ​

Font.fvar


gasp ​

gasp: gasp | null

Defined in: src/font.ts:277

Grid-fitting and Scan-conversion Procedure Table. Optimises text raster rendering constraints.

Inherited from ​

Font.gasp


GDEF ​

GDEF: GDEF | null

Defined in: src/font.ts:241

Glyph Definition Table. Categorises glyph types (e.g., base, ligature, mark) for layout alignment.

Inherited from ​

Font.GDEF


glyf ​

glyf: glyph | null

Defined in: src/font.ts:178

Glyph Data Table. Describes TrueType glyph outlines, including contour coordinates, composite glyph components, and hinting instructions.

Inherited from ​

Omit.glyf


GPOS ​

GPOS: GPOS | null

Defined in: src/font.ts:247

Glyph Positioning Table. Provides precise metric adjustments handling kerning and attachment marks.

Inherited from ​

Font.GPOS


GSUB ​

GSUB: GSUB | null

Defined in: src/font.ts:253

Glyph Substitution Table. Supplies glyph substitutions for contextual alternates, ligatures, and script-specific rendering.

Inherited from ​

Font.GSUB


gvar ​

gvar: gvar | null

Defined in: src/font.ts:348

Glyph Variations Table. Controls structural outline distortion transformations for variable glyphs.

Inherited from ​

Font.gvar


hdmx ​

hdmx: hdmx | null

Defined in: src/font.ts:283

Horizontal Device Metrics Table. Preserves explicit pixel width mappings optimising spacing.

Inherited from ​

Font.hdmx


head: head

Inherited from ​

StrictTables.head


hhea ​

hhea: hhea

Inherited from ​

StrictTables.hhea


hmtx ​

hmtx: hmtx

Inherited from ​

StrictTables.hmtx


HVAR ​

HVAR: HVAR | null

Defined in: src/font.ts:265

Horizontal Variation Metrics Table. Adjusts advance metrics across design spaces in variable fonts.

Inherited from ​

Font.HVAR


italicAngle ​

italicAngle: number

Defined in: src/open-type-font.ts:85

Inherited from ​

OpenTypeHeader.italicAngle


JSTF ​

JSTF: JSTF | null

Defined in: src/font.ts:259

Justification Table. Provides options for justification adjustments in complex scripts.

Inherited from ​

Font.JSTF


just ​

just: just | null

Defined in: src/font.ts:354

Justification Table (just). Provides layout rules for line justification, glyph width deltas, and post-compensation actions in AAT typography.

Inherited from ​

Font.just


kern ​

kern: kern | null

Defined in: src/font.ts:288

Kerning Table. Contains traditional pairwise spacing adjustments.

Inherited from ​

Font.kern


layoutEngine ​

layoutEngine: LayoutEngine

Defined in: src/font.ts:498

The shaping engine matching text scripts to font tables.

Inherited from ​

Font.layoutEngine


lineGap ​

lineGap: number

Defined in: src/open-type-font.ts:82

Inherited from ​

OpenTypeHeader.lineGap


loca ​

loca: loca | null

Defined in: src/font.ts:160

Index to Location Table. Maps local offsets for binary data streams resolving glyph outlines.

Inherited from ​

Font.loca


LTSH ​

LTSH: LTSH | null

Defined in: src/font.ts:294

Linear Threshold Table. Sets pixel-per-em limits where scaling instructions degrade.

Inherited from ​

Font.LTSH


maxp ​

maxp: maxp

Inherited from ​

StrictTables.maxp


morx ​

morx: morx | null

Defined in: src/font.ts:360

Extended Glyph Metamorphosis Table. Powers state-machine transformations substituting AAT items.

Inherited from ​

Font.morx


name ​

name: NonNullable<name | null>

Inherited from ​

StrictTables.name


numGlyphs ​

numGlyphs: number

Defined in: src/open-type-font.ts:87

Inherited from ​

OpenTypeHeader.numGlyphs


opbd ​

opbd: opbd | null

Defined in: src/font.ts:366

Optical Bounds Table. Sets bounding limits to align glyphs based on visual centre points.

Inherited from ​

Font.opbd


OS/2 ​

OS/2: NonNullable<OS2 | null>

Inherited from ​

StrictTables.OS/2


outlines ​

readonly outlines: "PostScript"

Defined in: src/open-type-font.ts:136

Discriminator for the different outline types.


outlineVersion ​

readonly outlineVersion: 1

Defined in: src/open-type-font.ts:139

Discriminator for CFF versions


PCLT ​

PCLT: PCLT | null

Defined in: src/font.ts:300

PCL 5 Table. Contains metrics and command parameters for HP LaserJet compatibility.

Inherited from ​

Font.PCLT


post ​

post: NonNullable<post | null>

Inherited from ​

StrictTables.post


postscriptName ​

postscriptName: string | Uint8Array<ArrayBufferLike> | null

Defined in: src/font.ts:374

The unique PostScript name for this font or null if not present.

Some broken fonts have PostScript names that cannot be decoded into a string. They are exposed as Uint8Array.

Inherited from ​

Font.postscriptName


prep ​

prep: prep | null

Defined in: src/font.ts:166

Control Value Program Table. Provides global instructions establishing variable outline alignment.

Inherited from ​

Font.prep


sbix ​

sbix: sbix | null

Defined in: src/font.ts:217

Standard Bitmap Graphics Table. Embeds raster configurations (PNG/JPEG) directly within glyph IDs.

Inherited from ​

Font.sbix


stream ​

stream: DecodeStream

Defined in: src/font.ts:582

The raw input stream reading binary payload slices.

Inherited from ​

Font.stream


subfamilyName ​

subfamilyName: string | null

Defined in: src/font.ts:389

The font's sub-family, e.g. "Bold", or null if not present.

Inherited from ​

Font.subfamilyName


underlinePosition ​

underlinePosition: number

Defined in: src/open-type-font.ts:83

Inherited from ​

OpenTypeHeader.underlinePosition


underlineThickness ​

underlineThickness: number

Defined in: src/open-type-font.ts:84

Inherited from ​

OpenTypeHeader.underlineThickness


unitsPerEm ​

unitsPerEm: number

Defined in: src/open-type-font.ts:88

Inherited from ​

OpenTypeHeader.unitsPerEm


variationProcessor ​

variationProcessor: GlyphVariationProcessor | null

Defined in: src/font.ts:595

The processor responsible for calculating delta adjustments to glyph outlines along design variation axes. This is initialised when variation coordinates are applied, and is null for static fonts.

Inherited from ​

Font.variationProcessor


VDMX ​

VDMX: VDMX | null

Defined in: src/font.ts:306

Vertical Device Metrics Table. Preserves explicit vertical pixel height mappings.

Inherited from ​

Font.VDMX


version ​

version: string | null

Defined in: src/font.ts:399

The font's version number or null if not present.

Inherited from ​

Font.version


vhea ​

vhea: vhea | null

Defined in: src/font.ts:312

Vertical Header Table. Stores global metric parameters for vertical text directions.

Inherited from ​

Font.vhea


vmtx ​

vmtx: vmtx | null

Defined in: src/font.ts:318

Vertical Metrics Table. Contains advance heights and top side bearings for vertical layouts.

Inherited from ​

Font.vmtx


VORG ​

VORG: VORG | null

Defined in: src/font.ts:199

Vertical Origin Table. Specifies vertical coordinate origins for dynamic metrics scaling.

Inherited from ​

Font.VORG


xHeight ​

xHeight: number

Defined in: src/font.ts:442

Inherited from ​

Font.xHeight

Methods ​

asAATFont() ​

asAATFont(): AATFont | null

Defined in: src/font.ts:93

Attempts to view this font as an AATFont.

Returns ​

AATFont | null

the font with narrowed to an @{link AATFont} or `null if a required table is missing

Inherited from ​

Omit.asAATFont


asOpenTypeFont() ​

asOpenTypeFont(): OpenTypeFont | null

Defined in: src/font.ts:86

Attempts to view this font instance as a strict OpenType font layout. Returns null, if a structurally required table is missing.

See OpenTypeFont for usage instructions!

Returns ​

OpenTypeFont | null

the font with narrowed to an @{link OpenTypeFont} or `null if a required table is missing

Inherited from ​

Omit.asOpenTypeFont


asTrueTypeSubsetFont() ​

asTrueTypeSubsetFont(): TrueTypeSubsetFont | null

Defined in: src/font.ts:100

Attempts to view this font as an TrueTypeSubsetFont font.

Returns ​

TrueTypeSubsetFont | null

the font with narrowed to a @{link TrueTypeSubsetFont} or `null if a required table is missing

Inherited from ​

Omit.asTrueTypeSubsetFont


codePointsForGlyph() ​

codePointsForGlyph(gid): number[]

Defined in: src/font.ts:529

Returns an array of alternative unicode mapping arrays tied to a specific glyph ID.

Parameters ​

ParameterType
gidnumber

Returns ​

number[]

Inherited from ​

Omit.codePointsForGlyph


createSubset() ​

createSubset(): Subset

Defined in: src/font.ts:572

Creates an empty layout subset utilising this font structure as its baseline data map.

Returns ​

Subset

Inherited from ​

Omit.createSubset


getAvailableFeatures() ​

getAvailableFeatures(script, language?): keyof Features[]

Defined in: src/font.ts:540

An array of all OpenType feature tags supported by the font for a given script and language.

Parameters ​

ParameterType
script"Caucasian_Albanian" | "Arabic" | "Imperial_Aramaic" | "Armenian" | "Avestan" | "Balinese" | "Bamum" | "Bassa_Vah" | "Batak" | "Bengali" | "Bopomofo" | "Brahmi" | "Braille" | "Buginese" | "Buhid" | "Chakma" | "Canadian_Aboriginal" | "Carian" | "Cham" | "Cherokee" | "Coptic" | "Cypriot" | "Cyrillic" | "Devanagari" | "Deseret" | "Duployan" | "Egyptian_Hieroglyphs" | "Elbasan" | "Ethiopic" | "Georgian" | "Glagolitic" | "Gothic" | "Grantha" | "Greek" | "Gujarati" | "Gurmukhi" | "Hangul" | "Han" | "Hanunoo" | "Hebrew" | "Hiragana" | "Pahawh_Hmong" | "Katakana_Or_Hiragana" | "Old_Italic" | "Javanese" | "Kayah_Li" | "Katakana" | "Kharoshthi" | "Khmer" | "Khojki" | "Kannada" | "Kaithi" | "Tai_Tham" | "Lao" | "Latin" | "Lepcha" | "Limbu" | "Linear_A" | "Linear_B" | "Lisu" | "Lycian" | "Lydian" | "Mahajani" | "Mandaic" | "Manichaean" | "Mende_Kikakui" | "Meroitic_Cursive" | "Meroitic_Hieroglyphs" | "Malayalam" | "Modi" | "Mongolian" | "Mro" | "Meetei_Mayek" | "Myanmar" | "Old_North_Arabian" | "Nabataean" | "Nko" | "Ogham" | "Ol_Chiki" | "Old_Turkic" | "Oriya" | "Osmanya" | "Palmyrene" | "Pau_Cin_Hau" | "Old_Permic" | "Phags_Pa" | "Inscriptional_Pahlavi" | "Psalter_Pahlavi" | "Phoenician" | "Miao" | "Inscriptional_Parthian" | "Rejang" | "Runic" | "Samaritan" | "Old_South_Arabian" | "Saurashtra" | "Shavian" | "Sharada" | "Siddham" | "Khudawadi" | "Sinhala" | "Sora_Sompeng" | "Sundanese" | "Syloti_Nagri" | "Syriac" | "Tagbanwa" | "Takri" | "Tai_Le" | "New_Tai_Lue" | "Tamil" | "Tai_Viet" | "Telugu" | "Tifinagh" | "Tagalog" | "Thaana" | "Thai" | "Tibetan" | "Tirhuta" | "Ugaritic" | "Vai" | "Warang_Citi" | "Old_Persian" | "Cuneiform" | "Yi" | "Inherited" | "Common" | "Unknown"
language?string

Returns ​

keyof Features[]

Inherited from ​

Omit.getAvailableFeatures


getGlyfTableStream() ​

getGlyfTableStream(): DecodeStream | null

Defined in: src/font.ts:588

Extracts a raw readable segment slice targeting vector outline definitions.

Returns ​

DecodeStream | null

Inherited from ​

Omit.getGlyfTableStream


getGlyph() ​

getGlyph(glyph, characters?): Glyph

Defined in: src/open-type-font.ts:146

Returns a glyph object for the given glyph id. You can pass the array of code points this glyph represents for your use later, and it will be stored in the glyph object.

Parameters ​

ParameterTypeDescription
glyphnumberthe glyph id
characters?readonly number[]an array of code points this glyph represents

Returns ​

Glyph

the corresponding glyph

Overrides ​

Omit.getGlyph


glyphForCodePoint() ​

glyphForCodePoint(codePoint): Glyph | null

Defined in: src/font.ts:485

Maps a single unicode code point to a Glyph object. Does not perform any advanced substitutions.

Parameters ​

ParameterTypeDescription
codePointnumberthe unicode code point

Returns ​

Glyph | null

the corresponding glyph

Inherited from ​

Omit.glyphForCodePoint


glyphsForString() ​

glyphsForString(str): Glyph[]

Defined in: src/font.ts:494

Returns an array of Glyph objects for the given string. This is only a static one-to-one mapping from characters to glyphs.

Parameters ​

ParameterTypeDescription
strstringthe string to encode

Returns ​

Glyph[]

the corresponding glyphs

Inherited from ​

Omit.glyphsForString


hasGlyphForCodePoint() ​

hasGlyphForCodePoint(codePoint): boolean

Defined in: src/font.ts:476

Returns whether there is a glyph in the font for the given unicode code point.

Parameters ​

ParameterTypeDescription
codePointnumberthe unicode code point

Returns ​

boolean

true if a glyph is available for the code point, false otherwise

Inherited from ​

Omit.hasGlyphForCodePoint


hasTable() ​

hasTable<K>(tag): boolean

Defined in: src/font.ts:76

Tests whether a certain table is present in the font file.

Type Parameters ​

Type ParameterDefault type
K extends stringstring

Parameters ​

ParameterTypeDescription
tag"name" | "head" | "kern" | "opbd" | "loca" | "hmtx" | "cmap" | "hhea" | "maxp" | "OS/2" | "post" | "fpgm" | "prep" | "cvt " | "glyf" | "CFF " | "CFF2" | "VORG" | "EBLC" | "CBLC" | "sbix" | "COLR" | "CPAL" | "BASE" | "GDEF" | "GPOS" | "GSUB" | "JSTF" | "HVAR" | "DSIG" | "gasp" | "hdmx" | "LTSH" | "PCLT" | "VDMX" | "vhea" | "vmtx" | "avar" | "bsln" | "feat" | "fvar" | "gvar" | "just" | "morx" | Kthe table name like cmap, OS/2, or hmtx

Returns ​

boolean

Inherited from ​

Omit.hasTable


layout() ​

layout(str, userFeatures?, script?, language?, direction?): GlyphRun

Defined in: src/font.ts:511

Returns a GlyphRun object, which includes an array of Glyphs and GlyphPositions for the given string.

Parameters ​

ParameterTypeDescription
strstringthe string to encode
userFeatures?Features | keyof Features[]an array of OpenType feature tags to be applied in addition to the default set.
script?OpenTypeTagthe script of the string
language?stringthe language of the string
direction?BidiDirectionthe writing direction for the string

Returns ​

GlyphRun

the rendered string as a GlyphRun

Inherited from ​

Omit.layout


safeGetGlyph() ​

safeGetGlyph(glyph, characters?): Glyph

Defined in: src/font.ts:563

Like getGlyph but falls back to the fallback glyph .notdef if the glyph cannot be resolved, because of missing tables.

Parameters ​

ParameterTypeDescription
glyphnumberthe glyph id
characters?readonly number[]an optional sequence of codepoints

Returns ​

Glyph

Inherited from ​

Omit.safeGetGlyph


setDefaultLanguage() ​

setDefaultLanguage(lang): void

Defined in: src/font.ts:614

Set the default language.

Parameters ​

ParameterType
langstring | null

Returns ​

void

See ​

defaultLanguage

Inherited from ​

Omit.setDefaultLanguage


stringsForGlyph() ​

stringsForGlyph(gid): string[]

Defined in: src/font.ts:523

Returns an array of strings that map to the given glyph id.

Parameters ​

ParameterTypeDescription
gidnumberthe glyph id

Returns ​

string[]

Inherited from ​

Omit.stringsForGlyph