File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -4606,6 +4606,10 @@ class PartialEvaluator {
46064606    if  ( typeof  italicAngle  !==  "number" )  { 
46074607      italicAngle  =  0 ; 
46084608    } 
4609+     let  fontWeight  =  descriptor . get ( "FontWeight" ) ; 
4610+     if  ( typeof  fontWeight  !==  "number" )  { 
4611+       fontWeight  =  400 ; 
4612+     } 
46094613
46104614    const  properties  =  { 
46114615      type, 
@@ -4630,6 +4634,7 @@ class PartialEvaluator {
46304634      capHeight, 
46314635      flags, 
46324636      italicAngle, 
4637+       fontWeight, 
46334638      isType3Font, 
46344639      cssFontInfo, 
46354640      scaleFactors : glyphScaleFactors , 
Original file line number Diff line number Diff line change @@ -1042,6 +1042,16 @@ class Font {
10421042    this . fontMatrix  =  properties . fontMatrix ; 
10431043    this . bbox  =  properties . bbox ; 
10441044    this . defaultEncoding  =  properties . defaultEncoding ; 
1045+     if  ( typeof  properties . fontWeight  ===  "number" )  { 
1046+       if  ( properties . fontWeight  ===  900 )  { 
1047+         this . black  =  true ; 
1048+       }  else  if  ( properties . fontWeight  >=  700 )  { 
1049+         this . bold  =  true ; 
1050+       } 
1051+     } 
1052+     if  ( typeof  properties . italicAngle  ===  "number"  &&  properties . italicAngle )  { 
1053+       this . italic  =  true ; 
1054+     } 
10451055
10461056    this . toUnicode  =  properties . toUnicode ; 
10471057    this . toFontChar  =  [ ] ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments