@@ -692,7 +692,6 @@ def __init__(self, filename, metadata=None):
692
692
# differently encoded Type-1 fonts may share the same descriptor
693
693
self .type1Descriptors = {}
694
694
self ._character_tracker = _backend_pdf_ps .CharacterTracker ()
695
- # self._char_to_font = None
696
695
697
696
self .alphaStates = {} # maps alpha values to graphics state objects
698
697
self ._alpha_state_seq = (Name (f'A{ i } ' ) for i in itertools .count (1 ))
@@ -916,7 +915,6 @@ def dviFontName(self, dvifont):
916
915
return pdfname
917
916
918
917
def writeFonts (self ):
919
- print ("fonts: " , self .fontNames )
920
918
fonts = {}
921
919
for dviname , info in sorted (self .dviFontInfo .items ()):
922
920
Fx = info .pdfname
@@ -933,7 +931,6 @@ def writeFonts(self):
933
931
# a normal TrueType font
934
932
_log .debug ('Writing TrueType font.' )
935
933
chars = self ._character_tracker .used .get (filename )
936
- print ("chars:" , chars , " for font:" , filename )
937
934
if chars :
938
935
fonts [Fx ] = self .embedTTF (filename , chars )
939
936
self .writeObject (self .fontObject , fonts )
@@ -1076,11 +1073,10 @@ def createType1Descriptor(self, t1font, fontfile):
1076
1073
1077
1074
def _get_xobject_symbol_name (self , filename , symbol_name ):
1078
1075
Fx = self .fontName (filename )
1079
- x = "-" .join ([
1076
+ return "-" .join ([
1080
1077
Fx .name .decode (),
1081
1078
os .path .splitext (os .path .basename (filename ))[0 ],
1082
1079
symbol_name ])
1083
- return x
1084
1080
1085
1081
_identityToUnicodeCMap = b"""/CIDInit /ProcSet findresource begin
1086
1082
12 dict begin
@@ -1107,7 +1103,6 @@ def embedTTF(self, filename, characters):
1107
1103
"""Embed the TTF font from the named file into the document."""
1108
1104
1109
1105
font = get_font (filename )
1110
- print ("embedding:" , font .fname )
1111
1106
fonttype = mpl .rcParams ['pdf.fonttype' ]
1112
1107
1113
1108
def cvt (length , upe = font .units_per_EM , nearest = True ):
@@ -1339,7 +1334,7 @@ def embedTTFType42(font, characters, descriptor):
1339
1334
# Add XObjects for unsupported chars
1340
1335
glyph_ids = []
1341
1336
for ccode in characters :
1342
- if _font_supports_char (fonttype , chr (ccode )):
1337
+ if not _font_supports_char (fonttype , chr (ccode )):
1343
1338
gind = full_font .get_char_index (ccode )
1344
1339
glyph_ids .append (gind )
1345
1340
@@ -1929,8 +1924,6 @@ class RendererPdf(_backend_pdf_ps.RendererPDFPSBase):
1929
1924
def __init__ (self , file , image_dpi , height , width ):
1930
1925
super ().__init__ (width , height )
1931
1926
self .file = file
1932
- self .char_to_font = {}
1933
- self .glyph_to_font = {}
1934
1927
self .gc = self .new_gc ()
1935
1928
self .image_dpi = image_dpi
1936
1929
@@ -2421,7 +2414,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2421
2414
# Emit all the 1-byte characters in a BT/ET group.
2422
2415
2423
2416
self .file .output (Op .begin_text )
2424
- # ft, fontsize, Op.selectfont
2425
2417
prev_start_x = 0
2426
2418
for ft_object , start_x , kerns_or_chars in singlebyte_chunks :
2427
2419
ft_name = self .file .fontName (ft_object .fname )
0 commit comments