@@ -1034,14 +1034,15 @@ def _embedTeXFont(self, fontinfo):
10341034 fontinfo .effects .get ('extend' , 1.0 ))
10351035 fontdesc = self ._type1Descriptors .get ((fontinfo .fontfile , effects ))
10361036 if fontdesc is None :
1037- fontdesc = self .createType1Descriptor (t1font , fontinfo . fontfile )
1037+ fontdesc = self .createType1Descriptor (t1font )
10381038 self ._type1Descriptors [(fontinfo .fontfile , effects )] = fontdesc
10391039 fontdict ['FontDescriptor' ] = fontdesc
10401040
10411041 self .writeObject (fontdictObject , fontdict )
10421042 return fontdictObject
10431043
1044- def createType1Descriptor (self , t1font , fontfile ):
1044+ @_api .delete_parameter ("3.11" , "fontfile" )
1045+ def createType1Descriptor (self , t1font , fontfile = None ):
10451046 # Create and write the font descriptor and the font file
10461047 # of a Type-1 font
10471048 fontdescObject = self .reserveObject ('font descriptor' )
@@ -1076,24 +1077,22 @@ def createType1Descriptor(self, t1font, fontfile):
10761077 if 0 :
10771078 flags |= 1 << 18
10781079
1079- ft2font = get_font (fontfile )
1080-
10811080 descriptor = {
10821081 'Type' : Name ('FontDescriptor' ),
10831082 'FontName' : Name (t1font .prop ['FontName' ]),
10841083 'Flags' : flags ,
1085- 'FontBBox' : ft2font . bbox ,
1084+ 'FontBBox' : t1font . prop [ 'FontBBox' ] ,
10861085 'ItalicAngle' : italic_angle ,
1087- 'Ascent' : ft2font . ascender ,
1088- 'Descent' : ft2font . descender ,
1086+ 'Ascent' : t1font . prop [ 'FontBBox' ][ 3 ] ,
1087+ 'Descent' : t1font . prop [ 'FontBBox' ][ 1 ] ,
10891088 'CapHeight' : 1000 , # TODO: find this out
10901089 'XHeight' : 500 , # TODO: this one too
10911090 'FontFile' : fontfileObject ,
10921091 'FontFamily' : t1font .prop ['FamilyName' ],
10931092 'StemV' : 50 , # TODO
10941093 # (see also revision 3874; but not all TeX distros have AFM files!)
10951094 # 'FontWeight': a number where 400 = Regular, 700 = Bold
1096- }
1095+ }
10971096
10981097 self .writeObject (fontdescObject , descriptor )
10991098
0 commit comments