Fontforge_plugin to fix issues to generated OT font
Project description
Fontforge OT Fixup
Fontforge_plugin to fix issues to generated OT font
Install
pip3 install fontforge_ot_fixup
Make sure Fontforge Python module is usable
In interactive mode of Python, run:
import fontforge
If it raises ModuleNotFoundError exception, install Fontforge first. If
installed, make sure the build option set that the Python module gets also
installed. If already so, Python interpreter does not recognize the module
path where the required module.
export PYTHONPATH=/path/to/fontforge/python/module:$PYTHONPATH
Configuration
This plugin has configuration menu. Select File > Configure Plugins... > OT fixup utility and click Configure to open.
Configuration will be stored in
~/.config/fontforge/plugin/OT fixup utility.toml
(for Linux.)
Fix post.isFixedPitch
Table: [hooks.post.isFixedPitch]
Keys: ttf and ufo
Type: bool
Enable or disable the font generation hook (see below.) Can be configured for each format, TTF (including OTF) and UFO.
Fix 'aalt' feature
Table: [hooks.GSUB.aalt]
Keys: ufo
Type: bool
Enable or disable the font generation hook (see below.) Only applicable for UFO.
Usage
In Fontforge GUI
This plugin adds following items into "Tools" menu:
- Activate smart dropout
Activate smart dropout
This appends the following bytecode into prep table:
B8h PUSHW
01FFh 511
85h SCANCTRL
B0h PUSHB
04h 4
8Dh SCANTYPE
If already appended the menu will be disabled.
Hooks
This plugin installs new/load font hook that installs font generation hook. The latter automatically fixes certain issues in exported font.
Fix post.isFixedPitch
Fontforge may export with post.isFixedPitch = 0 even for monospace fonts.
This is because Fontforge requires all glyph including combining marks
have the same advance width in order to export with post.isFixedPitch = 1.
This is usually inappropriate.
This hook fixes the flag after normal export referring only U+0020 to U+007E.
Works when exporting TTF, OTF, or UFO.
Fix aalt feature
Fontforge can export UFO but lacks special handling for aalt feature.
This may result an invalid feature file (*.ufo/feature.fea); it is that
aalt cannot contain script or language instructions.
This hook fixes aalt feature, or adds it if it does not exist. Existing
lookups in aalt features will be included as aalt-only ones.
Works only when exporting UFO.
In Python script
import fontforge
import fontforge_otfixup
font = fontforge.open('path/to/font.sfd')
sdActive = fontforge_otfixup.isSmartDropoutActive(font)
fontforge_otfixup.activateSmartDropout(font)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fontforge_ot_fixup-0.2.0.tar.gz.
File metadata
- Download URL: fontforge_ot_fixup-0.2.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1d996765ac2b56c4ef1d784015e70168959b97a8234f69728f86619ebdd5d7c
|
|
| MD5 |
ca3dbe045cf776f71e6420bba5a7e7bd
|
|
| BLAKE2b-256 |
b4153ed9d70fa62839f09a2112363cf7cba3e9aaaa46f587c9628654c9ad514d
|
Provenance
The following attestation bundles were made for fontforge_ot_fixup-0.2.0.tar.gz:
Publisher:
python-publish.yml on MihailJP/fontforge-ot-fixup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fontforge_ot_fixup-0.2.0.tar.gz -
Subject digest:
e1d996765ac2b56c4ef1d784015e70168959b97a8234f69728f86619ebdd5d7c - Sigstore transparency entry: 1082837563
- Sigstore integration time:
-
Permalink:
MihailJP/fontforge-ot-fixup@be69fb678edd6e0a2b9d916402900814c12dd478 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MihailJP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@be69fb678edd6e0a2b9d916402900814c12dd478 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fontforge_ot_fixup-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fontforge_ot_fixup-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32f49f356355024155aa542f3bc0a59a7348a37cd5204b997badaad356407632
|
|
| MD5 |
277d81d757d7ef4f99b3da1de68f1eac
|
|
| BLAKE2b-256 |
00f3ebb4ae836308852be81a15bdc5ea57e326006e85979eeff8181f50ecc530
|
Provenance
The following attestation bundles were made for fontforge_ot_fixup-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on MihailJP/fontforge-ot-fixup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fontforge_ot_fixup-0.2.0-py3-none-any.whl -
Subject digest:
32f49f356355024155aa542f3bc0a59a7348a37cd5204b997badaad356407632 - Sigstore transparency entry: 1082837644
- Sigstore integration time:
-
Permalink:
MihailJP/fontforge-ot-fixup@be69fb678edd6e0a2b9d916402900814c12dd478 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MihailJP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@be69fb678edd6e0a2b9d916402900814c12dd478 -
Trigger Event:
release
-
Statement type: