A JavaScript library for parsing, manipulating, and generating OpenType and TrueType fonts.
opentype.js is a JavaScript library that parses, manipulates, and generates OpenType and TrueType fonts. It allows developers to read font files, extract glyph data, create custom fonts from scratch, and render text as scalable vector paths. It solves the problem of programmatically working with complex font formats in web and Node.js applications.
Frontend developers, creative coders, and designers building typography tools, font editors, or custom text rendering pipelines in JavaScript environments.
Developers choose opentype.js for its comprehensive support of OpenType features (including variable and color fonts), its pure JavaScript implementation that works across browsers and Node.js, and its low-level API that provides fine-grained control over font data.
Read and write OpenType fonts using JavaScript.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses and manipulates WOFF, OTF, TTF fonts with TrueType and PostScript outlines, including variable and color fonts (COLR/CPAL), as detailed in the Features section.
Runs consistently in both browser and Node.js environments, enabling server-side font processing and client-side rendering, as emphasized in the README.
Provides granular control over glyphs, paths, kerning, and font properties, allowing programmatic font creation and editing, as shown in the 'Craft a font' example.
Manages OpenType variation axes and instances through the Font.variation object, supporting dynamic font adjustments without external dependencies.
WOFF2 decompression requires an external library like wawoff2, adding setup complexity and potential bundle size increase, as admitted in the README's loading section.
Focuses on low-level font data rather than providing text layout utilities (e.g., line wrapping), forcing developers to implement such features manually.
Parsing and manipulating large font files can be memory-intensive and slow in JavaScript, especially for real-time applications, with only optional low memory mode as a mitigation.