Opentype
An OpenType, TrueType, WOFF, and WOFF2 parser in JavaScript
Install / Use
/learn @bramstein/OpentypeREADME
DEPRECATED: An OpenType font parser in JavaScript
This package is deprecated, please use OpenType.js, Fontkit, or lib-font instead.
This is a pure JavaScript parser for OpenType font files. It supports fonts with CFF and TrueType outlines, and can read fonts wrapped as WOFF and WOFF2.
The following OpenType tables are currently supported:
- CMAP (only format 0, 4, 12, and 13)
- head
- hhea
- maxp
- hmtx
- name
- OS/2
- post
- GSUB (excluding LookupType 5, 6, 7, and 8)
- GDEF (only the Glyph Class Definitions)
- gasp
This roughly corresponds to all the metadata available in most fonts. I'm hoping to add support for glyf, CFF, and related tables time permitting.
Usage
npm install opentype
var opentype = require('opentype');
var fs = require('fs');
fs.readFile('font.otf', function (err, data) {
var font = opentype.parse(data);
});
Copyright and License
This library is licensed under the three-clause BSD license. Copyright 2013-2016 Bram Stein. All rights reserved.
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
