Skip to main content

FEZ — Font Engineering made eaZy

fez

I wear a fez now. Fezzes are cool.

The FEZ language is implemented via a Python library, fontFeatures. This format improves over Adobe FEA (.fea) in several important ways, and compiles to FEA or to raw GPOS/GSUB binary tables.

FEZ Quickstart

Class definition is a time consuming element of writing FEA code. FEZ allows regular expressions to be used to define classes; each glyph name in the font is tested against the regular expression, and the glyphs added:

DefineClass @sc = /\.sc$/;

Ran as:

fez2fea tests/LibertinusSans-Regular.otf test.fez

Results in:

@sc = [parenleft.sc parenright.sc bracketleft.sc bracketright.sc ...];

Simple replacement can be done as easily as:

DefineClass @sc = /\.sc$/;
DefineClass @sc_able = @sc~sc;

Feature smcp {
	Substitute @sc_able -> @sc;
};

Quite complex classes can be built. All the glyphs which have a smallcap and alternate form:

DefineClass @sc_and_alt_able = /.*/ and hasglyph(/$/ .alt) and hasglyph(/$/ .sc);

Returning:

@sc_and_alt_able = [h y germandbls];

FEZ can even do substitutions impossible in FEA. For example:

DefineClass @digits =    U+0031=>U+0039; # this is range(U+0031, U+0039) inclusive
DefineClass @encircled = U+2474=>U+247C;

# Un-CJK parenthesize
Feature ss01 {
	Substitute @encircled -> parenleft @digits parenright;
};

Gives us:

feature ss01 {
    lookup Routine_1 {
            sub uni2474 by parenleft one parenright;
            sub uni2475 by parenleft two parenright;
            sub uni2476 by parenleft three parenright;
            sub uni2477 by parenleft four parenright;
            sub uni2478 by parenleft five parenright;
            sub uni2479 by parenleft six parenright;
            sub uni247A by parenleft seven parenright;
            sub uni247B by parenleft eight parenright;
            sub uni247C by parenleft nine parenright;
    } Routine_1;
} ss01;

FEZ can do much more; see the standard verbs documentation and the optional plugins. Writing your own plugins is as simple as defining its grammar, verb, and adding a class with an action() method.

Contributors

See the CONTRIBUTORS.txt file for the full list of contributors. Major contributions are described below:

  • FEZ was originally written by Simon Cozens
  • Fred Brennan contributed a new parser and documentation updates

Metadata

Release files for fez-language 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fez-language 1.5.0
File Size Uploaded Provenance Actions
fez_language-1.5.0.tar.gz 901.1 kB Without provenance Details for fez_language-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fez-language 1.5.0
File Interpreter ABI Platform Actions
fez_language-1.5.0-py3-none-any.whl Python 3 none any Details for fez_language-1.5.0-py3-none-any.whl

Total release size: 952.4 kB

Release files / fez_language-1.5.0.tar.gz

Download URL fez_language-1.5.0.tar.gz
Size 901.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63745bb7a4bf8187ceef6ca62ae58b0e1984a66d7b2cd5d4460fe57563326e5a
BLAKE2b-256 checksum
How to use checksums
8f51c32b07f871ca5483eea0ee2fafd40c247db90d5642be2c7d54d478a44613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / fez_language-1.5.0-py3-none-any.whl

Download URL fez_language-1.5.0-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54dec0886b607ae5a1f69f49c933c456da28e754cd31b7b51e9d5d726db8c796
BLAKE2b-256 checksum
How to use checksums
dc994df2a04b2d40f51373bf6df5ea3876820a0a99724a27574febe3c02c236f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for fez-language 1.5.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page