UNPKG

pdf-lib

Version:

Library for creating and modifying PDF files in JavaScript

25 lines (24 loc) 1.15 kB
import PDFDocument from '../../pdf-document/PDFDocument'; import { PDFDictionary, PDFHexString, PDFIndirectReference } from '../../pdf-objects'; import { IStandard14FontsUnion } from '../../pdf-document/Standard14Fonts'; import IPDFFontEncoder from '../../pdf-structures/factories/PDFFontEncoder'; /** * This Factory supports Standard fonts. Note that the apparent * hardcoding of values for OpenType fonts does not actually affect TrueType * fonts. * * A note of thanks to the developers of https://github.com/foliojs/pdfkit, * as this class borrows from: * https://github.com/foliojs/pdfkit/blob/f91bdd61c164a72ea06be1a43dc0a412afc3925f/lib/font/afm.coffee */ declare class PDFStandardFontFactory implements IPDFFontEncoder { static for: (fontName: IStandard14FontsUnion) => PDFStandardFontFactory; fontName: IStandard14FontsUnion; constructor(fontName: IStandard14FontsUnion); encodeText: (text: string) => PDFHexString; embedFontIn: (pdfDoc: PDFDocument) => PDFIndirectReference<PDFDictionary>; /** @hidden */ getWidths: () => never; getCodePointWidth: () => never; } export default PDFStandardFontFactory;