Exception: HexaPDF::MissingGlyphError
- Defined in:
- lib/hexapdf/error.rb
Overview
Raised when a font wrapper implementation should encode a missing glyph.
Instance Attribute Summary collapse
-
#glyph ⇒ Object
readonly
Returns the glyph object that contains the information about the missing glyph.
Instance Method Summary collapse
-
#initialize(glyph) ⇒ MissingGlyphError
constructor
Creates a new MissingGlyphError for the given
glyph
. -
#message ⇒ Object
:nodoc:.
Constructor Details
#initialize(glyph) ⇒ MissingGlyphError
Creates a new MissingGlyphError for the given glyph
.
92 93 94 |
# File 'lib/hexapdf/error.rb', line 92 def initialize(glyph) @glyph = glyph end |
Instance Attribute Details
#glyph ⇒ Object (readonly)
Returns the glyph object that contains the information about the missing glyph.
89 90 91 |
# File 'lib/hexapdf/error.rb', line 89 def glyph @glyph end |
Instance Method Details
#message ⇒ Object
:nodoc:
96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/hexapdf/error.rb', line 96 def # :nodoc: str = "No glyph for #{glyph.str.inspect} in font '#{glyph.font_wrapper.wrapped_font.full_name}' " \ "found. \n\n" str << if glyph.font_wrapper.font_type == :Type1 "The used Type1 font only contains a very limited number of glyphs. TrueType " \ "fonts usually provide a much wider array of glyphs. Use the configuration option " \ "'font.map' to register appropriate font files. Also have a look at the " \ "'font.default' and 'font.fallback' options. " else "Maybe register another #{glyph.font_wrapper.font_type} font that contains the " \ "needed glyph and use it as fallback via the configuration option 'font.fallback'." end end |