 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays alien alien.c-types alien.syntax kernel destructors
-parser accessors fry words hashtables sequences math math.functions locals
+USING: arrays alien alien.c-types alien.syntax kernel destructors words
+parser accessors fry words hashtables sequences memoize
+assocs math math.functions locals init
 core-foundation core-foundation.strings
 core-foundation.attributed-strings
 core-graphics core-graphics.types ;

    [ CTLineGetTypographicBounds ] 3keep [ *CGFloat ] tri@
    typographic-bounds boa ;

TUPLE: line string font line bounds dim bitmap disposed ;

: bounds>dim ( bounds -- dim )
    [ width>> ] [ [ ascent>> ] [ descent>> ] bi + ] bi

    [
        [ <CFString> &CFRelease ] dip f CTFontCreateWithName
    ] with-destructors ;

MEMO: cached-font ( name size -- font ) <CTFont> ;

<<

