       CapHeight: (@font.capHeight or @font.ascent) * @scale
       XHeight: (@font.xHeight or 0) * @scale
       StemV: 0 # not sure how to calculate this
-        
+
     if isCFF
       descriptor.data.FontFile3 = fontFile
     else
       descriptor.data.FontFile2 = fontFile
-      
+
     descriptor.end()
-    
+
     descendantFont = @document.ref
       Type: 'Font'
       Subtype: if isCFF then 'CIDFontType0' else 'CIDFontType2'

      end
      end
    """
    
    return cmap
  
module.exports = EmbeddedFont

    flags |= 1 << 2 # assume the font uses non-latin characters
    flags |= 1 << 3 if familyClass is 10
    flags |= 1 << 6 if @font.head.macStyle.italic

    # generate a random tag (6 uppercase letters. 65 is the char code for 'A')
    tag = (String.fromCharCode Math.random() * 26 + 65 for i in [0...6]).join ''
    name = tag + '+' + @font.postscriptName

    bbox = @font.bbox
    descriptor = @document.ref
      Type: 'FontDescriptor'
