GithubHelp home page GithubHelp logo

b-g / scfbuild Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 13rac1/scfbuild

2.0 3.0 0.0 79 KB

Create SVG in OpenType color fonts from a set of SVG source files.

License: GNU General Public License v3.0

Python 98.52% Dockerfile 1.48%

scfbuild's Introduction

SVGinOT Color Font Builder

Create color fonts from SVGs on the command line

scfbuild creates SVG in OpenType color fonts directly from a set of source SVG files greatly simplifying the process of creating a custom color font.

Regular color and standard character glyphs are named by Unicode code point (e.g. 1f60e.svg). Ligatures are named by code points separated by a hyphen - (e.g.1f441-1f5e8.svg). Note: Color glyphs cannot exist alone, they must replace existing standard glyphs.

The generated fonts work in all operating systems, but will currently only show color glyphs in Mozilla Firefox and Thunderbird. This is not a limitation of the generated fonts, but of the operating systems and applications. Only the SVG in OpenType color font format is supported. The Apple, Google, and Microsoft color font formats are not supported.

Examples

What is SVGinOT?

SVG in Open Type is a standard by Adobe and Mozilla for color OpenType and Open Font Format fonts. It allows font creators to embed complete SVG files within a font enabling full color and even animations. There are more details in the SVGinOT proposal and the OpenType SVG table specifications.

SVGinOT Demos (Firefox only):

Usage - Linux

Required Python libraries:

  • FontTools 2.5+
  • FontForge
  • lxml

Run: bin/scfbuild

$ bin/scfbuild --help
usage: scfbuild [-h] [-o OUTPUT] [-g DIR] [-s DIR] [--transform TRANSFORM]
                [--font-family FAMILY] [--font-subfamily SUBFAMILY]
                [--font-version FONT_VERSION] [-c YAML_CONF] [-v] [-V]

SCFBuild - SVGinOT Color Font Builder 1.x.x

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        output font file
  -g DIR, --glyph-svg-dir DIR
                        directory of regular no-color SVG glyphs to add to the
                        font
  -s DIR, --color-svg-dir DIR
                        directory of SVGinOT color SVG glyphs to add to the
                        font.
  --glyph-only					generate font with no-color SVG glyphs only 
  --transform TRANSFORM
                        add a transform to the <svg> tag of each color SVG.
                        Example "translate(0 -1638) scale(2.048)"
  --font-family FAMILY  family name for the font. default: Untitled
  --font-subfamily SUBFAMILY
                        weight/style for the font. default: Regular
  --font-version FONT_VERSION
                        version number for the font. default: 1.0
  -c YAML_CONF, --yaml-conf YAML_CONF
                        yaml build configuration, overridden by command line
                        options.
  -v, --verbose         print detailed debug information
  -V, --version         print version information

Docker

If you don't want to install the required Python libraries from above locally on your machine, then you can use the provided Docker container, which bundles nicely all requirements.

  1. Install Docker

  2. Either A) build the container on your onw: docker build -t scfbuild . or B) pull the latest published container: docker pull ghcr.io/b-g/scfbuild/scfbuild:latest

  3. Run and share folder with container:

$ cd path/to/repo/scfbuild
$ docker run --interactive --tty --rm --volume $PWD:/wd --workdir /wd scfbuild:latest bash
# now you can use bin/scfbuild via the docker container
$ bin/scfbuild --help

Other Tools

scfbuild softens the learning curve for font creation, but cannot replace more advanced tools. Here are some starting points if you need more features, although none support color fonts at this time:

License

SCFBuild is released under the GNU General Public License v3. See LICENSE.txt in the project root directory.

scfbuild's People

Contributors

13rac1 avatar b-g avatar crissov avatar deedeeg avatar mavit avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.