|
21 | 21 | from matplotlib._pylab_helpers import Gcf |
22 | 22 | from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ |
23 | 23 | FigureManagerBase, FigureCanvasBase |
24 | | -from matplotlib.cbook import Bunch, enumerate, is_string_like, reverse_dict |
| 24 | +from matplotlib.cbook import Bunch, enumerate, is_string_like, reverse_dict, get_realpath_and_stat |
25 | 25 | from matplotlib.figure import Figure |
26 | 26 | from matplotlib.font_manager import fontManager |
27 | 27 | from matplotlib.afm import AFM |
@@ -455,8 +455,9 @@ def writeFonts(self): |
455 | 455 | if filename.endswith('.afm'): |
456 | 456 | fontdictObject = self._write_afm_font(filename) |
457 | 457 | else: |
| 458 | + realpath, stat_key = get_realpath_and_stat(filename) |
458 | 459 | fontdictObject = self.embedTTF( |
459 | | - filename, self.used_characters[filename]) |
| 460 | + *self.used_characters[stat_key]) |
460 | 461 | fonts[Fx] = fontdictObject |
461 | 462 | #print >>sys.stderr, filename |
462 | 463 | self.writeObject(self.fontObject, fonts) |
@@ -927,8 +928,10 @@ def track_characters(self, font, s): |
927 | 928 | fname = font |
928 | 929 | else: |
929 | 930 | fname = font.fname |
930 | | - used_characters = self.used_characters.setdefault(fname, sets.Set()) |
931 | | - used_characters.update(s) |
| 931 | + realpath, stat_key = get_realpath_and_stat(fname) |
| 932 | + used_characters = self.used_characters.setdefault( |
| 933 | + stat_key, (realpath, sets.Set())) |
| 934 | + used_characters[1].update(s) |
932 | 935 |
|
933 | 936 | def draw_arc(self, gcEdge, rgbFace, x, y, width, height, |
934 | 937 | angle1, angle2, rotation): |
|
0 commit comments