diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2012-08-28 16:36:42 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2012-08-28 16:36:42 +0000 |
commit | 4060f7d3955aa4783e6b2c6256ea69700e5be0bd (patch) | |
tree | 958f0122014ca6957e9461b66fe6f7ddedcd0bd0 /bidi-plugin.tcl |
GUI-plugin for bidirectional text supportsvn2git-root
think arabic, think hebrew
svn path=/trunk/guiplugins/bidi-plugin/; revision=16182
Diffstat (limited to 'bidi-plugin.tcl')
-rw-r--r-- | bidi-plugin.tcl | 32 |
1 files changed, 32 insertions, 0 deletions
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 <zmoelnig@umlaeute.mur.at> +# 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 |