31
31
GraphicsContextBase , RendererBase )
32
32
from matplotlib .backends .backend_mixed import MixedModeRenderer
33
33
from matplotlib .figure import Figure
34
- from matplotlib .font_manager import findfont , is_opentype_cff_font , get_font
34
+ from matplotlib .font_manager import findfont , get_font
35
35
from matplotlib .afm import AFM
36
36
import matplotlib .type1font as type1font
37
37
import matplotlib .dviread as dviread
@@ -1348,15 +1348,6 @@ def embedTTFType42(font, characters, descriptor):
1348
1348
'StemV' : 0 # ???
1349
1349
}
1350
1350
1351
- # The font subsetting to a Type 3 font does not work for
1352
- # OpenType (.otf) that embed a Postscript CFF font, so avoid that --
1353
- # save as a (non-subsetted) Type 42 font instead.
1354
- if is_opentype_cff_font (filename ):
1355
- fonttype = 42
1356
- _log .warning ("%r can not be subsetted into a Type 3 font. The "
1357
- "entire font will be embedded in the output." ,
1358
- os .path .basename (filename ))
1359
-
1360
1351
if fonttype == 3 :
1361
1352
return embedTTFType3 (font , characters , descriptor )
1362
1353
elif fonttype == 42 :
@@ -2119,7 +2110,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
2119
2110
}
2120
2111
self .file ._annotations [- 1 ][1 ].append (link_annotation )
2121
2112
2122
- global_fonttype = mpl .rcParams ['pdf.fonttype' ]
2113
+ fonttype = mpl .rcParams ['pdf.fonttype' ]
2123
2114
2124
2115
# Set up a global transformation matrix for the whole math expression
2125
2116
a = math .radians (angle )
@@ -2137,8 +2128,6 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
2137
2128
for font , fontsize , num , ox , oy in glyphs :
2138
2129
self .file ._character_tracker .track (font , chr (num ))
2139
2130
fontname = font .fname
2140
- fonttype = (
2141
- 42 if is_opentype_cff_font (fontname ) else global_fonttype )
2142
2131
if fonttype == 3 and num > 255 :
2143
2132
# For Type3 fonts, multibyte characters must be emitted
2144
2133
# separately (below).
@@ -2282,10 +2271,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2282
2271
font = self ._get_font_ttf (prop )
2283
2272
self .file ._character_tracker .track (font , s )
2284
2273
fonttype = mpl .rcParams ['pdf.fonttype' ]
2285
- # We can't subset all OpenType fonts, so switch to Type 42
2286
- # in that case.
2287
- if is_opentype_cff_font (font .fname ):
2288
- fonttype = 42
2289
2274
2290
2275
if gc .get_url () is not None :
2291
2276
font .set_text (s )
0 commit comments