Skip to content

Instantly share code, notes, and snippets.

@ravshansbox
Created March 13, 2025 02:57
Show Gist options
  • Save ravshansbox/8be29b439d121dfb181ac28eadb883da to your computer and use it in GitHub Desktop.
Save ravshansbox/8be29b439d121dfb181ac28eadb883da to your computer and use it in GitHub Desktop.
#!/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