Giter Site home page Giter Site logo

svg2ttf's Introduction

svg2ttf

CI NPM version

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 content
  • options
    • 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 be Version x.y or x.y.
  • buf - internal byte buffer object, similar to DataView. It's buffer property is Uin8Array or Array 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.

svg2ttf's People

Contributors

snb2013 avatar kirill89 avatar sabberworm avatar rlidwka avatar greenkeeper[bot] avatar nfroidure avatar phated avatar arzafran avatar liuji-jim avatar wncm avatar ysds avatar cyberalien avatar rchaser53 avatar robmadole avatar ryadbkr avatar yisibl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.