Class: HexaPDF::Type::FontTrueType

Inherits:
FontSimple show all
Defined in:
lib/hexapdf/type/font_true_type.rb

Overview

Represents a TrueType font.

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

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_h, 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_wrapperObject

Overrides the default to provide a font wrapper in case none is set and a complete TrueType is embedded.

See: Font#font_wrapper



53
54
55
56
57
58
59
60
# File 'lib/hexapdf/type/font_true_type.rb', line 53

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