# File lib/ttfunk/subset/mac_roman.rb, line 8 def initialize(original) super @subset = Array.new(256) end
# File lib/ttfunk/subset/mac_roman.rb, line 21 def covers?(character) Encoding::MacRoman.covers?(character) end
# File lib/ttfunk/subset/mac_roman.rb, line 30 def from_unicode(character) Encoding::MacRoman::FROM_UNICODE[character] end
# File lib/ttfunk/subset/mac_roman.rb, line 25 def includes?(character) code = Encoding::MacRoman::FROM_UNICODE[character] code && @subset[code] end
# File lib/ttfunk/subset/mac_roman.rb, line 13 def to_unicode_map Encoding::MacRoman::TO_UNICODE end
# File lib/ttfunk/subset/mac_roman.rb, line 17 def use(character) @subset[Encoding::MacRoman::FROM_UNICODE[character]] = character end
# File lib/ttfunk/subset/mac_roman.rb, line 36 def new_cmap_table(options) mapping = {} @subset.each_with_index do |unicode, roman| mapping[roman] = unicode_cmap[unicode] if roman end TTFunk::Table::Cmap.encode(mapping, :mac_roman) end
# File lib/ttfunk/subset/mac_roman.rb, line 45 def original_glyph_ids ([0] + @subset.map { |unicode| unicode && unicode_cmap[unicode] }).compact.uniq.sort end