! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel assocs math sequences fry io.encodings.string
-io.encodings.utf16n accessors arrays combinators destructors locals
-cache namespaces init images.normalization fonts alien.c-types
-windows windows.usp10 windows.offscreen windows.gdi32
-windows.ole32 windows.types windows.fonts opengl.textures ;
+io.encodings.utf16n accessors arrays combinators destructors
+cache namespaces init fonts alien.c-types windows.usp10
+windows.offscreen windows.gdi32 windows.ole32 windows.types
+windows.fonts opengl.textures locals windows.errors ;
IN: windows.uniscribe
TUPLE: script-string font string metrics ssa size image disposed ;
: line-offset>x ( n script-string -- x )
2dup string>> length = [
ssa>> ! ssa
- swap 1- ! icp
+ swap 1 - ! icp
TRUE ! fTrailing
] [
ssa>>
ssa>> ! ssa
0 ! iX
0 ! iY
- 0 ! uOptions
- f ! prc
+ ETO_OPAQUE ! uOptions
]
- [ selection-start/end ] bi
+ [ [ { 0 0 } ] dip size>> <RECT> ]
+ [ selection-start/end ] tri
! iMinSel
! iMaxSel
FALSE ! fDisabled
: draw-script-string ( dc script-string -- )
[ font>> set-dc-colors ] keep (draw-script-string) ;
-: script-string-bitmap-size ( script-string -- dim )
- size>> dup small-texture? [ [ next-power-of-2 ] map ] when ;
-
:: make-script-string-image ( dc script-string -- image )
- script-string script-string-bitmap-size dc
+ script-string size>> dc
[ dc script-string draw-script-string ] make-bitmap-image ;
: set-dc-font ( dc font -- )
SYMBOL: cached-script-strings
-: cached-script-string ( string font -- script-string )
+: cached-script-string ( font string -- script-string )
cached-script-strings get-global [ <script-string> ] 2cache ;
[ <cache-assoc> cached-script-strings set-global ]
-"windows.uniscribe" add-init-hook
\ No newline at end of file
+"windows.uniscribe" add-init-hook