ich versuche die mit MathTextParser aus der matplotlib erstellte Cairo-Ausgabe darzustellen. Unter Linux auch kein Problem (wahrscheinlich Schrift doppelt vorhanden), aber Windows ist die Schriftart unbekannt.
Wie kann ich in Cairo die Schrift von der matplotlib (mpl-data) einbinden?

Code: Alles auswählen
from matplotlib.mathtext import MathTextParser
from matplotlib.font_manager import ttfFontProperty
import wx
import wx.lib.wxcairo
import cairo
#...
MPC = MathTextParser("Cairo")
dc = wx.BufferedPaintDC(self)
ctx = wx.lib.wxcairo.ContextFromDC(dc)
#...
width, height, descent, glyphs, rects = self.mathtext_parser.parse(r"$a_0+a_1\xi+a_2\xi^2+a_3\xi^3$",dpi,prop)
#...
for font, fontsize, s, ox, oy in glyphs:
#...
fontProp = ttfFontProperty(font)
#...
ctx.select_font_face (fontProp.name,
self.fontangles [fontProp.style],
self.fontweights[fontProp.weight])
#...
ctx.show_text(s.encode("utf-8"))
#...
#...