! Copyright (C) 2009 Slava Pestov.\r
! See http://factorcode.org/license.txt for BSD license.\r
-USING: accessors assocs cache kernel math.vectors sequences\r
+USING: accessors assocs cache kernel math math.vectors sequences fonts\r
namespaces opengl.textures ui.text ui.text.private ui.gadgets.worlds \r
windows.uniscribe ;\r
IN: ui.text.uniscribe\r
\r
: rendered-script-string ( font string -- texture )\r
world get world-text-handle\r
- [ cached-script-string [ image>> ] [ text-position vneg ] bi <texture> ]\r
+ [ cached-script-string image>> { 0 0 } <texture> ]\r
2cache ;\r
\r
M: uniscribe-renderer draw-string ( font string -- )\r
- [ drop ] [ rendered-script-string draw-texture ] if-empty ;\r
+ dup dup selection? [ string>> ] when empty?\r
+ [ 2drop ] [ rendered-script-string draw-texture ] if ;\r
\r
M: uniscribe-renderer x>offset ( x font string -- n )\r
[ 2drop 0 ] [\r
- cached-script-string x>line-offset drop\r
+ cached-script-string x>line-offset 0 = [ 1 + ] unless\r
] if-empty ;\r
\r
M: uniscribe-renderer offset>x ( n font string -- x )\r