Class: TTFunk::Table::Name
- Inherits:
-
TTFunk::Table
- Object
- TTFunk::Table
- TTFunk::Table::Name
- Defined in:
- lib/ttfunk/table/name.rb
Defined Under Namespace
Classes: String
Constant Summary collapse
- @@subset_tag =
"AAAAAA"
Instance Attribute Summary collapse
-
#compatible_full ⇒ Object
readonly
Returns the value of attribute compatible_full.
-
#copyright ⇒ Object
readonly
Returns the value of attribute copyright.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#designer ⇒ Object
readonly
Returns the value of attribute designer.
-
#designer_url ⇒ Object
readonly
Returns the value of attribute designer_url.
-
#font_family ⇒ Object
readonly
Returns the value of attribute font_family.
-
#font_name ⇒ Object
readonly
Returns the value of attribute font_name.
-
#font_subfamily ⇒ Object
readonly
Returns the value of attribute font_subfamily.
-
#license ⇒ Object
readonly
Returns the value of attribute license.
-
#license_url ⇒ Object
readonly
Returns the value of attribute license_url.
-
#manufacturer ⇒ Object
readonly
Returns the value of attribute manufacturer.
-
#preferred_family ⇒ Object
readonly
Returns the value of attribute preferred_family.
-
#preferred_subfamily ⇒ Object
readonly
Returns the value of attribute preferred_subfamily.
-
#sample_text ⇒ Object
readonly
Returns the value of attribute sample_text.
-
#strings ⇒ Object
readonly
Returns the value of attribute strings.
-
#trademark ⇒ Object
readonly
Returns the value of attribute trademark.
-
#unique_subfamily ⇒ Object
readonly
Returns the value of attribute unique_subfamily.
-
#vendor_url ⇒ Object
readonly
Returns the value of attribute vendor_url.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from TTFunk::Table
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from TTFunk::Table
#exists?, #initialize, #raw, #tag
Constructor Details
This class inherits a constructor from TTFunk::Table
Instance Attribute Details
#compatible_full ⇒ Object (readonly)
Returns the value of attribute compatible_full.
43 44 45 |
# File 'lib/ttfunk/table/name.rb', line 43 def compatible_full @compatible_full end |
#copyright ⇒ Object (readonly)
Returns the value of attribute copyright.
27 28 29 |
# File 'lib/ttfunk/table/name.rb', line 27 def copyright @copyright end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
36 37 38 |
# File 'lib/ttfunk/table/name.rb', line 36 def description @description end |
#designer ⇒ Object (readonly)
Returns the value of attribute designer.
35 36 37 |
# File 'lib/ttfunk/table/name.rb', line 35 def designer @designer end |
#designer_url ⇒ Object (readonly)
Returns the value of attribute designer_url.
38 39 40 |
# File 'lib/ttfunk/table/name.rb', line 38 def designer_url @designer_url end |
#font_family ⇒ Object (readonly)
Returns the value of attribute font_family.
28 29 30 |
# File 'lib/ttfunk/table/name.rb', line 28 def font_family @font_family end |
#font_name ⇒ Object (readonly)
Returns the value of attribute font_name.
31 32 33 |
# File 'lib/ttfunk/table/name.rb', line 31 def font_name @font_name end |
#font_subfamily ⇒ Object (readonly)
Returns the value of attribute font_subfamily.
29 30 31 |
# File 'lib/ttfunk/table/name.rb', line 29 def font_subfamily @font_subfamily end |
#license ⇒ Object (readonly)
Returns the value of attribute license.
39 40 41 |
# File 'lib/ttfunk/table/name.rb', line 39 def license @license end |
#license_url ⇒ Object (readonly)
Returns the value of attribute license_url.
40 41 42 |
# File 'lib/ttfunk/table/name.rb', line 40 def license_url @license_url end |
#manufacturer ⇒ Object (readonly)
Returns the value of attribute manufacturer.
34 35 36 |
# File 'lib/ttfunk/table/name.rb', line 34 def manufacturer @manufacturer end |
#preferred_family ⇒ Object (readonly)
Returns the value of attribute preferred_family.
41 42 43 |
# File 'lib/ttfunk/table/name.rb', line 41 def preferred_family @preferred_family end |
#preferred_subfamily ⇒ Object (readonly)
Returns the value of attribute preferred_subfamily.
42 43 44 |
# File 'lib/ttfunk/table/name.rb', line 42 def preferred_subfamily @preferred_subfamily end |
#sample_text ⇒ Object (readonly)
Returns the value of attribute sample_text.
44 45 46 |
# File 'lib/ttfunk/table/name.rb', line 44 def sample_text @sample_text end |
#strings ⇒ Object (readonly)
Returns the value of attribute strings.
25 26 27 |
# File 'lib/ttfunk/table/name.rb', line 25 def strings @strings end |
#trademark ⇒ Object (readonly)
Returns the value of attribute trademark.
33 34 35 |
# File 'lib/ttfunk/table/name.rb', line 33 def trademark @trademark end |
#unique_subfamily ⇒ Object (readonly)
Returns the value of attribute unique_subfamily.
30 31 32 |
# File 'lib/ttfunk/table/name.rb', line 30 def unique_subfamily @unique_subfamily end |
#vendor_url ⇒ Object (readonly)
Returns the value of attribute vendor_url.
37 38 39 |
# File 'lib/ttfunk/table/name.rb', line 37 def vendor_url @vendor_url end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
32 33 34 |
# File 'lib/ttfunk/table/name.rb', line 32 def version @version end |
Class Method Details
.encode(names) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ttfunk/table/name.rb', line 48 def self.encode(names) tag = @@subset_tag.dup @@subset_tag.succ! postscript_name = Name::String.new("#{tag}+#{names.postscript_name}", 1, 0, 0) strings = names.strings.dup strings[6] = [postscript_name] str_count = strings.inject(0) { |sum, (_, list)| sum + list.length } table = [0, str_count, 6 + 12 * str_count].pack("n*") strtable = "" strings.each do |id, list| list.each do |string| table << [string.platform_id, string.encoding_id, string.language_id, id, string.length, strtable.length].pack("n*") strtable << string end end table << strtable end |
Instance Method Details
#postscript_name ⇒ Object
71 72 73 74 |
# File 'lib/ttfunk/table/name.rb', line 71 def postscript_name return @postscript_name if @postscript_name font_family.first || "unnamed" end |