Giter Club home page Giter Club logo

simple-svg-to-font-with-fontforge's Introduction

Simple-SVG-to-Font-with-Fontforge

This script uses FontForge to build a very basic monochrome font from a folder of SVG files. Each SVG file must be named with the codepoint of the unicode character it is to be mapped to. EG 1F94B.svg If a glyph maps to a sequence of codepoints, seperate the codepoints with - in the SVG file's name. EG 1F468-200D-1F9B3.svg If there are codepoints which are part of a sequence but lack their own SVG, then placeholder geometry is used.

See here for documentation about FontForge's scripting library: https://fontforge.org/docs/scripting/python/fontforge.html

Requirements

FontForge, and its included python installation.

Use

  1. Adjust the global parameters in the first section of build_simple_black_font_with_fontforge.py
  2. type fontforge -script build_simple_black_font_with_fontforge.py in the terminal.

By default, the script reads files from the svg folder. Several example files have been included therein.

Limitations

  • Fonts are monochrome only. Building color fonts requires a more advanced tool like nanoemoji
  • Source svgs need to all have the same size viewbox for best results. (Fontforge can be set up to autoscale imported outlines, but that was giving me strange results, and so this script does not take advantage of that functionality.)
  • One of the svg files must be specified as the placeholder geometry, which is to be used when ligatures contain a codepoint without an associated file.
  • Sometimes the outlines combine in unintended ways when overlapping. It may be helpful to combine objects in the svg before building the font.

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.