Skip to content

OTF feature support (alternate figure styles, etc.) #16566

Closed

Description

@dnadlinger

Is there currently a backend that supports OTF GSUB features such as the choice between old style/lining figures?

I couldn't find a way to make this work, which is an issue for working with some "professional" fonts (e.g. FF Scala Sans Pro) that come with old style figures enabled by default.

Trawling the web, I found some references to HarfBuzz supporting specifying those with a colon after the font name, e.g. Scala Sans Pro:lnum in the above example. I couldn't make that work with the way matplotlib uses FreeType, though (haven't checked the source code yet).

I suppose I could use XeTeX via PGF, but that seems like a rather roundabout way.

Activity

  1. anntzer commented on Feb 24, 2020

    @anntzer
    Contributor

    Following your suggestion, mplcairo now does, this was surprisingly easy to implement :) (since today's master)
    e.g.

    from matplotlib.font_manager import *
    figtext(.5, .5, "123/456", fontproperties=FontProperties(fname="/usr/share/fonts/linux-libertine/LinLibertine_R.otf#0|frac"))

    gives you
    test

    Getting something similar in mpl proper would probably require someone to push #14912 through (I don't really have the motivation for that currently).

  2. dnadlinger commented on Feb 24, 2020

    @dnadlinger
    Author

    @anntzer: This is great, thanks – I actually started looking at mplcairo earlier today, and will definitely give this a go.

  3. anntzer commented on May 3, 2020

    @anntzer
    Contributor

    As requested in matplotlib/mplcairo#22, it would also be nice if FontProperties supported https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings.

  4. github-actions commented on Jul 10, 2023

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  5. added
    status: inactive
    on Jul 10, 2023
  6. dnadlinger commented on Jul 10, 2023

    @dnadlinger
    Author

    This still doesn't appear to be resolved in matplotlib proper.

  7. added
    keep
    and removed
    status: inactive
    on Jul 10, 2023
  8. moved this from Waiting for other PR to In Progress in Font and text overhaulon Jul 1, 2025
  9. linked a pull request that will close this issueAdd font feature API to Text #29695on Jul 1, 2025
  10. added this to the v3.11.0 milestone on Feb 6, 2026
  11. QuLogic commented on Apr 10, 2026

    @QuLogic
    Member

    The text-overhaul branch is now merged to main.

  12. removed
    keep
    on Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions