]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/text/uniscribe/uniscribe.factor
basis: removing unnecessary method stack effects.
[factor.git] / basis / ui / text / uniscribe / uniscribe.factor
1 ! Copyright (C) 2009, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors cache kernel math math.vectors namespaces
4 sequences ui.text ui.text.private windows.uniscribe ;
5 IN: ui.text.uniscribe
6
7 SINGLETON: uniscribe-renderer
8
9 M: uniscribe-renderer string-dim
10     [ " " string-dim { 0 1 } v* ]
11     [ cached-script-string size>> ] if-empty ;
12
13 M: uniscribe-renderer flush-layout-cache
14     cached-script-strings get-global purge-cache ;
15
16 M: uniscribe-renderer string>image
17     cached-script-string script-string>image { 0 0 } ;
18
19 M: uniscribe-renderer x>offset
20     [ 2drop 0 ] [
21         cached-script-string x>line-offset 0 = [ 1 + ] unless
22     ] if-empty ;
23
24 M: uniscribe-renderer offset>x
25     [ 2drop 0 ] [ cached-script-string line-offset>x ] if-empty ;
26
27 M: uniscribe-renderer font-metrics
28     " " cached-script-string metrics>> clone f >>width ;
29
30 M: uniscribe-renderer line-metrics
31     [ " " line-metrics clone 0 >>width ]
32     [ cached-script-string metrics>> 50 >>width 10 >>cap-height 10 >>x-height ]
33     if-empty ;
34
35 uniscribe-renderer font-renderer set-global