Fontaine font tool
Project description
pyfontaine analyses fonts for their language and character/glyph-set support.
It has a straightforward pythonic set definition format:
Additional definitions are downloaded from the Extensis, font-config and Unicode websites during installation, and can be updated without reinstalling.
Adding your own definitions is easy. All files in the internals directory are auto-detected, so just add definition files there.
Installation
On Mac OS X, install the pyicu dependency as follows:
CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu;
Install the latest release easily with the pip installer:
sudo pip install fontaine
To install the latest development version:
sudo pip install https://github.com/davelab6/pyfontaine.git;
Usage
Given a list of space separated font filenames, it returns a report with some general metadata and a language support analysis:
sh pyfontaine font.ttf;
Given a list of space separated unicode characters, or unicode values, it returns a list of character sets that include that character:
pyfontaine 0x0061; pyfontaine ğ ø ∂;
To output font reports in various formats:
pyfontaine --xml font.ttf; pyfontaine --json font.ttf; pyfontaine --csv font.ttf; pyfontaine --wiki font.ttf;
The –wiki format produces a MediaWiki table (example <https://en.wikipedia.org/wiki/DejaVu_fonts#Unicode_coverage>__)
To only show character sets from different collections:
pyfontaine --collections all font.ttf; # default pyfontaine --collections pyfontaine font.ttf; pyfontaine --collections uniblocks font.ttf; pyfontaine --collections extensis font.ttf; pyfontaine --collections fontconfig font.ttf; pyfontaine --collections cldr font.ttf; pyfontaine --collections subsets font.ttf;
To only show specific character sets:
pyfontaine --set African,'Basic Latin','GWF vietnamese' font.ttf;
To print a list of all the missing unicode values from each set:
pyfontaine --missing font.ttf;
To output visualisations of the coverage using Hilbert curves (thanks for the idea, Øyvind ‘pippin’ Kolås!):
sh pyfontaine –coverage font.ttf; ls -l coverage_pngs/;
The PNG files are stored in a new directory, coverage_pngs, under the current directory.
Update collection data
You can update remote collections data when you are online:
python –update-data 1;
Python Module
It has a python module. Here is an example script from the Font Bakery project.
Contributing
Your contributions under the GPLv3 are welcome!
pyfontaine is a python reimplementation of Fontaine by Ed Trager, and has been made by by Vitaly Volkov, Dave Crossland and Mikhail Kashkin.
Thanks
We would like to thank some upstream projects that make pyfontaine even more useful: * Thomas Phinney for the WebINK Character Sets * Behdad Esfabod for the font-config languages definitions * Unicode Consortium for the Unicode Blocks
Dependencies
Mac OS X requires the XCode Command Line Tools to be installed
fonttools (common) or freetype-py (fast)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fontaine-1.3.4.tar.gz
.
File metadata
- Download URL: fontaine-1.3.4.tar.gz
- Upload date:
- Size: 5.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73dd1d20ebadae6047e45a47ec48740246b5e0c430ee8d7f623725d6c16c66a |
|
MD5 | 933b0814127ac05a6300197f7ae66c0f |
|
BLAKE2b-256 | 98c665ef641a10e089665aa49857f614f6e9ddddc08482b7664086cbe5b4d0e5 |