# File lib/ttfunk/table/glyf.rb, line 14
      def self.encode(glyphs, new2old, old2new)
        result = { :table => "", :offsets => [] }

        new2old.keys.sort.each do |new_id|
          glyph = glyphs[new2old[new_id]]
          result[:offsets] << result[:table].length
          result[:table] << glyph.recode(old2new) if glyph
        end

        # include an offset at the end of the table, for use in computing the
        # size of the last glyph
        result[:offsets] << result[:table].length
        return result
      end