RFC: Refactor rendering API and native font pipeline for v1.0.0 - #129
Draft
behackl wants to merge 55 commits into
Draft
RFC: Refactor rendering API and native font pipeline for v1.0.0#129behackl wants to merge 55 commits into
behackl wants to merge 55 commits into
Conversation
Member
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.