aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2012-08-28 16:36:42 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2012-08-28 16:36:42 +0000
commit4060f7d3955aa4783e6b2c6256ea69700e5be0bd (patch)
tree958f0122014ca6957e9461b66fe6f7ddedcd0bd0
GUI-plugin for bidirectional text supportsvn2git-root
think arabic, think hebrew svn path=/trunk/guiplugins/bidi-plugin/; revision=16182
-rw-r--r--README.txt46
-rw-r--r--bidi-plugin.tcl32
2 files changed, 78 insertions, 0 deletions
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..38377cb
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,46 @@
+bidirectional text input support for Pd
+=======================================
+
+while Pd>=0.43 has support for UTF-8 characters, there are still some problems
+with text-input of middle-eastern characters, that have a right-to-left text
+orientation (hebrew, arabic,...)
+this plugin tries to solve this, by fixing the text-orientation for such texts.
+
+
+INSTALLATION
+------------
+you will need the tcl-fribidi bindings.
+get it from
+ https://github.com/umlaeute/tcl-fribidi/
+and follow the tcl-fribidi instructions for compiling.
+it should be something like:
+ $ cd tcl-fribidi/
+ $ autoconf
+ $ ./configure
+ $ make
+(note that you need the libfribidi library (dev-package!) installed)
+compiling tcl-fribidi should give you these files:
+ libfribidi0.1.so (version '0.1' might be different)
+ pkgIndex.tcl
+copy these two files into the bidi-plugin/ directory (where you are currently
+reading THIS readme.txt)
+
+finally copy the entire bidi-plugin/ directory into ~/pd-externals/, so you end
+up with
+ ~/pd-externals/bidi-plugin/bidi-plugin.tcl
+ ~/pd-externals/bidi-plugin/libfribidi0.1.so
+ ~/pd-externals/bidi-plugin/pkgIndex.tcl
+ ~/pd-externals/bidi-plugin/README.txt
+
+now start Pd.
+you should see a "loaded: bidi-plugin 0.1" message.
+
+once you type in hebrew or arabic letters, you should see that they will be
+displayed in the correct order.
+
+
+
+
+AUTHOR
+------
+IOhannes m zmölnig
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