image3font

A image's converter to font written in Fontforge/FontTools's Hy script.


Keywords
fontforge, color-font, fonttools, glyph, imagemagick, opentype, svg
License
GPL-3.0
Install
pip install image3font==1.1.3

Documentation

Image3font

travis-badge project-badge license-badge

A image's converter to font written in FontForge/FontTools' Hy language and the futur of image2font's repository.

Installation

The image3font package is listed in the Python Package Index (PyPI), so you can install it with pip:

pip install image3font

Usage

See command help:

  • -h, --help - show this help message and exit.
  • -v, --version - show the version and exit.
  • -m MANIFEST, --manifest MANIFEST - specify the manifest.

Layout

Image3font uses conventions for file placement:

image3font.toml
src/
src/{:hex}.{svg,jpeg,...}
src/{:hex}-{:y}-{:x}.svg (need the wand dependency)
  • image3font.toml stores in the root of your project.
  • image goes in the src directory.

Dependency

Requirement

The requirements.txt describes the image3font's dependencies:

  • hy - A dialect of Lisp that's embedded in Python.
  • fonttools - A library to manipulate font files from Python.
  • docopt - Pythonic command line arguments parser.
  • toml - Python lib for TOML.
  • wand - The ctypes-based simple ImageMagick binding for Python (tested on imagemagick6 6.9.9.33-1).

Manifest

The image3font.toml file for each font is called its manifest. Every manifest file consists of two fields and two sections:

  • path (optional) Fontpath of input font. If not specified this will be infered from a empty font.

  • source (default = "src") Can be used to configure the SVG's directory.

[fontforge]'s section

List of fields according to FontForge/Script's specification.

  • path

Path where save the compiled font.

  • fontname

Name contained in the postscript FontName field.

  • familyname (default = "fontname")

Name contained in the postscript FamilyName field. If not specified this will be inferred as fontname.

  • fullname (default = "fontname")

Name contained in the postscript FullName field. If not specified this will be inferred as fontname.

  • weight (optional)

Name contained in the postscript Weight field.

  • copyright (optional)

Name contained in the postscript Notice field.

  • version (optional)
  • encoding (default = "UnicodeFull")
  • em (default = 2028)

[fonttools]'s section

List of fields according to FontTools/Name-IDs's specification.

  • copyright

Copyright string from the font vendor. © Copyright the Monotype Corporation plc, 1990.

  • familyname

Name the user sees. Times New Roman

  • subfamilyname

Name of the style. Bold

  • unique_id

A unique identifier that applications can store to identify the font being used. Monotype: Times New Roman Bold:1990

  • full_name

Complete, unique, human readable name of the font. This name is used by Windows. Times New Roman Bold

  • version

Release and version information from the font vendor. Version 1.00 June 1, 1990, initial release.

  • postscript_name

Name the font will be known by on a PostScript printer. TimesNewRoman-Bold

  • trademark

Trademark string. Times New Roman is a registered trademark of the Monotype Corporation.

  • manufacturer

Manufacturer. Monotype Corporation. plc

  • designer

Designer. Stanley Morison

  • description

Description. Designed in 1932 for the Times of London newspaper. Excellent readability and a narrow overall width, allowing more words per line than most fonts.

  • url_vendor

URL of Vendor. http://www.monotype.com

  • url_designer

URL of Designer. http://www.monotype.com

  • license

License Description. This font may be installed on all of your machines and printers, but you may not sell or give these fonts to anyone else.

Preferred Family. No name string present, since it is the same as name ID 1 (Font Family name).

  • preferred_subfamilyname

Preferred Subfamily. No name string present, since it is the same as name ID 2 (Font Subfamily name).

  • compatible_full

Compatible Full (Macintosh only). No name string present, since it is the same as name ID 4 (Full name).

  • sample_text

Sample text. quick brown fox jumps over the lazy dog.

  • postscript_cid

PostScript CID findfont name. No name string present. Thus, the PostScript Name defined by name ID 6 should be used with the "findfont" invocation for locating the font in the context of a PostScript interpreter.

  • wws_familyname

WWS family name: Since Times New Roman is a WWS font, this field does not need to be specified. If the font contained styles such as "caption", "display", "handwriting", etc, that would be noted here.

  • wws_subfamilyname

WWS subfamily name: Since Times New Roman is a WWS font, this field does not need to be specified.

  • light_background

Light background palette name. No name string present, since this is not a color font.

  • dark_background

Dark background palette name. No name string present, since this is not a color font.

  • variations_postscript

Variations PostScript name prefix. No name string present, since this is not a variable font.

Knowledge

This is a reading list of material relevant to Image3Font. It includes prior research that has - at one time or another - influenced the design of image3font, as well as publications about imag3font.

License

Image3font's code in this repo uses the GNU GPL v3 license.

Dependencies

Many thanks goes to command/etc's project: