Matplotlib: Revisiting Text/Font Handling
- Mentors
- Hannah, Thomas Caswell
- Organization
- NumFOCUS
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations, which has become a de-facto Python plotting library. It allows user text to be rendered on the canvas, includes extensive support for mathematical expressions, raster and vector outputs, arbitrary rotations, and supports Unicode. Much of the inspiration behind its font manager is inspired from W3C compliant algorithms, allowing users to interact with font properties like font-size, font-weight, font-family, etc.
However, the current way Matplotlib handles fonts and general text layout is not ideal, which is what this proposal aims to tackle.
It is divided into three subgoals, such that by the end of the project completion, TeX exporting mechanisms would use the same structural layout for most backends, and every exported PS/PDF would contain embedded glyphs which are subsetted from the whole font. This would be done with an implementation of a redesigned text-first font interface, essentially enabling a font-fallback mechanism, such that all font-family members will be parsed before rendering a “tofu”.