package provide Freetype::ftbbox 0.1

if {![info exists _source([file tail [info script]])]} {
package require Freetype::ft2build
package require $FT_FREETYPE

::ffidl::callout _FT_Outline_Get_BBox {pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Get_BBox]
proc FT_Outline_Get_BBox {outline bboxVarName} {
    upvar $bboxVarName bbox
    if {[info exists bbox] == 0} {
        set bbox [FT_BBox new]
    }
    set result [_FT_Outline_Get_BBox [$outline getPointer] [$bbox getPointer]]
    return $result
}

set _source([file tail [info script]]) 1
}
