[WJG] (8th June, 2005) I recently found details of a bettew way to input romanised Sanskrit and Pali using a unicode compliant font. So, here's the revised version of this code. Rather than using unique codes, it creates compounds by stacking elements. So the long semi-vowel R, would be input as, "r . -". # ------------------------------------------------------------- # skt_input_0.1b.tcl # Written by William J Giddings, 2005 # ------------------------------------------------------------- # Usage: # skt_input # # Purpose: # -------- # To provide text editing application with an easy access to the # specialist characters required in romanising the Indic languages. # # User operation: # --------------- # Use combination of "Letter + Alt-Key" to obtain letters with diacritics. # # Notes: # ------ # This version now uses the character stacking extensions used in Gentium. # # References: # ---------- # Obtain suitable fonts from: # http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium # # Extra information and resources including the excellent BabelMap Unicode viewer: # http://www.babelstone.co.uk # # ------------------------------------------------------------- # Reminders # What input method is most convenient? # ------------------------------------------------------------- # setup custome bindings to handle input of Sanksrit # ------------------------------------------------------------- proc {skt_input} {txt} { bind $txt { puts "%k %K" if {[regexp [%W get insert-1char insert] {S s T t D d R r L l M m N n} ]} { %W insert insert \u0323 } } bind $txt { if {[regexp [%W get insert-1char insert] {N n} ]} { %W insert insert \u0303 } } bind $txt { if {[regexp [%W get insert-1char insert] {S s} ]} { %W insert insert \u0301 } } bind $txt { if {[regexp [%W get insert-1char insert] {A a I i O o U u} ]} { %W insert insert \u0304 return } if {[regexp [%W get insert-2char insert-1char] {l L r R} ]} { %W insert insert \u0304 } } } # ------------------------------------------------------------- # test the code # ------------------------------------------------------------- proc demo {} { package require Tk text .txt -font {{Gentium} 14} pack .txt -fill both -expand 1 skt_input .txt } demo