class TTFunk::Subset::Unicode
Constants
- SPACE_CHAR
Public Class Methods
Source
# File lib/ttfunk/subset/unicode.rb, line 11 def initialize(original) super @subset = Set.new use(SPACE_CHAR) end
Calls superclass method
TTFunk::Subset::Base::new
Public Instance Methods
Source
# File lib/ttfunk/subset/unicode.rb, line 29 def covers?(_character) true end
Source
# File lib/ttfunk/subset/unicode.rb, line 37 def from_unicode(character) character end
Source
# File lib/ttfunk/subset/unicode.rb, line 33 def includes?(character) @subset.include?(character) end
Source
# File lib/ttfunk/subset/unicode.rb, line 41 def new_cmap_table @new_cmap_table ||= begin mapping = @subset.each_with_object({}) do |code, map| map[code] = unicode_cmap[code] end TTFunk::Table::Cmap.encode(mapping, :unicode) end end
Source
# File lib/ttfunk/subset/unicode.rb, line 53 def original_glyph_ids ([0] + @subset.map { |code| unicode_cmap[code] }).uniq.sort end
Source
# File lib/ttfunk/subset/unicode.rb, line 21 def to_unicode_map @subset.each_with_object({}) { |code, map| map[code] = code } end
Source
# File lib/ttfunk/subset/unicode.rb, line 25 def use(character) @subset << character end