Skip to content

Conversation

mattt
Copy link

@mattt mattt commented Sep 29, 2025

Overview: What does this pull request change?

This PR adds support for font features and font variants in text elements rendered with Pango. It relies on changes in ManimCommunity/ManimPango#121. When using versions of ManimPango that don't support font features or variants (like, the latest release) this has no effect, thanks to wrapping attr setters using with suppress(Exception).

Motivation and Explanation: Why and how do your changes improve the library?

Looking at the CountingScene example in the docs, I noticed that the layout shifting horizontally as the numbers were incrementing. I went to update the example to use tabular instead of proportional figures, but didn't see a way to do that.

Screenshot 2025-09-29 at 06 31 29

Digging in further, I found a way to do this in LaTeX (I think... PR forthcoming), but not for SVG text. This led me down a rabbit hole that resulted in ManimCommunity/ManimPango#121 and now this PR.

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@mattt mattt force-pushed the mattt/font-features branch from 00e59a6 to 48e7296 Compare September 29, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

1 participant