Class: HexaPDF::Font::InvalidGlyph
- Inherits:
-
Object
- Object
- HexaPDF::Font::InvalidGlyph
- Defined in:
- lib/hexapdf/font/invalid_glyph.rb
Overview
Represents an invalid glyph, i.e. a Unicode character that has no representation in the used font.
Instance Attribute Summary collapse
-
#str ⇒ Object
readonly
The string that could not be represented as a glyph.
Instance Method Summary collapse
-
#apply_word_spacing? ⇒ Boolean
Word spacing is never applied for the invalid glyph, so
falseis returned. -
#id ⇒ Object
(also: #name)
Returns the appropriate missing glyph id based on the used font.
-
#initialize(font, str) ⇒ InvalidGlyph
constructor
Creates a new Glyph object.
-
#inspect ⇒ Object
:nodoc:.
-
#x_min ⇒ Object
(also: #x_max, #y_min, #y_max, #width)
Returns 0.
Constructor Details
#initialize(font, str) ⇒ InvalidGlyph
Creates a new Glyph object.
48 49 50 51 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 48 def initialize(font, str) @font = font @str = str end |
Instance Attribute Details
#str ⇒ Object (readonly)
The string that could not be represented as a glyph.
45 46 47 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 45 def str @str end |
Instance Method Details
#apply_word_spacing? ⇒ Boolean
Word spacing is never applied for the invalid glyph, so false is returned.
69 70 71 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 69 def apply_word_spacing? false end |
#id ⇒ Object Also known as: name
Returns the appropriate missing glyph id based on the used font.
54 55 56 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 54 def id @font.missing_glyph_id end |
#inspect ⇒ Object
:nodoc:
74 75 76 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 74 def inspect "#<#{self.class.name} font=#{@font.full_name.inspect} id=#{id} #{@str.inspect}>" end |
#x_min ⇒ Object Also known as: x_max, y_min, y_max, width
Returns 0.
60 61 62 |
# File 'lib/hexapdf/font/invalid_glyph.rb', line 60 def x_min 0 end |