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.
Source Code
lib/ttfunk/table/name.rb, line 28
28 | def initialize(text, platform_id, encoding_id, language_id) |
29 | super(text) |
30 | @platform_id = platform_id |
31 | @encoding_id = encoding_id |
32 | @language_id = language_id |
33 | end
|
Instance Attribute Details
#encoding_id ⇒ Integer (readonly)
Platform-specific encoding ID.
Source Code
lib/ttfunk/table/name.rb, line 18
18 | def encoding_id |
19 | @encoding_id
|
20 | end
|
#language_id ⇒ Integer (readonly)
Language ID.
Source Code
lib/ttfunk/table/name.rb, line 22
22 | def language_id |
23 | @language_id
|
24 | end
|
#platform_id ⇒ Integer (readonly)
Platform ID.
Source Code
lib/ttfunk/table/name.rb, line 14
14 | def platform_id |
15 | @platform_id
|
16 | end
|
Instance Method Details
#strip_extended ⇒ String
Removes chracter incompatible with PostScript.
Source Code
lib/ttfunk/table/name.rb, line 37
37 | def strip_extended |
38 | stripped = gsub(/[\x00-\x19\x80-\xff]/n, '') |
39 | stripped = '[not-postscript]' if stripped.empty? |
40 | stripped
|
41 | end
|