Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add remap_layout script #826

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Add remap_layout script #826

merged 3 commits into from
Feb 8, 2024

Conversation

simoncozens
Copy link
Contributor

This adds a new script, gftools-remap-layout, which is an alternative to pyftfeaturefreeze; it works on the layout level, whereas pyftfeaturefreeze only remaps cmap tables. This is more flexible as it allows for positioning, contextual substitutions, multiple and ligature substitutions, and other rules to be "frozen", whereas pyfeaturefreeze only works on single substitutions.

gftools-remap-layout, on the other hand, allows you to copy or move a set of lookups from one feature to another. For example, the standard pyftfeaturefreeze example of "freezing" small caps can be achieve by copying (->) the lookups from smcp to ccmp:

gftools-remap-layout -o Font-SC.ttf Font-Regular.ttf "smcp -> ccmp"

(Currently this assumes that the destination feature exists.)

To create a locale-specific version of a font, you can move (=>) lookups from the locl feature of a particular script and language system into another feature. In this case, we add the new lookups to the start (|) of the ccmp feature (default is to add lookups to the end).

gftools-remap-layout -o Font-ROM.ttf Font-Regular.ttf "latn/ROM/locl => |ccmp"

@simoncozens simoncozens merged commit 29f1247 into main Feb 8, 2024
11 checks passed
m4rc1e pushed a commit that referenced this pull request Mar 6, 2024
* Add remap layout script

* Install remap_layout script

* Sort --list-subcommands output
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants