This commit adds documentation and type annotations, and allows the script to be imported as a module.
Reduce pointer magic use Both translations and fonts