Skip to content

verify quoting method in svg backend for font names #24080

@tacaswell

Description

@tacaswell

In the svg backend we need to treat generic and specific font names differently. We are currently using repr to achieve this, but we need to verify that this is robust to if repr goes with single or double quotes and if any of the consumers of svg would care.

We have used repr() before and it seems to have worked, but technically repr() is not exactly quoting. Would both single and double quotes be ok? Unlikely, but in theory Python could change that in repr (or possibly more likely an interpreter other than CPython could use other quotes). Also, can we be sure we will never have byte strings here?

It's more defensive to f-string the quotes explicitly.

Originally posted by @timhoffm in #24066 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy