From 4060f7d3955aa4783e6b2c6256ea69700e5be0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 28 Aug 2012 16:36:42 +0000 Subject: GUI-plugin for bidirectional text support think arabic, think hebrew svn path=/trunk/guiplugins/bidi-plugin/; revision=16182 --- bidi-plugin.tcl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bidi-plugin.tcl (limited to 'bidi-plugin.tcl') diff --git a/bidi-plugin.tcl b/bidi-plugin.tcl new file mode 100644 index 0000000..ed3d8e4 --- /dev/null +++ b/bidi-plugin.tcl @@ -0,0 +1,32 @@ +# META bidi plugin +# META DESCRIPTION bidirectional text input +# META AUTHOR IOhannes m zmölnig +# META VERSION 0.1 + +package require Tcl 8.4 + +set auto_path_bidi $auto_path +lappend auto_path $::current_plugin_loadpath + +if {[catch {package require fribidi} result]} { +pdtk_post "failed to load bidi-plugin: $result\n" +} else { + +########################################################### +# overwritten procedures +rename pdtk_text_set pdtk_text_set_bidi +rename pdtk_text_new pdtk_text_new_bidi + +########################################################### +# overwritten + +# change the text in an existing text box +proc pdtk_text_set {tkcanvas tag text} { + pdtk_text_set_bidi $tkcanvas $tag [fribidi::log2vis $text] +} +proc pdtk_text_new {tkcanvas tags x y text font_size color} { + pdtk_text_new_bidi $tkcanvas $tags $x $y [fribidi::log2vis $text] $font_size $color +} +pdtk_post "loaded: bidi-plugin 0.1\n" +} +set auto_path $auto_path_bidi -- cgit v1.2.1