@@ -1034,14 +1034,15 @@ def _embedTeXFont(self, fontinfo):
1034
1034
fontinfo .effects .get ('extend' , 1.0 ))
1035
1035
fontdesc = self ._type1Descriptors .get ((fontinfo .fontfile , effects ))
1036
1036
if fontdesc is None :
1037
- fontdesc = self .createType1Descriptor (t1font , fontinfo . fontfile )
1037
+ fontdesc = self .createType1Descriptor (t1font )
1038
1038
self ._type1Descriptors [(fontinfo .fontfile , effects )] = fontdesc
1039
1039
fontdict ['FontDescriptor' ] = fontdesc
1040
1040
1041
1041
self .writeObject (fontdictObject , fontdict )
1042
1042
return fontdictObject
1043
1043
1044
- def createType1Descriptor (self , t1font , fontfile ):
1044
+ @_api .delete_parameter ("3.11" , "fontfile" )
1045
+ def createType1Descriptor (self , t1font , fontfile = None ):
1045
1046
# Create and write the font descriptor and the font file
1046
1047
# of a Type-1 font
1047
1048
fontdescObject = self .reserveObject ('font descriptor' )
@@ -1076,24 +1077,22 @@ def createType1Descriptor(self, t1font, fontfile):
1076
1077
if 0 :
1077
1078
flags |= 1 << 18
1078
1079
1079
- ft2font = get_font (fontfile )
1080
-
1081
1080
descriptor = {
1082
1081
'Type' : Name ('FontDescriptor' ),
1083
1082
'FontName' : Name (t1font .prop ['FontName' ]),
1084
1083
'Flags' : flags ,
1085
- 'FontBBox' : ft2font . bbox ,
1084
+ 'FontBBox' : t1font . prop [ 'FontBBox' ] ,
1086
1085
'ItalicAngle' : italic_angle ,
1087
- 'Ascent' : ft2font . ascender ,
1088
- 'Descent' : ft2font . descender ,
1086
+ 'Ascent' : t1font . prop [ 'FontBBox' ][ 3 ] ,
1087
+ 'Descent' : t1font . prop [ 'FontBBox' ][ 1 ] ,
1089
1088
'CapHeight' : 1000 , # TODO: find this out
1090
1089
'XHeight' : 500 , # TODO: this one too
1091
1090
'FontFile' : fontfileObject ,
1092
1091
'FontFamily' : t1font .prop ['FamilyName' ],
1093
1092
'StemV' : 50 , # TODO
1094
1093
# (see also revision 3874; but not all TeX distros have AFM files!)
1095
1094
# 'FontWeight': a number where 400 = Regular, 700 = Bold
1096
- }
1095
+ }
1097
1096
1098
1097
self .writeObject (fontdescObject , descriptor )
1099
1098
0 commit comments