Class: TTFunk::Table::Name::NameString
- Inherits:
-
String
- Object
- String
- TTFunk::Table::Name::NameString
- Defined in:
- lib/ttfunk/table/name.rb
Overview
Name Record.
Instance Attribute Summary collapse
-
#encoding_id ⇒ Integer
readonly
Platform-specific encoding ID.
-
#language_id ⇒ Integer
readonly
Language ID.
-
#platform_id ⇒ Integer
readonly
Platform ID.
Instance Method Summary collapse
-
#initialize(text, platform_id, encoding_id, language_id) ⇒ NameString
constructor
A new instance of NameString.
-
#strip_extended ⇒ String
Removes chracter incompatible with PostScript.
Constructor Details
#initialize(text, platform_id, encoding_id, language_id) ⇒ NameString
Returns a new instance of NameString.
28 29 30 31 32 33 |
# File 'lib/ttfunk/table/name.rb', line 28 def initialize(text, platform_id, encoding_id, language_id) super(text) @platform_id = platform_id @encoding_id = encoding_id @language_id = language_id end |
Instance Attribute Details
#encoding_id ⇒ Integer (readonly)
Platform-specific encoding ID.
18 19 20 |
# File 'lib/ttfunk/table/name.rb', line 18 def encoding_id @encoding_id end |
#language_id ⇒ Integer (readonly)
Language ID.
22 23 24 |
# File 'lib/ttfunk/table/name.rb', line 22 def language_id @language_id end |
#platform_id ⇒ Integer (readonly)
Platform ID.
14 15 16 |
# File 'lib/ttfunk/table/name.rb', line 14 def platform_id @platform_id end |
Instance Method Details
#strip_extended ⇒ String
Removes chracter incompatible with PostScript.
37 38 39 40 41 |
# File 'lib/ttfunk/table/name.rb', line 37 def strip_extended stripped = gsub(/[\x00-\x19\x80-\xff]/n, '') stripped = '[not-postscript]' if stripped.empty? stripped end |