Class: RubyRTF::Font
- Inherits:
-
Object
- Object
- RubyRTF::Font
- Defined in:
- lib/ruby-rtf/font.rb
Overview
Holds the information for a given font
Constant Summary collapse
- FAMILIES =
The font families
[:nil, :roman, :swiss, :modern, :script, :decor, :tech, :bldl]
- PITCHES =
The font pitch values
[:default, :fixed, :variable]
Instance Attribute Summary collapse
-
#alternate_name ⇒ String
The alternate name for this font.
-
#character_set ⇒ Integer
The character set number for the font.
-
#family_command ⇒ Symbol
The font family command.
-
#name ⇒ String
The font name.
-
#non_tagged_name ⇒ String
The non-tagged name for the font.
-
#number ⇒ Integer
The font numberb.
-
#panose ⇒ String
The panose number for the font.
-
#pitch ⇒ Symbol
The pitch information for this font.
-
#theme ⇒ Symbol
The theme for this font.
Instance Method Summary collapse
-
#cleanup_names ⇒ Nil
Cleans up the various font names.
-
#initialize(name = '') ⇒ RubyRTF::Font
constructor
Creates a new font.
-
#to_s ⇒ String
Convert to string format.
Constructor Details
#initialize(name = '') ⇒ RubyRTF::Font
Creates a new font
41 42 43 44 45 46 47 |
# File 'lib/ruby-rtf/font.rb', line 41 def initialize(name = '') @family_command = :nil @name = name @alternate_name = '' @non_tagged_name = '' @panose = '' end |
Instance Attribute Details
#alternate_name ⇒ String
Returns The alternate name for this font.
11 12 13 |
# File 'lib/ruby-rtf/font.rb', line 11 def alternate_name @alternate_name end |
#character_set ⇒ Integer
Returns The character set number for the font.
23 24 25 |
# File 'lib/ruby-rtf/font.rb', line 23 def character_set @character_set end |
#family_command ⇒ Symbol
Returns The font family command.
29 30 31 |
# File 'lib/ruby-rtf/font.rb', line 29 def family_command @family_command end |
#name ⇒ String
Returns The font name.
8 9 10 |
# File 'lib/ruby-rtf/font.rb', line 8 def name @name end |
#non_tagged_name ⇒ String
Returns The non-tagged name for the font.
26 27 28 |
# File 'lib/ruby-rtf/font.rb', line 26 def non_tagged_name @non_tagged_name end |
#number ⇒ Integer
Returns The font numberb.
5 6 7 |
# File 'lib/ruby-rtf/font.rb', line 5 def number @number end |
#panose ⇒ String
Returns The panose number for the font.
14 15 16 |
# File 'lib/ruby-rtf/font.rb', line 14 def panose @panose end |
#pitch ⇒ Symbol
Returns The pitch information for this font.
20 21 22 |
# File 'lib/ruby-rtf/font.rb', line 20 def pitch @pitch end |
#theme ⇒ Symbol
Returns The theme for this font.
17 18 19 |
# File 'lib/ruby-rtf/font.rb', line 17 def theme @theme end |
Instance Method Details
#cleanup_names ⇒ Nil
Cleans up the various font names
60 61 62 63 64 |
# File 'lib/ruby-rtf/font.rb', line 60 def cleanup_names @name = cleanup_name(@name) @alternate_name = cleanup_name(@alternate_name) @non_tagged_name = cleanup_name(@non_tagged_name) end |
#to_s ⇒ String
Convert to string format
69 70 71 |
# File 'lib/ruby-rtf/font.rb', line 69 def to_s "#{number}: #{name}" end |