Fontforge color font plugin
FontForge_plugin for color fonts
OpenType color font is the technology used for emoji chiefly, and less frequently some fun fonts. There are several protocols and their support varies browser to browser.
Fontforge supports none but with other open-source tools color fonts can be created. This plugin provides frontend to such tools.
This plugin uses these programs as backend:
- fonttools
- scour SVG optimizer
- blackrenderer converts
COLRto SVG - svglib
- nanoemoji converts SVGs to
COLR
This module requires Python 3.10 or later.
Install
pip3 install fontforge_color_font
Make sure Fontforge Python module is usable
In interactive mode of Python, run:
import fontforge
If it raises ModuleNotFoundError exception, install Fontforge first. If
installed, make sure the build option set that the Python module gets also
installed. If already so, Python interpreter does not recognize the module
path where the required module.
export PYTHONPATH=/path/to/fontforge/python/module:$PYTHONPATH
Usage
Interactive usage
As a Fontforge plugin, fontforge_color_font adds 'Color Font' submenu to 'Tools' menu which is dedicated for plugins.
- Color Font
- Open color font...
- Export color font...
- Import SVG as color font glyph...
- Export SVG color font glyph...
- Delete SVG color font glyph
Open color font
Shows a dialog to open a color font.
COLR (both COLRv0 and COLRv1) and SVG tables are supported.
If the font has both COLR and SVG tables, which one to read will be asked.
Export color font
Shows a dialog where you can set output file name and other options.
COLRtable: None, Version 0, or 1- Select “None” not to include the table.
- Version 1 supports gradients while version 0 does not.
SVGtable: None, Uncompressed, or Compressed- Select “None” not to include the table.
- Some browsers support
SVGtable but other browsers supportCOLRtable. Including both can support as many environments as possible.
Import SVG as color font glyph
Reads an SVG document and stores into glyph metadata.
This menu is available both in font view and in (spline) glyph view.
In glyph view, select an SVG document.
Nominal width should match with glyph advance width, nominal height with
hhea ascender plus absolute value of hhea descender.
In font view and if single glyph is selected, does the same thing
as in glyph view.
If multiple glyphs are selected, select a directory.
SVG documents must be named same as glyph name except:
- uppercase letters other than code points (uniXXXX, uXXXXX, or u10XXXX): to work with case-insensitive file systems, an underscore must precede
- underscore itself: another underscore must precede for disambiguation
- same name as DOS/Windows reserved file names
For color glyph definitions, some SVG capability is prohibited. See Microsoft Typography site for details.
SVG data is stored in glyph.persistent['SVG'].
If there is already non-dict glyph.persistent,
it is deleted without warning.
Export SVG color font glyph
Exports SVG stored in glyph.persistent['SVG'].
This menu is available both in font view and in (spline) glyph view. Behaves similarly to “Import SVG as color font glyph” menu.
Delete SVG color font glyph
Deletes color glyph SVG.
This menu is available both in font view and in (spline) glyph view. Behaves similarly to “Import SVG as color font glyph” menu.
Hooks
This plugin installs new/open font hooks which does:
- sets font generation hooks to output color glyphs if exist
- Currently exports with COLRv1 and SVG.
- If
font.persistentis a dict and there isVFkey, won't exportSVGtable. This is because variable fonts do not supportSVGtable, but this plugin do not support variable color font.
- loads color glyph data if available
- If you load a color font from the ordinary ‘load’ menu,
COLRtable is preferred overSVG.
- If you load a color font from the ordinary ‘load’ menu,
Script usage
As a Python module, in addition to fontforge module, scripting to export
variable fonts from SFD projects will be possible.
import fontforge
import fontforge_color_font
# Open color font
font = fontforge_color_font.loadColorFont('MyColorFont.sfd')
font = fontforge_color_font.loadColorFont('MyColorFont.sfd', colrPreferred=False)
# Import SVG
fontforge_color_font.loadSvg(glyph, 'glyph.svg')
# Export SVG
fontforge_color_font.exportSvg(glyph, 'glyph.svg')
fontforge_color_font.exportSvg(glyph, 'glyph.svg', lambda x: x.replace('glyph', '_glyph'))
try:
fontforge_color_font.exportSvg(glyph, 'glyph.svg')
except NoColorGlyphError:
pass
# Delete SVG
fontforge_color_font.deleteSvg(glyph)
# Check if color glyph table exists
result = fontforge_color_font.hasColrTable(font)
result = fontforge_color_font.hasSvgTable(font)
# Check if color glyph SVG is stored
result = fontforge_color_font.svgIsRegistered(glyph)
# Export color font
fontforge_color_font.exportColorFont(font, 'MyColorFont.ttf', colr=1, svg=0)
fontforge_color_font.exportColorFont(font, 'MyColorFont.ttf', colr=1, svg=0, flags=('no-mac-names', 'opentype'))
Metadata
Release files for fontforge-color-font 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fontforge_color_font-0.4.0.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fontforge_color_font-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.6 kB
Release files / fontforge_color_font-0.4.0.tar.gz
| Download URL | fontforge_color_font-0.4.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f07469722a59d198eebc25dc5781f4732471f853f265a95fec8efea177e88ae5
|
|
BLAKE2b-256 checksum How to use checksums |
7840db5917a739b170613373e274d09714a47ffea79ef1d7f7458c9f62873f57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / fontforge_color_font-0.4.0-py3-none-any.whl
| Download URL | fontforge_color_font-0.4.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a54284889eec154c766e5ebdd56691a87b6ba8f6d7e79d42841094747441af0
|
|
BLAKE2b-256 checksum How to use checksums |
2ddf3357c471971fede8d23a770cbfd8e474d6d61818e312f463d47d265479ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency log