Giter VIP home page Giter VIP logo

fontconv's Introduction

fontconv

Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).

Installation

Deno

deno install -fr --allow-read --allow-write --name fontconv -g \
https://raw.githubusercontent.com/marmooo/fontconv/main/cli.js

Node

npm install fontconv -g

Usage

import { convert } from "fontconv";

const options = { text: "abcdef" };
const inFont = Deno.readFileSync(inPath);
const outFont = await convert(inFont, ".woff2", options);
Deno.writeFileSync(outPath, outFont);

CLI

Usage: fontconv [options] <input> <output>

Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).

Arguments:
  input                   Path of input font file
  output                  Path of output font file

Options:
  -V, --version           output the version number
  --text <string>         characters to compress
  --text-file <path>      Path of line separated character file to compress
  --code <string>         comma separated codepoints to compress
  --code-file <path>      Path of line separated codepoint file to compress
  --name <string>         comma separated glyph names to compress
  --name-file <path>      Path of line separated glyph name file to compress
  --ligature <string>     comma separated ligatures to compress
  --ligature-file <path>  Path of line separated ligature file to compress
  --remove-ligatures      remove ligatures associated with the glyphs
  -h, --help              display help for command

Examples

fontconv in.ttf out.woff
fontconv in.woff2 out.otf
fontconv --text abcdef in.ttf out.woff2
fontconv --text-file charaters.lst in.ttf out.woff2
fontconv --code 0x61,98 in.ttf out.woff2
fontconv --code-file codepoints.lst in.ttf out.woff2
fontconv --name alarm,box in.otf out.woff
fontconv --name-file names.lst in.otf out.woff
fontconv --ligature home,menu --remove-ligatures in.otf out.woff
fontconv --ligature-file ligatures.lst in.otf out.woff

codepoints.lst

0xe88a
59448

License

MIT

fontconv's People

Contributors

marmooo avatar

Stargazers

tong chao avatar hiro avatar

Watchers

 avatar

fontconv's Issues

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.