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 @@ -4599,6 +4599,10 @@ class PartialEvaluator {
45994599    if  ( typeof  italicAngle  !==  "number" )  { 
46004600      italicAngle  =  0 ; 
46014601    } 
4602+     let  fontWeight  =  descriptor . get ( "FontWeight" ) ; 
4603+     if  ( typeof  fontWeight  !==  "number" )  { 
4604+       fontWeight  =  400 ; 
4605+     } 
46024606
46034607    const  properties  =  { 
46044608      type, 
@@ -4623,6 +4627,7 @@ class PartialEvaluator {
46234627      capHeight, 
46244628      flags, 
46254629      italicAngle, 
4630+       fontWeight, 
46264631      isType3Font, 
46274632      cssFontInfo, 
46284633      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