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

Commit d87ada8

Browse filesBrowse files
committed
Segfaults on exit
1 parent ed495d3 commit d87ada8
Copy full SHA for d87ada8

File tree

Expand file treeCollapse file tree

3 files changed

+24
-11
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+24
-11
lines changed

‎lib/matplotlib/backends/backend_agg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_agg.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
185185
return None
186186
# We pass '0' for angle here, since it will be rotated (in raster
187187
# space) in the following call to draw_text_image).
188+
print("BEFORE")
188189
font.set_text(s, 0, flags=flags)
189190
font.draw_glyphs_to_bitmap(
190191
antialiased=mpl.rcParams['text.antialiased'])

‎lib/matplotlib/backends/backend_pdf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pdf.py
+18-11Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
GraphicsContextBase, RendererBase)
3434
from matplotlib.backends.backend_mixed import MixedModeRenderer
3535
from matplotlib.figure import Figure
36-
from matplotlib.font_manager import findfont, get_font
36+
from matplotlib.font_manager import findfont, find_fontsprop, get_font
3737
from matplotlib.afm import AFM
3838
import matplotlib.type1font as type1font
3939
import matplotlib.dviread as dviread
@@ -861,20 +861,24 @@ def fontName(self, fontprop):
861861
"""
862862

863863
if isinstance(fontprop, str):
864-
filename = fontprop
864+
filename = [fontprop]
865865
elif mpl.rcParams['pdf.use14corefonts']:
866-
filename = findfont(
867-
fontprop, fontext='afm', directory=RendererPdf._afm_font_dir)
866+
filename = find_fontsprop(
867+
fontprop, fontext='afm', directory=RendererPdf._afm_font_dir
868+
).values()
868869
else:
869-
filename = findfont(fontprop)
870+
filename = find_fontsprop(fontprop).values()
870871

871-
Fx = self.fontNames.get(filename)
872-
if Fx is None:
873-
Fx = next(self._internal_font_seq)
874-
self.fontNames[filename] = Fx
875-
_log.debug('Assigning font %s = %r', Fx, filename)
872+
Fxs = []
873+
for fname in filename:
874+
Fx = self.fontNames.get(fname)
875+
if Fx is None:
876+
Fx = next(self._internal_font_seq)
877+
self.fontNames[fname] = Fx
878+
_log.debug('Assigning font %s = %r', Fx, fname)
879+
Fxs.append(Fx)
876880

877-
return Fx
881+
return Fxs[0]
878882

879883
def dviFontName(self, dvifont):
880884
"""
@@ -1066,6 +1070,9 @@ def createType1Descriptor(self, t1font, fontfile):
10661070

10671071
def _get_xobject_symbol_name(self, filename, symbol_name):
10681072
Fx = self.fontName(filename)
1073+
# TODO: XObject symbol name should be multiple names?
1074+
# list(map(lambda x: x.name.decode(), Fxs))
1075+
# Fx = Fxs[0]
10691076
return "-".join([
10701077
Fx.name.decode(),
10711078
os.path.splitext(os.path.basename(filename))[0],

‎src/ft2font.cpp

Copy file name to clipboardExpand all lines: src/ft2font.cpp
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ void FT2Font::set_text(
555555
if (bbox.xMin > bbox.xMax) {
556556
bbox.xMin = bbox.yMin = bbox.xMax = bbox.yMax = 0;
557557
}
558+
printf("\nMap: \n");
559+
// print out num_glyphs for the final FT2Font so its easy to track
560+
for (std::pair<const FT_UInt, FT2Font *> &x: glyph_to_font) {
561+
printf("%u: %lu \n", x.first, x.second->get_face()->num_glyphs);
562+
}
558563
}
559564

560565
void FT2Font::fill_glyphs(

0 commit comments

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