Class: HexaPDF::Font::InvalidGlyph

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#strObject (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.

Returns:

  • (Boolean)


69
70
71
# File 'lib/hexapdf/font/invalid_glyph.rb', line 69

def apply_word_spacing?
  false
end

#idObject 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

#inspectObject

: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_minObject 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