@@ -3672,10 +3672,11 @@ class PartialEvaluator {
3672
3672
toUnicode,
3673
3673
cssFontInfo,
3674
3674
} ) {
3675
+ const isType3Font = type === "Type3" ;
3675
3676
let properties ;
3676
3677
3677
3678
if ( ! descriptor ) {
3678
- if ( type === "Type3" ) {
3679
+ if ( isType3Font ) {
3679
3680
// FontDescriptor is only required for Type3 fonts when the document
3680
3681
// is a tagged pdf. Create a barbebones one to get by.
3681
3682
descriptor = new Dict ( null ) ;
@@ -3712,6 +3713,7 @@ class PartialEvaluator {
3712
3713
firstChar,
3713
3714
lastChar,
3714
3715
toUnicode,
3716
+ isType3Font,
3715
3717
} ;
3716
3718
const widths = dict . get ( "Widths" ) ;
3717
3719
return this . extractDataStructures ( dict , dict , properties ) . then (
@@ -3751,7 +3753,7 @@ class PartialEvaluator {
3751
3753
baseFont = Name . get ( baseFont ) ;
3752
3754
}
3753
3755
3754
- if ( type !== "Type3" ) {
3756
+ if ( ! isType3Font ) {
3755
3757
const fontNameStr = fontName && fontName . name ;
3756
3758
const baseFontStr = baseFont && baseFont . name ;
3757
3759
if ( fontNameStr !== baseFontStr ) {
@@ -3816,7 +3818,7 @@ class PartialEvaluator {
3816
3818
capHeight : descriptor . get ( "CapHeight" ) ,
3817
3819
flags : descriptor . get ( "Flags" ) ,
3818
3820
italicAngle : descriptor . get ( "ItalicAngle" ) ,
3819
- isType3Font : false ,
3821
+ isType3Font,
3820
3822
cssFontInfo,
3821
3823
} ;
3822
3824
@@ -3838,9 +3840,6 @@ class PartialEvaluator {
3838
3840
newProperties => {
3839
3841
this . extractWidths ( dict , descriptor , newProperties ) ;
3840
3842
3841
- if ( type === "Type3" ) {
3842
- newProperties . isType3Font = true ;
3843
- }
3844
3843
return new Font ( fontName . name , fontFile , newProperties ) ;
3845
3844
}
3846
3845
) ;
0 commit comments