Created
March 13, 2025 02:57
-
-
Save ravshansbox/8be29b439d121dfb181ac28eadb883da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import fontforge | |
import sys | |
if len(sys.argv) < 3: | |
print("Usage: python remove_calt.py input_font output_font") | |
sys.exit(1) | |
input_font = sys.argv[1] | |
output_font = sys.argv[2] | |
# Open the font | |
font = fontforge.open(input_font) | |
# Remove the 'calt' feature if it exists | |
for lookup in list(font.gsub_lookups): | |
for feature, script_lang_list in font.getLookupInfo(lookup)[2]: | |
if feature == 'calt': | |
font.removeLookup(lookup) | |
print(f"Removed lookup '{lookup}' with 'calt' feature") | |
# Save the modified font | |
font.generate(output_font) | |
print(f"Font saved as {output_font}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment