Class: HexaPDF::Type::FontTrueType
- Inherits:
-
FontSimple
- Object
- Object
- Dictionary
- Font
- FontSimple
- HexaPDF::Type::FontTrueType
- Defined in:
- lib/hexapdf/type/font_true_type.rb
Overview
Represents a TrueType font.
See: PDF2.0 s9.6.3
Constant Summary
Constants included from DictionaryFields
DictionaryFields::Boolean, DictionaryFields::PDFByteString, DictionaryFields::PDFDate
Instance Attribute Summary
Attributes inherited from Object
#data, #document, #must_be_indirect
Instance Method Summary collapse
-
#font_wrapper ⇒ Object
Overrides the default to provide a font wrapper in case none is set and a complete TrueType is embedded.
Methods inherited from FontSimple
#decode, #encoding, #font_descriptor, #symbolic?, #to_utf8, #width, #word_spacing_applicable?, #writing_mode
Methods inherited from Font
#bounding_box, #embedded?, #font_file, #font_wrapper=, #glyph_scaling_factor, #must_be_indirect?, #to_utf8
Methods inherited from Dictionary
#[], #[]=, define_field, define_type, #delete, #each, each_field, #empty?, field, #key?, #to_hash, type, #type
Methods inherited from Object
#<=>, #==, #cache, #cached?, #clear_cache, deep_copy, #deep_copy, #document?, #eql?, field, #gen, #gen=, #hash, #indirect?, #initialize, #inspect, make_direct, #must_be_indirect?, #null?, #oid, #oid=, #type, #validate, #value, #value=
Constructor Details
This class inherits a constructor from HexaPDF::Object
Instance Method Details
#font_wrapper ⇒ Object
Overrides the default to provide a font wrapper in case none is set and a complete TrueType is embedded.
See: Font#font_wrapper
55 56 57 58 59 60 61 62 |
# File 'lib/hexapdf/type/font_true_type.rb', line 55 def font_wrapper if (tmp = super) tmp elsif (font_file = self.font_file) && self[:BaseFont].to_s !~ /\A[A-Z]{6}\+/ font = HexaPDF::Font::TrueType::Font.new(StringIO.new(font_file.stream)) @font_wrapper = HexaPDF::Font::TrueTypeWrapper.new(document, font, subset: true) end end |