Conversation
|
To ease into this patchbomb (sorry!), I can recommend starting with the explicit changelog page in the documentation at https://manimpango--129.org.readthedocs.build/en/129/changelog.html, followed by reading test output. This also modernises the CI/CD pipeline, the actual checks are currently not reported on this PR -- but you should be able to see them over at my fork: https://github.com/behackl/ManimPango/actions. |
|
I'll take a look this weekend |
|
I tested this rewrite on macOS against the glyph-position rounding issue discussed in #130 and ManimCommunity/manim#2844. The new rendering path still reproduces the same behavior. For example: At very small sizes, One subtlety: the positions have a fractional origin offset ( Since this rewrite already requires Pango >= 1.44, the Leaving this here so the issue can be accounted for in the v1 rendering path. |
Summary
This PR replaces the existing rendering interface with a smaller, explicit v1 API
and consolidates rendering around immutable results, SVG-space geometry, and
renderer-owned font state.
I don't intend to merge this branch, just started development at
v0at some pointand did not want to rebase against main (which has two previous 1.0.0 pre-releases
already) -- but should probably merged into / replace main while creating a
v1release branch. At that point I'd probably also change the default branch of this repo.
It is probably quite obvious, but I want to be explicit about it: this has been cooked up
with extensive usage of LLMs; I've kept (coarsely) reviewing individual commits and
in particular the test suite though. Not included: the integration of the new interface
in Manim -- but it effectively warrants a complete rewrite of
Textand friends likeParagraphto get rid of all the old, ugly and effectively unmaintainable code. I stronglybelieve that the current redesign allows a much, much cleaner implementation of
multi-line text in particular within Manim (while at the same time, or so I hope at least,
forming a more maintainable interface here). Curious to hear what you think!
The main public entry points in this refactored version are:
render()for literal plain textrender_markup()for Pango markupTextSpanfor structured plain-text stylingRenderedText,Bounds, andLineInfofor SVG output and layout metadataregister_font()/FontRegistrationfor explicit custom-font lifetimesget_version_info()for linked-library version informationDesign highlights
interpreted as markup.
unrelated Linux Fontconfig application state.
linearly for large styled or multiline inputs.
checks and explicit rejection of NUL-containing native inputs.
Infrastructure and documentation
modernized alongside the API work.
description intentionally stays focused on the implementation shape.
Verification
cross-platform CI matrix are green.