# FEZ — Font Engineering made eaZy
![fez](fez.png)
*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:
```sh
fez2fea tests/LibertinusSans-Regular.otf test.fez
```
Results in:
```fea
@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:
```fea
@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:
```fea
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](https://fez.readthedocs.io/en/latest/syntax.html#standard-verbs) and the [optional plugins](https://fez.readthedocs.io/en/latest/optionalverbs.html). Writing your own plugins is as simple as [defining its grammar, verb, and adding a class with an `action()` method](https://fez.readthedocs.io/en/latest/plugins.html).
## Contributors
See the [CONTRIBUTORS.txt](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
Raw data
{
"_id": null,
"home_page": "https://github.com/simoncozens/fez",
"name": "fez-language",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Simon Cozens",
"author_email": "simon@simon-cozens.org",
"download_url": "https://files.pythonhosted.org/packages/6d/4f/2ea6fcf659151fed208179b3e1681dd5a92a4c2255db746e2b033fe8c451/fez-language-1.4.0.tar.gz",
"platform": null,
"description": "# FEZ \u2014 Font Engineering made eaZy\n\n![fez](fez.png)\n\n*I wear a fez now. Fezzes are cool.*\n\nThe 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.\n\n## FEZ Quickstart\n\nClass 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:\n\n```\nDefineClass @sc = /\\.sc$/;\n```\n\nRan as:\n\n```sh\nfez2fea tests/LibertinusSans-Regular.otf test.fez\n```\n\nResults in:\n\n```fea\n@sc = [parenleft.sc parenright.sc bracketleft.sc bracketright.sc ...];\n```\n\nSimple replacement can be done as easily as:\n\n```\nDefineClass @sc = /\\.sc$/;\nDefineClass @sc_able = @sc~sc;\n\nFeature smcp {\n\tSubstitute @sc_able -> @sc;\n};\n```\n\nQuite complex classes can be built. All the glyphs which have a smallcap and alternate form:\n\n```\nDefineClass @sc_and_alt_able = /.*/ and hasglyph(/$/ .alt) and hasglyph(/$/ .sc);\n```\n\nReturning:\n\n```fea\n@sc_and_alt_able = [h y germandbls];\n```\n\nFEZ can even do substitutions impossible in FEA. For example:\n\n```\nDefineClass @digits = U+0031=>U+0039; # this is range(U+0031, U+0039) inclusive\nDefineClass @encircled = U+2474=>U+247C;\n\n# Un-CJK parenthesize\nFeature ss01 {\n\tSubstitute @encircled -> parenleft @digits parenright;\n};\n```\n\nGives us:\n\n```fea\nfeature ss01 {\n lookup Routine_1 {\n sub uni2474 by parenleft one parenright;\n sub uni2475 by parenleft two parenright;\n sub uni2476 by parenleft three parenright;\n sub uni2477 by parenleft four parenright;\n sub uni2478 by parenleft five parenright;\n sub uni2479 by parenleft six parenright;\n sub uni247A by parenleft seven parenright;\n sub uni247B by parenleft eight parenright;\n sub uni247C by parenleft nine parenright;\n } Routine_1;\n} ss01;\n```\n\nFEZ can do much more; see the [standard verbs documentation](https://fez.readthedocs.io/en/latest/syntax.html#standard-verbs) and the [optional plugins](https://fez.readthedocs.io/en/latest/optionalverbs.html). Writing your own plugins is as simple as [defining its grammar, verb, and adding a class with an `action()` method](https://fez.readthedocs.io/en/latest/plugins.html).\n\n## Contributors\n\nSee the [CONTRIBUTORS.txt](CONTRIBUTORS.txt) file for the full list of contributors. Major contributions are described below:\n\n* FEZ was originally written by Simon Cozens\n* Fred Brennan contributed a new parser and documentation updates\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The FEZ language: Font Engineering made eaZy",
"version": "1.4.0",
"project_urls": {
"Homepage": "https://github.com/simoncozens/fez"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cf7cbe997b4a18d8290c5486b74d147d343f7f71c7d6803c4ac6ce787f258da5",
"md5": "7811ac93382b72abad9bf01bc64dcbfe",
"sha256": "4640dce3f8bf133b377d00b4c72687bd8d1ad7f6eac802886addfb6b050e3d02"
},
"downloads": -1,
"filename": "fez_language-1.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7811ac93382b72abad9bf01bc64dcbfe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 50440,
"upload_time": "2023-05-22T09:41:42",
"upload_time_iso_8601": "2023-05-22T09:41:42.065338Z",
"url": "https://files.pythonhosted.org/packages/cf/7c/be997b4a18d8290c5486b74d147d343f7f71c7d6803c4ac6ce787f258da5/fez_language-1.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d4f2ea6fcf659151fed208179b3e1681dd5a92a4c2255db746e2b033fe8c451",
"md5": "c8d0b19885aaf3d397831c9c21e9a247",
"sha256": "81e84b491800dc0af0a94fa1b2283c40e7f711e3da023169b03464da1c76aee1"
},
"downloads": -1,
"filename": "fez-language-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "c8d0b19885aaf3d397831c9c21e9a247",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 902363,
"upload_time": "2023-05-22T09:41:45",
"upload_time_iso_8601": "2023-05-22T09:41:45.055228Z",
"url": "https://files.pythonhosted.org/packages/6d/4f/2ea6fcf659151fed208179b3e1681dd5a92a4c2255db746e2b033fe8c451/fez-language-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-22 09:41:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "simoncozens",
"github_project": "fez",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "fez-language"
}