Name
pango.ExtentsToPixels -- convert extents from Pango to device units
Synopsis
r1, r2 = pango.ExtentsToPixels(inclusive, nearest)
Function
Converts extents from Pango units to device units. The conversion is done by dividing by the #PANGO_SCALE factor and performing rounding. The inclusive and nearest arguments must be tables that have the fields x, y, width, and height initialized. If you don't need one of the rectangles, you can also set it to Nil.

The inclusive rectangle is converted by flooring the x/y coordinates and extending width/height, such that the final rectangle completely includes the original rectangle.

The nearest rectangle is converted by rounding the coordinates of the rectangle to the nearest device unit (pixel).

The rule to which argument to use is: if you want the resulting device-space rectangle to completely contain the original rectangle, pass it in as inclusive. If you want two touching-but-not-overlapping rectangles stay touching-but-not-overlapping after rounding to device units, pass them in as nearest.

Inputs
inclusive
rectangle to round to pixels inclusively or Nil
nearest
rectangle to round to nearest pixels or Nil
Results
r1
rounded inclusive rectangle
r2
rounded nearest rectangle

Show TOC