Class: TTFunk::Subset::Unicode
- Defined in:
- lib/ttfunk/subset/unicode.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #covers?(character) ⇒ Boolean
- #from_unicode(character) ⇒ Object
- #includes?(character) ⇒ Boolean
-
#initialize(original) ⇒ Unicode
constructor
A new instance of Unicode.
- #to_unicode_map ⇒ Object
- #unicode? ⇒ Boolean
- #use(character) ⇒ Object
Methods inherited from Base
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
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
28 29 30 |
# File 'lib/ttfunk/subset/unicode.rb', line 28 def includes?(character) @subset.includes(character) end |
#to_unicode_map ⇒ Object
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
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 |