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.



45
46
47
48
# File 'lib/hexapdf/font/invalid_glyph.rb', line 45

def initialize(font, str)
  @font = font
  @str = str
end

Instance Attribute Details

#strObject (readonly)

The string that could not be represented as a glyph.



42
43
44
# File 'lib/hexapdf/font/invalid_glyph.rb', line 42

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)


66
67
68
# File 'lib/hexapdf/font/invalid_glyph.rb', line 66

def apply_word_spacing?
  false
end

#idObject Also known as: name

Returns the appropriate missing glyph id based on the used font.



51
52
53
# File 'lib/hexapdf/font/invalid_glyph.rb', line 51

def id
  @font.missing_glyph_id
end

#inspectObject

:nodoc:



71
72
73
# File 'lib/hexapdf/font/invalid_glyph.rb', line 71

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.



57
58
59
# File 'lib/hexapdf/font/invalid_glyph.rb', line 57

def x_min
  0
end