@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 ​
Omit<Font,RequiredOpenTypeCFF1TableTag|OpenTypeHeaderKeys>.StrictTables<RequiredOpenTypeCFF1TableTag>.OpenTypeHeader
Properties ​
ascent ​
ascent:
number
Defined in: src/open-type-font.ts:80
Inherited from ​
availableFeatures ​
availableFeatures: keyof
Features[]
Defined in: src/font.ts:534
Inherited from ​
avar ​
avar:
avar|null
Defined in: src/font.ts:324
Axis Variations Table. Modifies normalised coordinates across axes in variable fonts.
Inherited from ​
BASE ​
BASE:
BASE|null
Defined in: src/font.ts:235
Baseline Data Table. Sets alignment values dynamically shifting script baselines.
Inherited from ​
bbox ​
bbox:
Readonly<BoundingBox>
Defined in: src/open-type-font.ts:89
Inherited from ​
boundingBox ​
boundingBox:
Readonly<BoundingBox> |undefined
Defined in: src/font.ts:458
Inherited from ​
bsln ​
bsln:
bsln|null
Defined in: src/font.ts:330
Baseline Table. Provides baseline shift measurements for multi-script alignment.
Inherited from ​
capHeight ​
capHeight:
number
Defined in: src/open-type-font.ts:86
Inherited from ​
CBLC ​
CBLC:
EBLC|null
Defined in: src/font.ts:211
Colour Bitmap Data Table. Variant containing colour bitmap raw data blocks.
Inherited from ​
cff ​
readonlycff:CFF1Font
Defined in: src/open-type-font.ts:144
Alias for the structural OpenTypePostScriptFont CFF table.
Overrides ​
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 ​
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 ​
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 ​
copyright ​
copyright:
string|null
Defined in: src/font.ts:394
The font's copyright information, or null if not present.
Inherited from ​
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 ​
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 ​
defaultLanguage ​
readonlydefaultLanguage:string|null
Defined in: src/font.ts:607
The default language for strings to get from the font with getName().
See ​
Inherited from ​
descent ​
descent:
number
Defined in: src/open-type-font.ts:81
Inherited from ​
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 ​
EBLC ​
EBLC:
EBLC|null
Defined in: src/font.ts:205
Embedded Bitmap Data Table. Stores bitmap images for specific point sizes.
Inherited from ​
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 ​
feat ​
feat:
feat|null
Defined in: src/font.ts:336
Feature Name Table. Maps AAT feature selectors to localised string references.
Inherited from ​
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 ​
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 ​
fvar ​
fvar:
fvar|null
Defined in: src/font.ts:342
Font Variations Table. Declares design axes and instance configurations in variable fonts.
Inherited from ​
gasp ​
gasp:
gasp|null
Defined in: src/font.ts:277
Grid-fitting and Scan-conversion Procedure Table. Optimises text raster rendering constraints.
Inherited from ​
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 ​
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 ​
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 ​
gvar ​
gvar:
gvar|null
Defined in: src/font.ts:348
Glyph Variations Table. Controls structural outline distortion transformations for variable glyphs.
Inherited from ​
hdmx ​
hdmx:
hdmx|null
Defined in: src/font.ts:283
Horizontal Device Metrics Table. Preserves explicit pixel width mappings optimising spacing.
Inherited from ​
head ​
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 ​
italicAngle ​
italicAngle:
number
Defined in: src/open-type-font.ts:85
Inherited from ​
JSTF ​
JSTF:
JSTF|null
Defined in: src/font.ts:259
Justification Table. Provides options for justification adjustments in complex scripts.
Inherited from ​
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 ​
kern ​
kern:
kern|null
Defined in: src/font.ts:288
Kerning Table. Contains traditional pairwise spacing adjustments.
Inherited from ​
layoutEngine ​
layoutEngine:
LayoutEngine
Defined in: src/font.ts:498
The shaping engine matching text scripts to font tables.
Inherited from ​
lineGap ​
lineGap:
number
Defined in: src/open-type-font.ts:82
Inherited from ​
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 ​
LTSH ​
LTSH:
LTSH|null
Defined in: src/font.ts:294
Linear Threshold Table. Sets pixel-per-em limits where scaling instructions degrade.
Inherited from ​
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 ​
name ​
name:
NonNullable<name|null>
Inherited from ​
StrictTables.name
numGlyphs ​
numGlyphs:
number
Defined in: src/open-type-font.ts:87
Inherited from ​
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 ​
OS/2 ​
OS/2:
NonNullable<OS2|null>
Inherited from ​
StrictTables.OS/2
outlines ​
readonlyoutlines:"PostScript"
Defined in: src/open-type-font.ts:136
Discriminator for the different outline types.
outlineVersion ​
readonlyoutlineVersion: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 ​
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 ​
prep ​
prep:
prep|null
Defined in: src/font.ts:166
Control Value Program Table. Provides global instructions establishing variable outline alignment.
Inherited from ​
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 ​
stream ​
stream:
DecodeStream
Defined in: src/font.ts:582
The raw input stream reading binary payload slices.
Inherited from ​
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 ​
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 ​
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 ​
VDMX ​
VDMX:
VDMX|null
Defined in: src/font.ts:306
Vertical Device Metrics Table. Preserves explicit vertical pixel height mappings.
Inherited from ​
version ​
version:
string|null
Defined in: src/font.ts:399
The font's version number or null if not present.
Inherited from ​
vhea ​
vhea:
vhea|null
Defined in: src/font.ts:312
Vertical Header Table. Stores global metric parameters for vertical text directions.
Inherited from ​
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 ​
VORG ​
VORG:
VORG|null
Defined in: src/font.ts:199
Vertical Origin Table. Specifies vertical coordinate origins for dynamic metrics scaling.
Inherited from ​
xHeight ​
xHeight:
number
Defined in: src/font.ts:442
Inherited from ​
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 ​
| Parameter | Type |
|---|---|
gid | number |
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 ​
Inherited from ​
Omit.createSubset
getAvailableFeatures() ​
getAvailableFeatures(
script,language?): keyofFeatures[]
Defined in: src/font.ts:540
An array of all OpenType feature tags supported by the font for a given script and language.
Parameters ​
| Parameter | Type |
|---|---|
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 ​
| Parameter | Type | Description |
|---|---|---|
glyph | number | the glyph id |
characters? | readonly number[] | an array of code points this glyph represents |
Returns ​
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 ​
| Parameter | Type | Description |
|---|---|---|
codePoint | number | the 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 ​
| Parameter | Type | Description |
|---|---|---|
str | string | the 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 ​
| Parameter | Type | Description |
|---|---|---|
codePoint | number | the 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 Parameter | Default type |
|---|---|
K extends string | string |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
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" | K | the 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 ​
| Parameter | Type | Description |
|---|---|---|
str | string | the string to encode |
userFeatures? | Features | keyof Features[] | an array of OpenType feature tags to be applied in addition to the default set. |
script? | OpenTypeTag | the script of the string |
language? | string | the language of the string |
direction? | BidiDirection | the writing direction for the string |
Returns ​
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 ​
| Parameter | Type | Description |
|---|---|---|
glyph | number | the glyph id |
characters? | readonly number[] | an optional sequence of codepoints |
Returns ​
Inherited from ​
Omit.safeGetGlyph
setDefaultLanguage() ​
setDefaultLanguage(
lang):void
Defined in: src/font.ts:614
Set the default language.
Parameters ​
| Parameter | Type |
|---|---|
lang | string | null |
Returns ​
void
See ​
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 ​
| Parameter | Type | Description |
|---|---|---|
gid | number | the glyph id |
Returns ​
string[]
Inherited from ​
Omit.stringsForGlyph