class HexaPDF::Content::Processor::GlyphBox
rectangle in all cases but it is always a parallelogram.
Since the glyph may have been transformed by an affine matrix, the bounding box may not be a
Represents an (immutable) glyph box with positioning information.
def initialize(code_point, string, llx, lly, lrx, lry, ulx, uly)
coordinate [llx, lly], the lower right coordinate [lrx, lry], and the upper left
Creates a new glyph box for the given code point/Unicode value pair with the lower left
def initialize(code_point, string, llx, lly, lrx, lry, ulx, uly) @code_point = code_point @string = string.freeze @llx = llx @lly = lly @lrx = lrx @lry = lry @ulx = ulx @uly = uly freeze end
def lower_left
glyph_box.lower_left -> [llx, lly]
:call-seq:
def lower_left [@llx, @lly] end
def lower_right
glyph_box.lower_right -> [lrx, lry]
:call-seq:
def lower_right [@lrx, @lry] end
def points
Returns the four corners of the box as an array of coordinates, starting with the lower
glyph_box.points -> [llx, lly, lrx, lry, urx, ury, ulx, uly]
:call-seq:
def points [@llx, @lly, @lrx, @lry, @ulx + (@lrx - @llx), @uly + (@lry - @lly), @ulx, @uly] end
def upper_left
glyph_box.upper_left -> [ulx, uly]
:call-seq:
def upper_left [@ulx, @uly] end
def upper_right
Returns the upper right coordinate which is computed by using the other three points of
glyph_box.upper_right -> [urx, ury]
:call-seq:
def upper_right [@ulx + (@lrx - @llx), @uly + (@lry - @lly)] end