3131 GraphicsContextBase , RendererBase )
3232from matplotlib .backends .backend_mixed import MixedModeRenderer
3333from 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
3535from matplotlib .afm import AFM
3636import matplotlib .type1font as type1font
3737import matplotlib .dviread as dviread
@@ -1337,15 +1337,6 @@ def embedTTFType42(font, characters, descriptor):
13371337 'StemV' : 0 # ???
13381338 }
13391339
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-
13491340 if fonttype == 3 :
13501341 return embedTTFType3 (font , characters , descriptor )
13511342 elif fonttype == 42 :
@@ -2095,7 +2086,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
20952086 width , height , descent , glyphs , rects = \
20962087 self ._text2path .mathtext_parser .parse (s , 72 , prop )
20972088
2098- global_fonttype = mpl .rcParams ['pdf.fonttype' ]
2089+ fonttype = mpl .rcParams ['pdf.fonttype' ]
20992090
21002091 # Set up a global transformation matrix for the whole math expression
21012092 a = math .radians (angle )
@@ -2113,8 +2104,6 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
21132104 for font , fontsize , num , ox , oy in glyphs :
21142105 self .file ._character_tracker .track (font , chr (num ))
21152106 fontname = font .fname
2116- fonttype = (
2117- 42 if is_opentype_cff_font (fontname ) else global_fonttype )
21182107 if fonttype == 3 and num > 255 :
21192108 # For Type3 fonts, multibyte characters must be emitted
21202109 # separately (below).
@@ -2245,10 +2234,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
22452234 font = self ._get_font_ttf (prop )
22462235 self .file ._character_tracker .track (font , s )
22472236 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
22522237
22532238 # If fonttype != 3 or there are no multibyte characters, emit the whole
22542239 # string at once.
0 commit comments