{"id":20595430,"url":"https://github.com/adobe-type-tools/python-modules","last_synced_at":"2025-04-14T23:43:29.324Z","repository":{"id":7363279,"uuid":"8688574","full_name":"adobe-type-tools/python-modules","owner":"adobe-type-tools","description":"Python modules","archived":false,"fork":false,"pushed_at":"2025-03-31T23:22:22.000Z","size":973,"stargazers_count":30,"open_issues_count":6,"forks_count":17,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-14T23:43:23.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adobe-type-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-10T17:21:09.000Z","updated_at":"2025-03-04T14:12:23.000Z","dependencies_parsed_at":"2024-12-09T18:20:53.769Z","dependency_job_id":"495605a1-14cc-4f9c-bc09-93e236c55d0d","html_url":"https://github.com/adobe-type-tools/python-modules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-type-tools%2Fpython-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-type-tools%2Fpython-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-type-tools%2Fpython-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-type-tools%2Fpython-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adobe-type-tools","download_url":"https://codeload.github.com/adobe-type-tools/python-modules/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981259,"owners_count":21193143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:13:01.415Z","updated_at":"2025-04-14T23:43:29.308Z","avatar_url":"https://github.com/adobe-type-tools.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/adobe-type-tools/python-modules/graph/badge.svg?token=Zeqzh6AHfO)](https://codecov.io/gh/adobe-type-tools/python-modules)\n\nAFDKO Python Modules\n====================\n\n### Installation\n\n```\npip3 install git+https://github.com/adobe-type-tools/python-modules\n```\n\n\n## `kernFeatureWriter.py`\nThis tool exports the kerning and groups data within a UFO to a\n`makeotf`-compatible GPOS kern feature file.\n\n#### Default functionality:\n\n-   writing of a sorted kern.fea file, which organizes pairs in order of\n    specificity (exceptions first, then glyph-to-glyph, then group pairs)\n-   filtering of small pairs (often results of interpolation).  \n    Exceptions (even though they may be small) are not filtered.\n-   processing of right-to-left pairs (given that kerning groups containing\n    those glyphs are suffixed with `_ARA`, `_HEB`, or `_RTL`)\n\n#### Optional functionality:\n\n-   dissolving single-element groups into glyph pairs – this helps with\n    subtable optimization, and can be seen as a means to avoid kerning overflow\n-   subtable measuring and automatic insertion of subtable breaks\n-   specifying a maximum subtable size\n-   identification of glyph-to-glyph RTL pairs by way of a global `RTL_KERNING`\n    reference group\n-   specifying a glyph name suffix for glyphs to be ignored when writing the\n    kern feature\n\n#### Usage:\n```zsh\n\n    # write a basic kern feature file\n    python kernFeatureWriter.py font.ufo\n\n    # write a kern feature file with minimum absolute kerning value of 5\n    python kernFeatureWriter.py -min 5 font.ufo\n\n    # write a kern feature with subtable breaks\n    python kernFeatureWriter.py -s font.ufo\n\n    # further usage information\n    python kernFeatureWriter.py -h\n\n```\n\n----\n\n## `markFeatureWriter.py`\nThis tool interprets glyphs and anchor points within a UFO to write a\n`makeotf`-compatible GPOS mark feature file.\n\nThe input UFO file needs to have base glyphs and zero-width combining\nmarks. Base- and mark glyphs attach via anchor pairs (e.g. `above` and\n`_above`, or `top`, and `_top`).\nCombining marks must be members of a `COMBINING_MARKS` reference group.\n\n#### Default functionality:\n\n-   writing a `mark.fea` file, which contains mark classes/groups, and\n    per-anchor mark-to-base positioning lookups (GPOS lookup type 4)\n-   writing mark-to-ligature positioning lookups (GPOS lookup type 5).\n    This requires anchor names to be suffixed with an ordinal (`1ST`, `2ND`,\n    `3RD`, etc). For example – if a mark with an `_above` anchor is to be\n    attached to a ligature, the ligature’s anchor names would be `above1ST`,\n    `above2ND`, etc – depending on the amount of ligature elements.\n\n#### Optional functionality:\n\n-   writing `mkmk.fea`, for mark-to-mark positioning (GPOS lookup type 6)\n-   writing `abvm.fea`/`blwm.fea` files, as used in Indic scripts (anchor pairs\n    are `abvm`, `_abvm`, and `blwm`, `_blwm`, respectively)\n-   writing mark classes into a separate file (in case classes need to be\n    shared across multiple lookup types)\n-   trimming casing tags (`UC`, `LC`, or `SC`)\n\n    Trimming tags is a somewhat specific feature, but it is quite essential:\n    In a UFO, anchors can be used to build composite glyphs – for example\n    `aacute`, and `Aacute`. Since those glyphs would often receive a\n    differently-shaped accent, the anchor pairs (on bases `a`/`A` and\n    marks `acutecmb`/`acutecmb.cap`) would be `aboveLC`/`_aboveLC`, and\n    `aboveUC/_aboveUC`, respectively.\n\n    When writing the mark feature, we care more about which group of combining\n    marks triggers a certain behavior, so removing those casing tags allows\n    grouping all `_above` marks together, hence attaching to a base glyph –\n    no matter if it is upper- or lowercase. The aesthetic substitution of the\n    mark (e.g. smaller mark on the uppercase letter) can happen later, in the\n    `ccmp` feature.\n\n#### Usage:\n```zsh\n\n    # write a basic mark feature\n    python markFeatureWriter.py font.ufo\n\n    # write mark and mkmk feature files\n    python markFeatureWriter.py -m font.ufo\n\n    # trim casing tags\n    python markFeatureWriter.py -t font.ufo\n\n    # further usage information\n    python markFeatureWriter.py -h\n\n```\n\n----\n\nBoth kern- and mark feature writers export raw feature data, which still needs to be wrapped with feature “fence”. This is easily achieved with an `include` statement:\n\n```\nfeature kern{\n    include(kern.fea);\n\n} kern;\n```\n\nThe benefit of this is that different feature flags can be used ([example](https://github.com/adobe-fonts/source-serif/blob/main/familyGPOS.fea#L12-L13)), or that mark groups can be shared across `mark`/`mkmk` features. Also, the (sometimes volatile) GPOS feature data can be re-generated periodically without affecting the overall structure of the feature tree.\n\n\n----\n\n## [utilities (folder `/utilities`)](/utilities)\n\n* `flKernExport.py`  \nFLS5 script to export class kerning to UFO. Superseded by [vfb3ufo](https://github.com/LucasFonts/vfbLib).\n\n\n## [other modules (folder `/vintage`)](/vintage)\n\nOther modules are FontLab scripts which were used in pre-UFO days in a FLS5 environment. Those modules are not in active development.\n\n* `AdobeFontLabUtils.py`  \nSupport module for FontLab scripts. Defines commonly used functions and globals.\n\n* `BezChar.py`  \nThis module converts between a FontLab glyph and a bez file data string. Used\nby the OutlineCheck and AutoHint scripts, to convert FL glyphs to bez programs \nas needed by C libraries that do the hard work.\n\n* `WriteFeaturesKernFDK.py`  \nFormer kern feature writer. \n\n* `WriteFeaturesMarkFDK.py`  \nFormer mark feature writer. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe-type-tools%2Fpython-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadobe-type-tools%2Fpython-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe-type-tools%2Fpython-modules/lists"}