import * as em from "./Enums"; import { ObjectManager } from "./ObjectManager"; import { ObjectBase } from "./ObjectBase"; /** * Represents a TrueType or OpenType font. **/ export declare class Font extends ObjectBase { /** * Creates a {@link Font} instance from a byte array. * @param fontBytes The binary data of the font. * @returns A new instance of the {@link Font}. **/ static load(fontBytes: Uint8Array): Font; /** * Creates a {@link Font} instance from a byte array. * @param om An object manager that controls the lifetime of the {@link Font} object. * @param fontBytes The binary data of the font. * @returns A new instance of the {@link Font}. **/ static load(om: ObjectManager, fontBytes: Uint8Array): Font; /** * Loads all {@link Font}s from a byte array containing single font or a font collection. * @param fontBytes The byte array with the font data. * @returns The array of loaded {@link Font}s. **/ static loadCollection(fontBytes: Uint8Array): Font[]; /** * Loads all {@link Font}s from a byte array containing single font or a font collection. * @param om An object manager that controls the lifetime of the {@link Font} objects. * @param fontBytes The byte array with the font data. * @returns The array of loaded {@link Font}s. **/ static loadCollection(om: ObjectManager, fontBytes: Uint8Array): Font[]; /** * Returns an instance of the standard PDF font. * @param standardPdfFont Specifies one of the standard PDF fonts. * @returns A new instance of the {@link Font}. **/ static getPdfFont(standardPdfFont: em.StandardPdfFont): Font; /** * Returns an instance of the standard PDF font. * @param om An object manager that controls the lifetime of the {@link Font} object. * @param standardPdfFont Specifies one of the standard PDF fonts. * @returns A new instance of the {@link Font}. **/ static getPdfFont(om: ObjectManager, standardPdfFont: em.StandardPdfFont): Font; /** * Indicates if the current font contains PostScript outlines. **/ get isPostScript(): boolean; /** * Indicates if the font is in WOFF format. **/ get isCompressed(): boolean; /** * Indicates if the font was loaded from .ttc or .otc font collection. **/ get isCollection(): boolean; /** * The full font name that reflects all family and relevant subfamily descriptors. **/ get fullFontName(): string; /** * The font family name. Up to four faces can share the same font family name. **/ get fontFamily(): string; /** * The typographic family grouping name. **/ get typographicFamilyName(): string; /** * The PostScript name of the font. **/ get postScriptName(): string; /** * The version set by font manufacturer. **/ get version(): string; /** * The revision number set by font manufacturer. **/ get revision(): number; /** * The Copyright notice of the font. **/ get copyrightNotice(): string; /** * The description of the license or licenses under which the font is provided. **/ get licenseDescription(): string; /** * The URL where additional licensing information can be found. **/ get licenseInfoURL(): string; /** * False if the font is proportionally spaced, True if the font is not proportionally * spaced (i.e. monospaced). **/ get isFixedPitch(): boolean; /** * Indicates if this is a vertical font. **/ get isVerticalFont(): boolean; /** * Indicates if this font contains color glyphs. **/ get isColorFont(): boolean; /** * The italic angle in counter-clockwise degrees from the vertical. Zero for upright * text, negative for text that leans to the right (forward). **/ get italicAngle(): number; /** * Indicates whether this font can be embedded. **/ get canEmbed(): boolean; /** * Indicates whether this font can be serialized as a subset of the source font data. **/ get canSubset(): boolean; /** * The visual weight (degree of blackness or thickness of strokes) of the characters * in the font. Values from 1 to 1000 are valid. **/ get weightClass(): number; /** * Indicates a relative change from the normal aspect ratio (width to height ratio) for * the glyphs in a font. Values from 1 (Ultra Condensed) to 9 (Ultra Expanded) are expected. **/ get widthClass(): number; /** * The value of the Bold flag from the OS/2 font table data. **/ get bold(): boolean; /** * The value of the Italic flag from the OS/2 font table data. **/ get italic(): boolean; /** * The value of the Oblique flag from the OS/2 font table data. **/ get oblique(): boolean; /** * Indicates if characters are underscored. **/ get underscore(): boolean; /** * Indicates if characters are overstruck. **/ get strikeout(): boolean; /** * Indicates if characters have their foreground and background reversed. **/ get negative(): boolean; /** * Indicates if characters are hollow (outlined), otherwise they are solid. **/ get hollow(): boolean; /** * Indicates if the glyphs encoded in the cmap subtables are simply generic symbolic representations * of code point ranges and don't truly represent support for those code points. **/ get lastResort(): boolean; /** * Indicates whether the font-family design reflects the ISO Sans Serif Class. **/ get isSansSerif(): boolean; /** * Indicates whether the font-family design reflects any of the Serif classes, except Sans Serif. **/ get isSerifFont(): boolean; /** * Indicates whether the font-family design reflects the ISO Ornamental Class and * the ISO Blackletter Class. **/ get isOrnamentalFont(): boolean; /** * Indicates whether the font-family design reflects the ISO Script Class and Uncial Class. **/ get isScriptFont(): boolean; /** * Indicates whether this is a symbolic font suitable for Pi and special characters (icons, * dingbats, technical symbols, etc.) **/ get isSymbolicFont(): boolean; /** * The design units per Em, valid range is from 16 to 16384. **/ get unitsPerEm(): number; /** * The Average Character Width parameter specifies the arithmetic average of * the escapement (width) of all non-zero width glyphs in the font. **/ get avgCharWidth(): number; /** * The metric specifying the distance between the baseline and the approximate * height of uppercase letters. **/ get capHeight(): number; /** * The metric specifying the distance between the baseline and the approximate height * of non-ascending lowercase letters. **/ get smallXHeight(): number; /** * The typographic or legacy ascender for this font. **/ get horizontalAscender(): number; /** * The typographic or legacy descender for this font. **/ get horizontalDescender(): number; /** * The typographic or legacy line gap for this font. **/ get horizontalLineGap(): number; /** * The vertical typographic ascender for this font. **/ get verticalAscender(): number; /** * The vertical typographic descender for this font. **/ get verticalDescender(): number; /** * The vertical typographic gap for this font. **/ get verticalLineGap(): number; /** * The number of glyphs in this font. **/ get numGlyphs(): number; /** * Returns a value indicating whether the font can map the specified UTF-32 character to a glyph. * @param codePoint The UTF-32 characer (code point) to check. * @returns true if the font can map the character to a glyph, false otherwise. **/ containsCodePoint(codePoint: number): boolean; /** * Gets or sets a value indicating if the Bitmap Glyph Cache is enabled. **/ get useBitmapCache(): boolean; /** * Gets or sets a value indicating if the Bitmap Glyph Cache is enabled. **/ set useBitmapCache(value: boolean); /** * Gets or sets a value indicating if the TrueType glyph hinting instructions can be executed. **/ get enableHinting(): boolean; /** * Gets or sets a value indicating if the TrueType glyph hinting instructions can be executed. **/ set enableHinting(value: boolean); /** * Gets or sets a value indicating that the developer of the software has obtained explicit * permission from the legal owner of the font to embed it in documents produced by the software. **/ get permissionToEmbedGranted(): boolean; /** * Gets or sets a value indicating that the developer of the software has obtained explicit * permission from the legal owner of the font to embed it in documents produced by the software. **/ set permissionToEmbedGranted(value: boolean); /** * Indicates whether the current font has linked fonts. **/ get hasLinkedFonts(): boolean; /** * Adds a linked font to the current font. * @param font The Font to be added as linked font. * @param scaleFactor The scale factor applied to size of the base font when the linked font is used instead. **/ addLinkedFont(font: Font, scaleFactor?: number | null): void; /** * Removes a linked font from the current font. * @param font The Font to be removed from the list of linked fonts. **/ removeLinkedFont(font: Font): void; /** * Clears the list of linked fonts. **/ clearLinkedFonts(): void; }