all files / fontkit/src/glyph/ WOFF2Glyph.coffee

100% Statements 5/5
100% Branches 0/0
100% Functions 3/3
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14                  
TTFGlyph = require './TTFGlyph'
 
# This is a subclass of TTFGlyph for WOFF2, where the decoding is different
# for simple glyphs. We have to do this ahead of time (it's done in WOFF2Font)
# so this class just returns the pre-decoded glyph data.
class WOFF2Glyph extends TTFGlyph
  _decode: ->
    return @_font._transformedGlyphs[@id]
    
  _getCBox: ->
    return @path.bbox
    
module.exports = WOFF2Glyph