Is there a way to know if a font is Truetype or OpenType? #2619
Replies: 1 comment 8 replies
-
from fontTools.ttLib import TTFont
f = TTFont("path/to/font")
if "glyf" in f:
print("font is TTF")
else:
print("font is OTF") |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
moi15moi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to know if a font is Truetype or OpenType via fonttools?
Beta Was this translation helpful? Give feedback.
All reactions