From 97c9504bcf2e1775147b58da7c488af89f6b8122 Mon Sep 17 00:00:00 2001 From: Muthiah Annamalai Date: Mon, 4 Sep 2017 22:47:21 -0700 Subject: [PATCH] =?UTF-8?q?=E0=AE=8E=E0=AE=B4=E0=AE=BF=E0=AE=B2=E0=AF=8D?= =?UTF-8?q?=20=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AE=BF=E0=AE=AF=E0=AF=80?= =?UTF-8?q?=E0=AE=9F=E0=AF=81=20=E0=AE=8E=E0=AE=A3=E0=AF=8D=200.99=20?= =?UTF-8?q?=E0=AE=AA=E0=AE=B0=E0=AF=8D=E0=AE=9A=E0=AE=BF=E0=AE=AF=E0=AF=8B?= =?UTF-8?q?=E0=AE=A4=E0=AE=A9=E0=AF=88=20=E0=AE=B5=E0=AE=B4=E0=AF=81?= =?UTF-8?q?=E0=AE=95=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D=20#201=20-=20fix?= =?UTF-8?q?=20*pira*=20keyboard=20label=20-=20fix=20tamil-99=20keystroke?= =?UTF-8?q?=20to=20avoid=20non-Tamil=20unicode=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editor/OSKeyboardWidget.py | 6 +++--- editor/ezhuthi.py | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/editor/OSKeyboardWidget.py b/editor/OSKeyboardWidget.py index e4a0767..eaad2e7 100644 --- a/editor/OSKeyboardWidget.py +++ b/editor/OSKeyboardWidget.py @@ -29,7 +29,7 @@ def __init__(self,lang,keys3rows,shift_keys3rows): self.keys3rows_btns = [] self.mode = u"non-numeric" self.spc = u" "*16 - self.shift_words = [u"பிர", u"Shift"] + self.shift_words = [u"பிற", u"Shift"] self.shiftmode = False def __str__(self): @@ -58,8 +58,8 @@ def padded(self,key_rows,numerickdb=False): if numerickdb: rows2[-1][1] = u"ஆங்" else: - if rows2[-1][0].find(u"பிர") == -1: - rows2[-1].insert(0,u"பிர") + if rows2[-1][0].find(u"பிற") == -1: + rows2[-1].insert(0,u"பிற") rows2[-1].insert(len(rows2[-1]),u"<- அழி") rows2.append([u"0-9",u"ஆங்",self.spc+u"வெளி"+self.spc,u"் ",u"இடு"]) if numerickdb: diff --git a/editor/ezhuthi.py b/editor/ezhuthi.py index 8585111..2d19760 100644 --- a/editor/ezhuthi.py +++ b/editor/ezhuthi.py @@ -551,15 +551,32 @@ def insert_tamil99_at_cursor(widget,value,lang=u"Tamil"): ed.textview.place_cursor_onscreen() return elif value == u"் ": + if not m_start.starts_line(): + offset = m_start.get_offset() + m_prev = ed.textbuffer.get_iter_at_offset(offset-1) + old_value = ed.textbuffer.get_text(m_prev,m_start,True) + # encoding conversion + if not PYTHON3: + try: + old_value = old_value.decode("UTF-8") + except Exception as e: + pass + if not (old_value in tamil.utf8.grantha_agaram_letters): + # these letters in keyboard cannot be used with pulli - it is bad combination of unicode points + # and don't form valid letters in Tamil; so we will keep them + ed.textbuffer.insert_at_cursor(tamil.utf8.ayudha_letter) + else: + ed.textbuffer.insert_at_cursor(value) + return ed.textbuffer.insert_at_cursor(value) ed.textview.place_cursor_onscreen() return - + # dispose of English language stuff if lang.lower().find("eng") >= 0: Editor.insert_at_cursor(widget,value) return - + if not m_start.starts_line(): offset = m_start.get_offset() m_prev = ed.textbuffer.get_iter_at_offset(offset-1)