Class: TTFunk::Subset::Unicode
- Inherits:
-
Base
- Object
- Base
- TTFunk::Subset::Unicode
- Defined in:
- lib/ttfunk/subset/unicode.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
- - (Boolean) covers?(character)
- - (Object) from_unicode(character)
- - (Boolean) includes?(character)
-
- (Unicode) initialize(original)
constructor
A new instance of Unicode.
- - (Object) to_unicode_map
- - (Boolean) unicode?
- - (Object) use(character)
Methods inherited from Base
Constructor Details
- (Unicode) initialize(original)
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)
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)
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?
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 |