Coder Social home page Coder Social logo

fontgen's Introduction

FontGen

A simple utility application that takes a TTF file and converts it into a .pgm along with a text file describing which character maps to which coordinates.

Arguments

  • TTFFILE: filename of the .ttf (or any other format supported by freetype)

  • SIZE: size of the font (in pixel?!)

  • BORDER: an border that is left around each glyph, useful when one wants to add effects such as shadow or a black border

  • IMAGEWIDTH: width of the resulting image

  • IMAGEHEIGHT: height of the temporary image (ugly, but needed at the moment)

  • UNICODES: optional list of characters that shall be generated, default is the whole font

Example

Running:

build/fontgen generate AMRIGOM.TTF  16 2 512 512 "$(build/fontgen listchars AMRIGOM.TTF)"

Will produce a file /tmp/out.pgm:

Font Example

And a font description /tmp/out.font:

(pingus-font
  (size 16)
  (glyph-count 257)
  (glyphs
    (glyph (unicode 9674) (offset 0 -13) (advance 8) (rect 0 0 12 21)) ;; ◊
    (glyph (unicode 124) (offset 3 -12) (advance 8) (rect 12 0 17 20)) ;; |
    (glyph (unicode 123) (offset 2 -12) (advance 8) (rect 17 0 26 19)) ;; {
    (glyph (unicode 91) (offset 1 -11) (advance 4) (rect 26 0 32 19)) ;; [
    (glyph (unicode 93) (offset 1 -11) (advance 4) (rect 32 0 38 19)) ;; ]
    (glyph (unicode 209) (offset 0 -15) (advance 10) (rect 38 0 52 19)) ;; Ñ
    (glyph (unicode 402) (offset -1 -11) (advance 8) (rect 52 0 65 19)) ;; ƒ
    ....

fontgen's People

Contributors

grumbel avatar

Watchers

 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.