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

Appearance settings

mathtext broken with cairo backend as of master #8797

Copy link
Copy link
Closed
@anntzer

Description

@anntzer
Issue body actions

As of master, with the gtk3cairo backend

title("$\\sqrt{2}$")

fails with

Traceback (most recent call last):
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/backends/backend_gtk3cairo.py", line 45, in on_draw_event
    self._render_figure(w, h)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/backends/backend_gtk3cairo.py", line 34, in _render_figure
    self.figure.draw (self._renderer)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/artist.py", line 68, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/figure.py", line 1242, in draw
    renderer, self, artists, self.suppressComposite)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/image.py", line 139, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/artist.py", line 68, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/axes/_base.py", line 2385, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/image.py", line 139, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/artist.py", line 68, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/text.py", line 801, in draw
    ismath=ismath, mtext=mtext)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/backends/backend_cairo.py", line 272, in draw_text
    self._draw_mathtext(gc, x, y, s, prop, angle)
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/backends/backend_cairo.py", line 319, in _draw_mathtext
    self.fontweights[fontProp.weight])
KeyError: 'regular'

Probably just needs adding an entry in fontweights.
Bisects back to d94a6a5
Probably the cairo backend should get some testing too... (right now it's 0% covered)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.backend: cairotopic: text

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.