def line_size(line, style):
    """Get logical width and height of the given ``line``.

    ``style`` is used to add letter spacing (if needed).

    """
    logical_extents = ffi.new('PangoRectangle *')
    pango.pango_layout_line_get_extents(line, ffi.NULL, logical_extents)
    width = logical_extents.width * FROM_UNITS
    height = logical_extents.height * FROM_UNITS
    ffi.release(logical_extents)
    if style['letter_spacing'] != 'normal':
        width += style['letter_spacing']
    return width, height
Get logical width and height of the given ``line``.

``style`` is used to add letter spacing (if needed).
weasyprint/text/line_break.py