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
@@ -1337,15 +1337,6 @@ def embedTTFType42(font, characters, descriptor):
1337
1337
'StemV' :0 # ???
1338
1338
}
1339
1339
1340
- # The font subsetting to a Type 3 font does not work for
1341
- # OpenType (.otf) that embed a Postscript CFF font, so avoid that --
1342
- # save as a (non-subsetted) Type 42 font instead.
1343
- if is_opentype_cff_font (filename ):
1344
- fonttype = 42
1345
- _log .warning ("%r can not be subsetted into a Type 3 font. The "
1346
- "entire font will be embedded in the output." ,
1347
- os .path .basename (filename ))
1348
-
1349
1340
if fonttype == 3 :
1350
1341
return embedTTFType3 (font ,characters ,descriptor )
1351
1342
elif fonttype == 42 :
@@ -2095,7 +2086,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
2095
2086
width ,height ,descent ,glyphs ,rects = \
2096
2087
self ._text2path .mathtext_parser .parse (s ,72 ,prop )
2097
2088
2098
- global_fonttype = mpl .rcParams ['pdf.fonttype' ]
2089
+ fonttype = mpl .rcParams ['pdf.fonttype' ]
2099
2090
2100
2091
# Set up a global transformation matrix for the whole math expression
2101
2092
a = math .radians (angle )
@@ -2113,8 +2104,6 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
2113
2104
for font ,fontsize ,num ,ox ,oy in glyphs :
2114
2105
self .file ._character_tracker .track (font ,chr (num ))
2115
2106
fontname = font .fname
2116
- fonttype = (
2117
- 42 if is_opentype_cff_font (fontname )else global_fonttype )
2118
2107
if fonttype == 3 and num > 255 :
2119
2108
# For Type3 fonts, multibyte characters must be emitted
2120
2109
# separately (below).
@@ -2245,10 +2234,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2245
2234
font = self ._get_font_ttf (prop )
2246
2235
self .file ._character_tracker .track (font ,s )
2247
2236
fonttype = mpl .rcParams ['pdf.fonttype' ]
2248
- # We can't subset all OpenType fonts, so switch to Type 42
2249
- # in that case.
2250
- if is_opentype_cff_font (font .fname ):
2251
- fonttype = 42
2252
2237
2253
2238
# If fonttype != 3 or there are no multibyte characters, emit the whole
2254
2239
# string at once.