class HexaPDF::Content::Processor::GlyphBox


Represents an (immutable) glyph box with positioning information.

Since the glyph may have been transformed by an affine matrix, the bounding box may not be a rectangle in all cases but it is always a parallelogram.



The code point representing the glyph.


The Unicode value of the code point.

Public Class Methods

new(code_point, string, llx, lly, lrx, lry, ulx, uly)

Creates a new glyph box for the given code point/Unicode value pair with the lower left coordinate [llx, lly], the lower right coordinate [lrx, lry], and the upper left coordinate [ulx, uly].

Public Instance Methods

lower_left → [llx, lly]

Returns the lower left coordinate

lower_right → [lrx, lry]

Returns the lower right coordinate

points → [llx, lly, lrx, lry, urx, ury, ulx, uly]

Returns the four corners of the box as an array of coordinates, starting with the lower left corner and going counterclockwise.

upper_left → [ulx, uly]

Returns the upper left coordinate

upper_right → [urx, ury]

Returns the upper right coordinate which is computed by using the other three points of the parallelogram.