Class: TTFunk::Subset::Unicode

Inherits:
Base
  • Object
show all
Defined in:
lib/ttfunk/subset/unicode.rb

Instance Attribute Summary

Attributes inherited from Base

#original

Instance Method Summary collapse

Methods inherited from Base

#encode

Constructor Details

#initialize(original) ⇒ Unicode

Returns a new instance of Unicode.



7
8
9
10
# File 'lib/ttfunk/subset/unicode.rb', line 7

def initialize(original)
  super
  @subset = Set.new
end

Instance Method Details

#covers?(character) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ttfunk/subset/unicode.rb', line 24

def covers?(character)
  true
end

#from_unicode(character) ⇒ Object



32
33
34
# File 'lib/ttfunk/subset/unicode.rb', line 32

def from_unicode(character)
  character
end

#includes?(character) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ttfunk/subset/unicode.rb', line 28

def includes?(character)
  @subset.includes(character)
end

#to_unicode_mapObject



16
17
18
# File 'lib/ttfunk/subset/unicode.rb', line 16

def to_unicode_map
  @subset.inject({}) { |map, code| map[code] = code; map }
end

#unicode?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ttfunk/subset/unicode.rb', line 12

def unicode?
  true
end

#use(character) ⇒ Object



20
21
22
# File 'lib/ttfunk/subset/unicode.rb', line 20

def use(character)
  @subset << character
end