How to subclass a table? #2796
-
Is it possible to subclass a table to add methods? For example:
Actually I subclassed TTFont and use |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
You can register a subclass with |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I'm doing something wrong. My goal is to add methods to For example:
If I run the following:
I get an attribute error:
|
Beta Was this translation helpful? Give feedback.
-
Thanks indeed! It works fine now. |
Beta Was this translation helpful? Give feedback.
You can register a subclass with
fontTools.ttLib.ttFont.registerCustomTableClass()
; it will override the default class.