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

[Bug]: Font fallback doesn't work on \mathdefault #27838

Open
@dedebenui

Description

@dedebenui

Bug summary

Per character font fallback (#20740) works great, except in tick labels.

Code for reproduction

importmatplotlib.pyplotasplt# CMU fonts available here : https://www.1001fonts.com/download/cmu.zipplt.rcParams["font.family"]= ["CMU Bright","DejaVu Sans"]s="There are\u2212\u00D7 in between!"plt.figtext(0.18,0.45,s)plt.gcf().suptitle(s)plt.gca().set_title(s)plt.xscale("log")plt.xlim(1e-2,6e-2)plt.show()

Actual outcome

In the tick labels, characters not covered by CMU Bright are rendered with a placeholder instead of falling back to DejaVu
image

Expected outcome

Tick labels should fall back to DejaVu for\u2212 (minus sign) and\u00D7 (times sign) as in the other text instances.

Additional information

It seems to happen only with tick labels, other instances of text rendering work as intended in#20740. I get the same outcome with bothmacosx andTkAgg backends

I get the following warnings:

Font 'default' does not have a glyph for '\u2212' [U+2212], substituting with a dummy symbol.Font 'default' does not have a glyph for '\\times' [U+d7], substituting with a dummy symbol.

Operating system

macOS 14.3.1

Matplotlib Version

3.8.3

Matplotlib Backend

MacOSX

Python version

3.11.7

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp