Skip to content

Instantly share code, notes, and snippets.

View stefan6419846's full-sized avatar

Stefan stefan6419846

  • Germany
View GitHub Profile
@stefan6419846
stefan6419846 / afm_to_dataclass.py
Created July 14, 2025 14:27
Convert Adobe core AFM files to a dataclass
import textwrap
import urllib.request
from io import BytesIO
from zipfile import ZipFile
from adobe_glyphs import adobe_glyphs
# FONT_URL = "http://web.archive.org/web/20110531171921if_/http://www.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/Core14_AFMs.zip"
FONT_URL = "https://download.macromedia.com/pub/developer/opentype/tech-notes/Core14_AFMs.zip"
@stefan6419846
stefan6419846 / analyze_fonts.py
Created December 5, 2023 09:46
Analyze fonts using fontTools
import datetime
import time
from pathlib import Path
from fontTools import ttLib
from fontTools import ttx
from fontTools.misc import timeTools
XML_DIRECTORY = Path('ttx')