Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bramstein/opentype
An OpenType, TrueType, WOFF, and WOFF2 parser in JavaScript
https://github.com/bramstein/opentype
Last synced: 30 days ago
JSON representation
An OpenType, TrueType, WOFF, and WOFF2 parser in JavaScript
- Host: GitHub
- URL: https://github.com/bramstein/opentype
- Owner: bramstein
- Archived: true
- Created: 2013-09-05T12:01:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-05-16T12:17:07.000Z (over 2 years ago)
- Last Synced: 2024-04-14T09:56:21.758Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 530 KB
- Stars: 133
- Watchers: 14
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-typography - OpenType - OpenType font parser in JavaScript. (JavaScript)
- awesome-inspiration - opentype
README
## DEPRECATED: An OpenType font parser in JavaScript
*This package is deprecated, please use [OpenType.js](https://opentype.js.org/), [Fontkit](https://github.com/foliojs/fontkit), or [lib-font](https://github.com/Pomax/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)
* gaspThis 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.