Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for (some) colour fonts#30725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
QuLogic wants to merge15 commits intomatplotlib:text-overhaul
base:text-overhaul
Choose a base branch
Loading
fromQuLogic:colour-font

Conversation

@QuLogic
Copy link
Member

PR summary

This adds support for fonts with colour glyphs supported by FreeType. Specifically, this should mean COLRv0 fonts. There also exist some other colour font types, which arenot supported:

  • CBDT is a non-scalable bitmap format and we don't support those, but it may be possible if we do a scaling ourselves.
  • SVG requires a parser (though it's some font-specific subset of the whole SVG spec)
  • COLRv1 essentially requires a full renderer setup.

We of course do have a full renderer available, but that would require much more interfacing to get working. HarfBuzz (which we use indirectly through libraqm) also has some API for these COLRv1 fonts, but I don't know if it's any nicer to use than FreeType's. Unfortunately, this does exclude one of the most popular emoji fonts, Noto Color Emoji, as that has moved to COLRv1+SVG.

This PR is based on all open font work, because a)#30059 makes it much easier to place the colour data if we don't have to use an intermediate buffer, and b)#30607 due toFT_Glyph_To_Bitmap losing colour information and so we need to move to an implementation that usesFT_Render_Glyph directly. I also merged#30334 though it's probably not strictly required.

For example, we can now render Niklaas in COLRv0, some fonts with simpler decorative effects like Cairo Play, and the older OpenMoji Color that was COLRv0. Fonts that use SVG (like Nabla and Gilbert here) are reduced to their greyscale variant.
colour

PR checklist

QuLogicand others added15 commitsOctober 23, 2025 04:33
Directly render FT glyphs to the Agg buffer.  In particular, thisnaturally provides, with no extra work, subpixel positioning of glyphs(which could also have been implemented in the old framework, but wouldhave required careful tracking of subpixel offets).Note that all baseline images should be regenerated.  The new APIs addedto FT2Font are also up to bikeshedding (but they are all private).
This enables loading a non-initial font from collections (`.ttc` files).Currently exposed for `FT2Font`, only.
This should allow listing the metadata from the whole collection, whichwill also pick the right one if specified, though it will not load thespecific index yet.
For backwards-compatibility, the path+index is passed around in alightweight subclass of `str`.
Note, this only has an effect if set as the global font. Otherwise, justthe font name is recorded, and the TeX engine's normal lookup isperformed.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@QuLogic@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp