Class: TTFunk::Subset::MacRoman
- Defined in:
- lib/ttfunk/subset/mac_roman.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #covers?(character) ⇒ Boolean
- #from_unicode(character) ⇒ Object
- #includes?(character) ⇒ Boolean
-
#initialize(original) ⇒ MacRoman
constructor
A new instance of MacRoman.
- #to_unicode_map ⇒ Object
- #use(character) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(original) ⇒ MacRoman
Returns a new instance of MacRoman.
9 10 11 12 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 9 def initialize(original) super @subset = Array.new(256) end |
Instance Method Details
#covers?(character) ⇒ Boolean
22 23 24 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 22 def covers?(character) Encoding::MacRoman.covers?(character) end |
#from_unicode(character) ⇒ Object
31 32 33 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 31 def from_unicode(character) Encoding::MacRoman::FROM_UNICODE[character] end |
#includes?(character) ⇒ Boolean
26 27 28 29 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 26 def includes?(character) code = Encoding::MacRoman::FROM_UNICODE[character] code && @subset[code] end |
#to_unicode_map ⇒ Object
14 15 16 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 14 def to_unicode_map Encoding::MacRoman::TO_UNICODE end |
#use(character) ⇒ Object
18 19 20 |
# File 'lib/ttfunk/subset/mac_roman.rb', line 18 def use(character) @subset[Encoding::MacRoman::FROM_UNICODE[character]] = character end |