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

- (Unicode) initialize(original)

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

- (Boolean) covers?(character)

Returns:

  • (Boolean)


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

def covers?(character)
  true
end

- (Object) from_unicode(character)



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

def from_unicode(character)
  character
end

- (Boolean) includes?(character)

Returns:

  • (Boolean)


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

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

- (Object) to_unicode_map



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

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

- (Boolean) unicode?

Returns:

  • (Boolean)


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

def unicode?
  true
end

- (Object) use(character)



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

def use(character)
  @subset << character
end