Light font variants cannot be accessed by common name · Issue #4822 · matplotlib/matplotlib · GitHub
Skip to content

Light font variants cannot be accessed by common name #4822

Description

@EdwinChan

The following Ubuntu fonts are installed on my system:

/home/edwin/.fonts/Ubuntu-LI.ttf: Ubuntu,Ubuntu Light:style=Light Italic,Italic
/home/edwin/.fonts/Ubuntu-L.ttf: Ubuntu,Ubuntu Light:style=Light,Regular
/home/edwin/.fonts/Ubuntu-M.ttf: Ubuntu,Ubuntu Light:style=Medium,Bold
/home/edwin/.fonts/Ubuntu-BI.ttf: Ubuntu:style=Bold Italic
/home/edwin/.fonts/Ubuntu-RI.ttf: Ubuntu:style=Italic
/home/edwin/.fonts/Ubuntu-R.ttf: Ubuntu:style=Regular
/home/edwin/.fonts/Ubuntu-MI.ttf: Ubuntu,Ubuntu Light:style=Medium Italic,Bold Italic
/home/edwin/.fonts/Ubuntu-B.ttf: Ubuntu:style=Bold

Ubuntu Light is shown with two family names: Ubuntu and Ubuntu Light. In XeTeX I can select the font directly by naming Ubuntu Light, but I cannot do the same in matplotlib:

matplotlib.rcParams['font.family'] = 'Ubuntu Light'

Instead, I must use a more obscure (albeit more technically correct) method:

matplotlib.rcParams['font.family'] = 'Ubuntu'
matplotlib.rcParams['font.weight'] = 200

It would be convenient if Ubuntu Light could be addressed directly by its 'common' name.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuestopic: text/fonts🌱 Good 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