Skip to main content

The FEZ language: Font Engineering made eaZy

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fez-language-1.3.3.tar.gz (900.5 kB view details)

Uploaded Source

Built Distribution

fez_language-1.3.3-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file fez-language-1.3.3.tar.gz.

File metadata

  • Download URL: fez-language-1.3.3.tar.gz
  • Upload date:
  • Size: 900.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.14

File hashes

Hashes for fez-language-1.3.3.tar.gz
Algorithm Hash digest
SHA256 5af622bb7a3730e8a14fa1d5bb1cdc7e1b40dbc42d5a2b3b5ef39430ea68171d
MD5 209de33f2b94a7e6566d02f8ebf9b0ff
BLAKE2b-256 2e39ccd5fc42a7bf8933a0350b802c56d0282e803f10ccb0758d2fd2273d0818

See more details on using hashes here.

File details

Details for the file fez_language-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: fez_language-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.14

File hashes

Hashes for fez_language-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c57adc3c8ad492783c89267bb153919707a50abd32b0e934a5bb051cf253d3cd
MD5 b9f75df788436ab95f62c3b1737d66ff
BLAKE2b-256 619dd4952601551d57f7602da22491b6827590731aca7f0f6bd5261cad9ab00e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page