This repository was archived by the owner on Apr 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export default class WOFF2Font extends TTFFont {
3737 throw new Error ( 'Error decoding compressed data in WOFF2' )
3838 }
3939
40- this . stream = new r . DecodeStream ( new Buffer ( decompressed ) )
40+ this . stream = new r . DecodeStream ( Buffer . from ( decompressed ) )
4141 this . _decompressed = true
4242 }
4343 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default class WOFFFont extends TTFFont {
2020
2121 if ( table . compLength < table . length ) {
2222 this . stream . pos += 2 ; // skip deflate header
23- let outBuffer = new Buffer ( table . length ) ;
23+ let outBuffer = Buffer . alloc ( table . length ) ;
2424 let buf = inflate ( this . stream . readBuffer ( table . compLength - 2 ) , outBuffer ) ;
2525 return new r . DecodeStream ( buf ) ;
2626 } else {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export default class CFFSubset extends Subset {
3939 this . cff . stream . pos = subr . offset ;
4040 res . push ( this . cff . stream . readBuffer ( subr . length ) ) ;
4141 } else {
42- res . push ( new Buffer ( [ 11 ] ) ) ; // return
42+ res . push ( Buffer . from ( [ 11 ] ) ) ; // return
4343 }
4444 }
4545
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export default class TTFSubset extends Subset {
2525
2626 // if it is a compound glyph, include its components
2727 if ( glyf && glyf . numberOfContours < 0 ) {
28- buffer = new Buffer ( buffer ) ;
28+ buffer = Buffer . from ( buffer ) ;
2929 for ( let component of glyf . components ) {
3030 gid = this . includeGlyph ( component . glyphID ) ;
3131 buffer . writeUInt16BE ( gid , component . pos ) ;
You can’t perform that action at this time.
0 commit comments