A image's converter to font written in FontForge/FontTools' Hy language and the futur of image2font's repository.
The image3font package is listed in the Python Package Index (PyPI), so you can install it with pip:
pip install image3font
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.
Image3font uses conventions for file placement:
image3font.toml
src/
src/{:x}.svg
src/{:x}-.svg (need the wand dependency)
- image3font.toml stores in the root of your project.
- image/SVG goes in the src directory.
- fontforge must be installed.
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.
The requirements-wand.txt is optional, that needed to extract a sub-rectangle from an image/SVG:
- wand - The ctypes-based simple ImageMagick binding for Python (tested on imagemagick6 6.9.9.33-1).
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.
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)
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.
-
url_license License Info URL. http://www.monotype.com/license
-
reserved Reserved.
-
preferred_familyname
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.
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.
-
SVG in OpenType - SVG Glyphs in OpenType Specification.
-
Otspec - OpenType specification.
-
FontForge scripting Writing scripts to change fonts in FontForge.
-
Adobe Opentype Adobe OpenType feature.
Image3font's code in this repo uses the GNU GPL v3 license.
Many thanks goes to command/etc's project: