     [
         [ <CFString> &CFRelease ] dip f CTFontCreateWithName
     ] with-destructors ;
+
+MEMO: cached-font ( name size -- font ) <CTFont> ;
 
 <<
 

        2dup <CTLine> |CFRelease
        dup line-typographic-bounds
        dup bounds>dim 3dup [ draw-line ] with-bitmap-context
        f line boa
    ] with-destructors ;

M: line dispose*
    [
        [ font>> &CFRelease drop ]
        [ line>> &CFRelease drop ] bi
    ] with-destructors ;
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
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 ;
