Package Exports
- svg2ttf
- svg2ttf/lib/svg
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svg2ttf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
svg2ttf
Converts SVG fonts to TTF format. It was initially written for Fontello, but you can find it useful for your projects.
For developpers:
Internal API is similar to FontForge's one. Since primary goal is generating iconic fonts, sources can lack some specific TTF/OTF features, like kerning and so on. Anyway, current code is a good base for development, because it will save you tons of hours to implement correct writing & optimizing TTF tables.
Using from CLI
Install:
npm install -g svg2ttf
Usage example:
svg2ttf fontello.svg fontello.ttf
API
svg2ttf(svgFontString, options) -> buf
svgFontString
- SVG font contentoptions
copyright
- copyright string (optional)description
- description string (optional)ts
- Unix timestamp (in seconds) to override creation time (optional)url
- manufacturer url (optional)version
- font version string, can beVersion x.y
orx.y
.
buf
- internal byte buffer object, similar to DataView. It'sbuffer
property isUin8Array
orArray
with ttf content.
Example:
var fs = require('fs');
var svg2ttf = require('svg2ttf');
var ttf = svg2ttf(fs.readFileSync('myfont.svg', 'utf8'), {});
fs.writeFileSync('myfont.ttf', new Buffer(ttf.buffer));
svg2ttf for enterprise
Available as part of the Tidelift Subscription.
The maintainers of svg2ttf
and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.