code: function write(writer, ttf) {
              var hasGLyphsOver2Bytes = ttf.support.cmap.hasGLyphsOver2Bytes;
  
              // write table header.
              writer.writeUint16(0); // version
              writer.writeUint16(hasGLyphsOver2Bytes ? 4 : 3); // count
  
              // header size
              var subTableOffset = 4 + (hasGLyphsOver2Bytes ? 32 : 24);
              var format4Size = ttf.support.cmap.format4Size;
              var format0Size = ttf.support.cmap.format0Size;
  
              // subtable 4, unicode
              writeSubTableHeader(writer, 0, 3, subTableOffset);
  
              // subtable 0, mac standard
              writeSubTableHeader(writer, 1, 0, subTableOffset + format4Size);
  
              // subtable 4, windows standard
              writeSubTableHeader(writer, 3, 1, subTableOffset);
  
              if (hasGLyphsOver2Bytes) {
                  writeSubTableHeader(writer, 3, 10, subTableOffset + format4Size + format0Size);
              }
  
              // write tables, order of table seem to be magic, it is taken from TTX tool
              writeSubTable4(writer, ttf.support.cmap.format4Segments);
              writeSubTable0(writer, ttf.support.cmap.format0Segments);
  
              if (hasGLyphsOver2Bytes) {
                  writeSubTable12(writer, ttf.support.cmap.format12Segments);
              }
  
  
              return writer;
          }
docs: 写cmap表数据
  
  @param  {Object} writer 写入器
  @param  {Object} ttf    ttf对象
  @return {Object}        写入器