Class: HexaPDF::Type::FontType3
- Inherits:
-
FontSimple
- Object
- Object
- Dictionary
- Font
- FontSimple
- HexaPDF::Type::FontType3
- Defined in:
- lib/hexapdf/type/font_type3.rb
Overview
Represents a Type 3 font.
Note: We assume the /FontMatrix is only used for scaling, i.e. of the form [x 0 0 +/-x 0 0]. If it is of a different form, things won’t work correctly. This will be handled once such a case is found.
See: PDF2.0 s9.6.4
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
-
#bounding_box ⇒ Object
Returns the bounding box of the font.
-
#glyph_scaling_factor ⇒ Object
Returns the glyph scaling factor for transforming from glyph space to text space.
Methods inherited from FontSimple
#decode, #encoding, #font_descriptor, #symbolic?, #to_utf8, #width, #word_spacing_applicable?, #writing_mode
Methods inherited from Font
#embedded?, #font_file, #font_wrapper, #font_wrapper=, #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
#bounding_box ⇒ Object
Returns the bounding box of the font.
58 59 60 61 62 63 64 65 66 |
# File 'lib/hexapdf/type/font_type3.rb', line 58 def bounding_box matrix = self[:FontMatrix] bbox = self[:FontBBox].value if matrix[3] < 0 # Some writers invert the y-axis bbox = bbox.dup bbox[1], bbox[3] = -bbox[3], -bbox[1] end bbox end |
#glyph_scaling_factor ⇒ Object
Returns the glyph scaling factor for transforming from glyph space to text space.
69 70 71 |
# File 'lib/hexapdf/type/font_type3.rb', line 69 def glyph_scaling_factor self[:FontMatrix][0] end |