aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2017-08-01 10:39:30 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2017-08-21 12:47:59 +0000
commit4bd38e1de5a893a1cf6ba04686b2ff73077d61cb (patch)
tree7554408847d822c41bffcd2f232dda60a8bc6215
parent55b63ce2b6f9312c471b77bb06fae8fe71fd6513 (diff)
Add Arabic handwriting
[ChangeLog] Added Arabic handwriting. Change-Id: Ica0601da2df262369159415d28fdb183e6f63736 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/virtualkeyboard/3rdparty/t9write/t9write.pro1
-rw-r--r--src/virtualkeyboard/3rdparty/t9write/unpack.py3
-rw-r--r--src/virtualkeyboard/content/components/InputModeKey.qml1
-rw-r--r--src/virtualkeyboard/content/layouts/ar_AR/handwriting.qml116
-rw-r--r--src/virtualkeyboard/content/layouts/ar_AR/main.qml12
-rw-r--r--src/virtualkeyboard/content/styles/default/style.qml5
-rw-r--r--src/virtualkeyboard/content/styles/retro/style.qml5
-rw-r--r--src/virtualkeyboard/doc/src/build.qdoc2
-rw-r--r--src/virtualkeyboard/hunspellinputmethod.cpp3
-rw-r--r--src/virtualkeyboard/inputengine.cpp3
-rw-r--r--src/virtualkeyboard/inputengine.h1
-rw-r--r--src/virtualkeyboard/plaininputmethod.cpp3
-rw-r--r--src/virtualkeyboard/t9writeinputmethod.cpp28
-rw-r--r--src/virtualkeyboard/virtualkeyboard.pro2
-rw-r--r--tests/auto/inputpanel/data/inputpanel/handwriting.js3
-rw-r--r--tests/auto/inputpanel/data/inputpanel/inputpanel.qml2
-rw-r--r--tests/auto/inputpanel/data/inputpanel/unipen_data_arabic.js1170
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml1
-rw-r--r--tests/auto/inputpanel/hwr_test_data/arabic/1575_100_0.txt28
-rw-r--r--tests/auto/inputpanel/hwr_test_data/arabic/1576_100_0.txt59
-rw-r--r--tests/auto/inputpanel/hwr_test_data/arabic/1578_100_0.txt77
-rw-r--r--tests/auto/inputpanel/hwr_test_data/arabic/1603_100_0.txt99
22 files changed, 1621 insertions, 3 deletions
diff --git a/src/virtualkeyboard/3rdparty/t9write/t9write.pro b/src/virtualkeyboard/3rdparty/t9write/t9write.pro
index f6dddf1c..1a41a03d 100644
--- a/src/virtualkeyboard/3rdparty/t9write/t9write.pro
+++ b/src/virtualkeyboard/3rdparty/t9write/t9write.pro
@@ -3,6 +3,7 @@ TARGET = qtt9write_db
CONFIG += static
T9WRITE_RESOURCE_FILES = \
+ $$files(data/arabic/*.bin) \
$$files(data/*.bin) \
$$files(data/*.ldb) \
$$files(data/*.hdb) \
diff --git a/src/virtualkeyboard/3rdparty/t9write/unpack.py b/src/virtualkeyboard/3rdparty/t9write/unpack.py
index bf02a23a..66ad4f0c 100644
--- a/src/virtualkeyboard/3rdparty/t9write/unpack.py
+++ b/src/virtualkeyboard/3rdparty/t9write/unpack.py
@@ -90,6 +90,9 @@ UNPACK_RULES = {
'*/xxt9wApiOem.h',
'*/xxt9wOem.h',
],
+'data/arabic': [
+ '*/Arabic/_databas_le.bin',
+],
'data': [
'*/_databas_le.bin',
'*/*.hdb',
diff --git a/src/virtualkeyboard/content/components/InputModeKey.qml b/src/virtualkeyboard/content/components/InputModeKey.qml
index 2b7492a4..feec20b5 100644
--- a/src/virtualkeyboard/content/components/InputModeKey.qml
+++ b/src/virtualkeyboard/content/components/InputModeKey.qml
@@ -70,6 +70,7 @@ Key {
"全角", // InputEngine.FullwidthLatin
"ΑΒΓ", // InputEngine.Greek
"АБВ", // InputEngine.Cyrillic
+ "\u0623\u200C\u0628\u200C\u062C", // InputEngine.Arabic
"中文", // InputEngine.ChineseHandwriting
"日本語", // InputEngine.JapaneseHandwriting
"한국어", // InputEngine.KoreanHandwriting
diff --git a/src/virtualkeyboard/content/layouts/ar_AR/handwriting.qml b/src/virtualkeyboard/content/layouts/ar_AR/handwriting.qml
new file mode 100644
index 00000000..f84d47dc
--- /dev/null
+++ b/src/virtualkeyboard/content/layouts/ar_AR/handwriting.qml
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Layouts 1.0
+import QtQuick.VirtualKeyboard 2.3
+
+KeyboardLayout {
+ function createInputMethod() {
+ return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent)
+ }
+ sharedLayouts: ['symbols']
+ inputMode: InputEngine.Arabic
+ readonly property bool alphabeticInputMode: [InputEngine.Latin, InputEngine.Dialable].indexOf(InputContext.inputEngine.inputMode) !== -1
+
+ KeyboardRow {
+ Layout.preferredHeight: 3
+ KeyboardColumn {
+ Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width
+ KeyboardRow {
+ TraceInputKey {
+ objectName: "hwrInputArea"
+ patternRecognitionMode: InputEngine.HandwritingRecoginition
+ horizontalRulers:
+ alphabeticInputMode ? [] :
+ [Math.round(boundingBox.height / 4), Math.round(boundingBox.height / 4) * 2, Math.round(boundingBox.height / 4) * 3]
+ }
+ }
+ }
+ KeyboardColumn {
+ Layout.preferredWidth: hideKeyboardKey.width
+ KeyboardRow {
+ BackspaceKey {}
+ }
+ KeyboardRow {
+ EnterKey {}
+ }
+ KeyboardRow {
+ ShiftKey { }
+ }
+ }
+ }
+ KeyboardRow {
+ id: bottomRow
+ Layout.preferredHeight: 1
+ keyWeight: 154
+ InputModeKey {
+ weight: 217
+ inputModeNameList: [
+ "ABC", // InputEngine.Latin
+ "\u0660\u0661\u0662", // InputEngine.Numeric
+ "123", // InputEngine.Dialable
+ "", // InputEngine.Pinyin
+ "", // InputEngine.Cangjie
+ "", // InputEngine.Zhuyin
+ "", // InputEngine.Hangul
+ "", // InputEngine.Hiragana
+ "", // InputEngine.Katakana
+ "", // InputEngine.FullwidthLatin
+ "", // InputEngine.Greek
+ "", // InputEngine.Cyrillic
+ "\u0623\u200C\u0628\u200C\u062C", // InputEngine.Arabic
+ ]
+ }
+ ChangeLanguageKey {
+ weight: 154
+ customLayoutsOnly: true
+ }
+ HandwritingModeKey {
+ weight: 154
+ }
+ SpaceKey {
+ weight: 864
+ }
+ Key {
+ key: alphabeticInputMode ? Qt.Key_Apostrophe : 0x060C
+ text: alphabeticInputMode ? "'" : "\u060C"
+ alternativeKeys: alphabeticInputMode ? "<>()#%&*/\\\"'=+-_" : "\"\u060C\u066B\u066C\u066D"
+ }
+ Key {
+ key: Qt.Key_Period
+ text: "."
+ alternativeKeys: alphabeticInputMode ? ":;,.?!" : ":\u061B.\u061F!"
+ }
+ HideKeyboardKey {
+ id: hideKeyboardKey
+ weight: 204
+ }
+ }
+}
diff --git a/src/virtualkeyboard/content/layouts/ar_AR/main.qml b/src/virtualkeyboard/content/layouts/ar_AR/main.qml
index 9e53caca..e79847ec 100644
--- a/src/virtualkeyboard/content/layouts/ar_AR/main.qml
+++ b/src/virtualkeyboard/content/layouts/ar_AR/main.qml
@@ -28,10 +28,10 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.VirtualKeyboard 2.1
+import QtQuick.VirtualKeyboard 2.3
KeyboardLayoutLoader {
- inputMode: InputEngine.Latin
+ inputMode: InputEngine.Arabic
sourceComponent: InputContext.shift ? page2 : page1
Component {
id: page1
@@ -163,13 +163,16 @@ KeyboardLayoutLoader {
ChangeLanguageKey {
weight: 154
}
+ HandwritingModeKey {
+ weight: 154
+ }
SpaceKey {
weight: 864
}
Key {
key: 0x060C
text: "\u060C"
- alternativeKeys: ".,\u060C\u061F"
+ alternativeKeys: "\"\u061F\u060C.!:\u061B\u066B\u066C\u066D"
}
Key {
key: 0xE000
@@ -312,6 +315,9 @@ KeyboardLayoutLoader {
ChangeLanguageKey {
weight: 154
}
+ HandwritingModeKey {
+ weight: 154
+ }
SpaceKey {
weight: 864
}
diff --git a/src/virtualkeyboard/content/styles/default/style.qml b/src/virtualkeyboard/content/styles/default/style.qml
index 050cc276..595c7b79 100644
--- a/src/virtualkeyboard/content/styles/default/style.qml
+++ b/src/virtualkeyboard/content/styles/default/style.qml
@@ -760,12 +760,17 @@ KeyboardStyle {
text: {
switch (InputContext.inputEngine.inputMode) {
case InputEngine.Numeric:
+ if (["ar", "fa"].indexOf(InputContext.locale.substring(0, 2)) !== -1)
+ return "\u0660\u0661\u0662"
+ // Fallthrough
case InputEngine.Dialable:
return "123"
case InputEngine.Greek:
return "ΑΒΓ"
case InputEngine.Cyrillic:
return "АБВ"
+ case InputEngine.Arabic:
+ return "\u0623\u200C\u0628\u200C\u062C"
case InputEngine.ChineseHandwriting:
return "中文"
case InputEngine.JapaneseHandwriting:
diff --git a/src/virtualkeyboard/content/styles/retro/style.qml b/src/virtualkeyboard/content/styles/retro/style.qml
index bdf6a33f..888f4b50 100644
--- a/src/virtualkeyboard/content/styles/retro/style.qml
+++ b/src/virtualkeyboard/content/styles/retro/style.qml
@@ -874,12 +874,17 @@ KeyboardStyle {
text: {
switch (InputContext.inputEngine.inputMode) {
case InputEngine.Numeric:
+ if (["ar", "fa"].indexOf(InputContext.locale.substring(0, 2)) !== -1)
+ return "\u0660\u0661\u0662"
+ // Fallthrough
case InputEngine.Dialable:
return "123"
case InputEngine.Greek:
return "ΑΒΓ"
case InputEngine.Cyrillic:
return "АБВ"
+ case InputEngine.Arabic:
+ return "\u0623\u200C\u0628\u200C\u062C"
case InputEngine.ChineseHandwriting:
return "中文"
case InputEngine.JapaneseHandwriting:
diff --git a/src/virtualkeyboard/doc/src/build.qdoc b/src/virtualkeyboard/doc/src/build.qdoc
index 9b18a54d..a38af1a5 100644
--- a/src/virtualkeyboard/doc/src/build.qdoc
+++ b/src/virtualkeyboard/doc/src/build.qdoc
@@ -314,6 +314,8 @@ $ python unpack.py T9Write_Alpha_v7-8-0_SDK.zip .
│ ├─── t9write*.h
│ └─── xxt9w*.h
├─── data
+ │ ├─── arabic
+ │ │ └─── *.bin [T9 Write Arabic]
│ ├─── *.bin [T9 Write Alphabetic]
│ ├─── *.hdb
│ ├─── *.phd
diff --git a/src/virtualkeyboard/hunspellinputmethod.cpp b/src/virtualkeyboard/hunspellinputmethod.cpp
index 20c345bb..c77e3265 100644
--- a/src/virtualkeyboard/hunspellinputmethod.cpp
+++ b/src/virtualkeyboard/hunspellinputmethod.cpp
@@ -61,6 +61,9 @@ QList<InputEngine::InputMode> HunspellInputMethod::inputModes(const QString &loc
case QLocale::CyrillicScript:
result.append(InputEngine::Cyrillic);
break;
+ case QLocale::ArabicScript:
+ result.append(InputEngine::Arabic);
+ break;
default:
break;
}
diff --git a/src/virtualkeyboard/inputengine.cpp b/src/virtualkeyboard/inputengine.cpp
index 070834a4..8b1a1cbd 100644
--- a/src/virtualkeyboard/inputengine.cpp
+++ b/src/virtualkeyboard/inputengine.cpp
@@ -766,6 +766,7 @@ void InputEngine::timerEvent(QTimerEvent *timerEvent)
\li \c InputEngine.FullwidthLatin Fullwidth latin input mode for East Asian languages.
\li \c InputEngine.Greek Greek input mode.
\li \c InputEngine.Cyrillic Cyrillic input mode.
+ \li \c InputEngine.Arabic Arabic input mode.
\li \c InputEngine.ChineseHandwriting Chinese handwriting.
\li \c InputEngine.JapaneseHandwriting Japanese handwriting.
\li \c InputEngine.KoreanHandwriting Korean handwriting.
@@ -840,6 +841,8 @@ void InputEngine::timerEvent(QTimerEvent *timerEvent)
Greek input mode.
\value Cyrillic
Cyrillic input mode.
+ \value Arabic
+ Arabic input mode.
*/
/*!
diff --git a/src/virtualkeyboard/inputengine.h b/src/virtualkeyboard/inputengine.h
index 53251688..9f6ed0d0 100644
--- a/src/virtualkeyboard/inputengine.h
+++ b/src/virtualkeyboard/inputengine.h
@@ -76,6 +76,7 @@ public:
FullwidthLatin,
Greek,
Cyrillic,
+ Arabic,
ChineseHandwriting,
JapaneseHandwriting,
KoreanHandwriting
diff --git a/src/virtualkeyboard/plaininputmethod.cpp b/src/virtualkeyboard/plaininputmethod.cpp
index 8d77ac4e..3b1465d2 100644
--- a/src/virtualkeyboard/plaininputmethod.cpp
+++ b/src/virtualkeyboard/plaininputmethod.cpp
@@ -57,6 +57,9 @@ QList<InputEngine::InputMode> PlainInputMethod::inputModes(const QString &locale
case QLocale::CyrillicScript:
result.append(InputEngine::Cyrillic);
break;
+ case QLocale::ArabicScript:
+ result.append(InputEngine::Arabic);
+ break;
default:
break;
}
diff --git a/src/virtualkeyboard/t9writeinputmethod.cpp b/src/virtualkeyboard/t9writeinputmethod.cpp
index 3e52a84b..8479ae5a 100644
--- a/src/virtualkeyboard/t9writeinputmethod.cpp
+++ b/src/virtualkeyboard/t9writeinputmethod.cpp
@@ -109,6 +109,7 @@ public:
enum EngineMode {
EngineUninitialized,
Alphabetic,
+ Arabic,
SimplifiedChinese,
TraditionalChinese,
HongKongChinese,
@@ -190,6 +191,7 @@ public:
switch (newEngineMode) {
case Alphabetic:
+ case Arabic:
cjk = false;
break;
case SimplifiedChinese:
@@ -296,6 +298,9 @@ public:
case Alphabetic:
hwrDbPath.append(QLatin1String("_databas_le.bin"));
break;
+ case Arabic:
+ hwrDbPath.append(QLatin1String("arabic/_databas_le.bin"));
+ break;
case SimplifiedChinese:
hwrDbPath.append(QLatin1String("cjk_S_gb18030_le.hdb"));
break;
@@ -468,6 +473,8 @@ public:
#endif
#ifdef HAVE_T9WRITE_ALPHABETIC
+ if (locale.script() == QLocale::ArabicScript)
+ return T9WriteInputMethodPrivate::Arabic;
return T9WriteInputMethodPrivate::Alphabetic;
#else
return T9WriteInputMethodPrivate::EngineUninitialized;
@@ -632,6 +639,9 @@ public:
} else if (language == DECUMA_LANG_SRCY) {
if (inputMode != InputEngine::Cyrillic)
language = DECUMA_LANG_SRLA;
+ } else if (language == DECUMA_LANG_AR) {
+ if (inputMode != InputEngine::Arabic && inputMode != InputEngine::Numeric)
+ language = DECUMA_LANG_EN;
}
return language;
@@ -693,6 +703,12 @@ public:
break;
case InputEngine::Numeric:
+ if (language == DECUMA_LANG_AR) {
+ symbolCategories.append(DECUMA_CATEGORY_ARABIC_NUM_MODE);
+ symbolCategories.append(DECUMA_CATEGORY_ARABIC_GESTURES);
+ leftToRightGestures = false;
+ break;
+ }
symbolCategories.append(DECUMA_CATEGORY_DIGIT);
if (!inputMethodHints.testFlag(Qt::ImhDigitsOnly))
symbolCategories.append(DECUMA_CATEGORY_NUM_SUP);
@@ -720,6 +736,12 @@ public:
symbolCategories.append(DECUMA_CATEGORY_CONTRACTION_MARK);
break;
+ case InputEngine::Arabic:
+ symbolCategories.append(DECUMA_CATEGORY_ARABIC_ISOLATED_LETTER_MODE);
+ symbolCategories.append(DECUMA_CATEGORY_ARABIC_GESTURES);
+ leftToRightGestures = false;
+ break;
+
default:
qWarning() << "Handwriting is not supported in" << locale.name();
return false;
@@ -1557,6 +1579,12 @@ QList<InputEngine::InputMode> T9WriteInputMethod::inputModes(const QString &loca
availableInputModes.append(InputEngine::Latin);
}
break;
+ case T9WriteInputMethodPrivate::Arabic:
+ if (d->findHwrDb(T9WriteInputMethodPrivate::Arabic, d->defaultHwrDbPath).isEmpty())
+ return availableInputModes;
+ if (!(inputMethodHints & (Qt::ImhDialableCharactersOnly | Qt::ImhFormattedNumbersOnly | Qt::ImhDigitsOnly | Qt::ImhLatinOnly)))
+ availableInputModes.append(InputEngine::Arabic);
+ break;
#endif
#ifdef HAVE_T9WRITE_CJK
case T9WriteInputMethodPrivate::SimplifiedChinese:
diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro
index 76599f51..83d0b408 100644
--- a/src/virtualkeyboard/virtualkeyboard.pro
+++ b/src/virtualkeyboard/virtualkeyboard.pro
@@ -84,6 +84,8 @@ contains(CONFIG, lang-ar.*) {
content/layouts/ar_AR/main.qml \
content/layouts/ar_AR/numbers.qml \
content/layouts/ar_AR/symbols.qml
+t9write-alphabetic: LAYOUT_FILES += \
+ content/layouts/ar_AR/handwriting.qml
}
contains(CONFIG, lang-bg.*) {
LAYOUT_FILES += \
diff --git a/tests/auto/inputpanel/data/inputpanel/handwriting.js b/tests/auto/inputpanel/data/inputpanel/handwriting.js
index 21b737da..bfed8305 100644
--- a/tests/auto/inputpanel/data/inputpanel/handwriting.js
+++ b/tests/auto/inputpanel/data/inputpanel/handwriting.js
@@ -36,6 +36,7 @@
.import "unipen_data_korean.js" as UnipenDataKorean
.import "unipen_data_greek.js" as UnipenDataGreek
.import "unipen_data_cyrillic.js" as UnipenDataCyrillic
+.import "unipen_data_arabic.js" as UnipenDataArabic
function emulate(testcase, hwrInputArea, ch, instant) {
var chKey = (((typeof ch == "number") ? ch : ch.charCodeAt(0)) + 0x100000000).toString(16).substr(1)
@@ -57,6 +58,8 @@ function emulate(testcase, hwrInputArea, ch, instant) {
unipenData = UnipenDataGreek
else if (UnipenDataCyrillic.unipenData.hasOwnProperty(chKey))
unipenData = UnipenDataCyrillic
+ else if (UnipenDataArabic.unipenData.hasOwnProperty(chKey))
+ unipenData = UnipenDataArabic
else
return false
var chData = unipenData.unipenData[chKey]
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
index 43dabd68..e6c39011 100644
--- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
+++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
@@ -267,6 +267,8 @@ InputPanel {
return InputEngine.Greek
else if (inputModeName === "Cyrillic")
return InputEngine.Cyrillic
+ else if (inputModeName === "Arabic")
+ return InputEngine.Arabic
else if (inputModeName === "ChineseHandwriting")
return InputEngine.ChineseHandwriting
else if (inputModeName === "JapaneseHandwriting")
diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data_arabic.js b/tests/auto/inputpanel/data/inputpanel/unipen_data_arabic.js
new file mode 100644
index 00000000..a25d16c3
--- /dev/null
+++ b/tests/auto/inputpanel/data/inputpanel/unipen_data_arabic.js
@@ -0,0 +1,1170 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var unipenData = {
+ "0x0627": {
+ ".COORD": [
+ "X",
+ "Y",
+ "T"
+ ],
+ ".HIERARCHY": "CHARACTER",
+ ".PEN": [
+ [
+ [
+ 354,
+ 61,
+ 0
+ ],
+ [
+ 354,
+ 64,
+ 76
+ ],
+ [
+ 354,
+ 69,
+ 92
+ ],
+ [
+ 354,
+ 83,
+ 133
+ ],
+ [
+ 348,
+ 104,
+ 196
+ ],
+ [
+ 345,
+ 127,
+ 198
+ ],
+ [
+ 345,
+ 137,
+ 255
+ ],
+ [
+ 347,
+ 157,
+ 256
+ ],
+ [
+ 347,
+ 159,
+ 260
+ ],
+ [
+ 347,
+ 164,
+ 315
+ ],
+ [
+ 346,
+ 170,
+ 316
+ ],
+ [
+ 345,
+ 174,
+ 376
+ ],
+ [
+ 345,
+ 177,
+ 377
+ ],
+ [
+ 344,
+ 179,
+ 379
+ ],
+ [
+ 344,
+ 181,
+ 437
+ ],
+ [
+ 344,
+ 182,
+ 438
+ ],
+ [
+ 344,
+ 183,
+ 499
+ ]
+ ]
+ ],
+ ".POINTS_PER_SECOND": 60,
+ ".SEGMENT": "CHARACTER",
+ ".VERSION": "1.0",
+ ".X_DIM": 1032,
+ ".X_POINTS_PER_INCH": 94,
+ ".Y_DIM": 263,
+ ".Y_POINTS_PER_INCH": 94
+ },
+ "0x0628": {
+ ".COORD": [
+ "X",
+ "Y",
+ "T"
+ ],
+ ".HIERARCHY": "CHARACTER",
+ ".PEN": [
+ [
+ [
+ 264,
+ 132,
+ 0
+ ],
+ [
+ 264,
+ 133,
+ 68
+ ],
+ [
+ 263,
+ 139,
+ 69
+ ],
+ [
+ 262,
+ 146,
+ 127
+ ],
+ [
+ 262,
+ 149,
+ 128
+ ],
+ [
+ 259,
+ 160,
+ 132
+ ],
+ [
+ 259,
+ 163,
+ 188
+ ],
+ [
+ 255,
+ 180,
+ 190
+ ],
+ [
+ 252,
+ 184,
+ 251
+ ],
+ [
+ 251,
+ 185,
+ 254
+ ],
+ [
+ 246,
+ 186,
+ 310
+ ],
+ [
+ 241,
+ 186,
+ 374
+ ],
+ [
+ 236,
+ 186,
+ 376
+ ],
+ [
+ 234,
+ 186,
+ 380
+ ],
+ [
+ 232,
+ 186,
+ 433
+ ],
+ [
+ 218,
+ 184,
+ 434
+ ],
+ [
+ 214,
+ 184,
+ 436
+ ],
+ [
+ 204,
+ 183,
+ 493
+ ],
+ [
+ 195,
+ 181,
+ 494
+ ],
+ [
+ 187,
+ 180,
+ 556
+ ],
+ [
+ 181,
+ 179,
+ 558
+ ],
+ [
+ 175,
+ 178,
+ 617
+ ],
+ [
+ 169,
+ 178,
+ 618
+ ],
+ [
+ 162,
+ 177,
+ 676
+ ],
+ [
+ 159,
+ 177,
+ 677
+ ],
+ [
+ 154,
+ 177,
+ 737
+ ],
+ [
+ 146,
+ 176,
+ 738
+ ],
+ [
+ 145,
+ 176,
+ 797
+ ],
+ [
+ 143,
+ 174,
+ 859
+ ],
+ [
+ 140,
+ 170,
+ 861
+ ],
+ [
+ 140,
+ 168,
+ 918
+ ],
+ [
+ 140,
+ 165,
+ 919
+ ],
+ [
+ 140,
+ 160,
+ 978
+ ],
+ [
+ 140,
+ 151,
+ 979
+ ],
+ [
+ 140,
+ 139,
+ 1041
+ ],
+ [
+ 142,
+ 132,
+ 1043
+ ],
+ [
+ 143,
+ 131,
+ 1102
+ ],
+ [
+ 143,
+ 127,
+ 1103
+ ],
+ [
+ 143,
+ 126,
+ 1228
+ ]
+ ],
+ [
+ [
+ 193,
+ 204,
+ 1784
+ ],
+ [
+ 193,
+ 206,
+ 1836
+ ],
+ [
+ 193,
+ 208,
+ 1863
+ ],
+ [
+ 193,
+ 210,
+ 1867
+ ],
+ [
+ 193,
+ 211,
+ 1923
+ ],
+ [
+ 193,
+ 212,
+ 1924
+ ],
+ [
+ 193,
+ 213,
+ 1984
+ ]
+ ]
+ ],
+ ".POINTS_PER_SECOND": 60,
+ ".SEGMENT": "CHARACTER",
+ ".VERSION": "1.0",
+ ".X_DIM": 1032,
+ ".X_POINTS_PER_INCH": 94,
+ ".Y_DIM": 263,
+ ".Y_POINTS_PER_INCH": 94
+ },
+ "0x062a": {
+ ".COORD": [
+ "X",
+ "Y",
+ "T"
+ ],
+ ".HIERARCHY": "CHARACTER",
+ ".PEN": [
+ [
+ [
+ 497,
+ 124,
+ 0
+ ],
+ [
+ 497,
+ 125,
+ 76
+ ],
+ [
+ 497,
+ 129,
+ 99
+ ],
+ [
+ 496,
+ 132,
+ 135
+ ],
+ [
+ 496,
+ 135,
+ 136
+ ],
+ [
+ 495,
+ 140,
+ 198
+ ],
+ [
+ 493,
+ 148,
+ 199
+ ],
+ [
+ 491,
+ 158,
+ 259
+ ],
+ [
+ 491,
+ 160,
+ 259
+ ],
+ [
+ 491,
+ 165,
+ 260
+ ],
+ [
+ 490,
+ 167,
+ 319
+ ],
+ [
+ 487,
+ 176,
+ 320
+ ],
+ [
+ 487,
+ 178,
+ 382
+ ],
+ [
+ 485,
+ 183,
+ 383
+ ],
+ [
+ 483,
+ 185,
+ 443
+ ],
+ [
+ 479,
+ 188,
+ 445
+ ],
+ [
+ 476,
+ 190,
+ 501
+ ],
+ [
+ 471,
+ 192,
+ 503
+ ],
+ [
+ 468,
+ 192,
+ 532
+ ],
+ [
+ 465,
+ 193,
+ 562
+ ],
+ [
+ 456,
+ 194,
+ 563
+ ],
+ [
+ 452,
+ 195,
+ 564
+ ],
+ [
+ 448,
+ 195,
+ 624
+ ],
+ [
+ 436,
+ 195,
+ 624
+ ],
+ [
+ 432,
+ 195,
+ 627
+ ],
+ [
+ 420,
+ 194,
+ 687
+ ],
+ [
+ 410,
+ 192,
+ 688
+ ],
+ [
+ 403,
+ 190,
+ 691
+ ],
+ [
+ 396,
+ 189,
+ 746
+ ],
+ [
+ 381,
+ 188,
+ 747
+ ],
+ [
+ 370,
+ 186,
+ 806
+ ],
+ [
+ 354,
+ 183,
+ 807
+ ],
+ [
+ 340,
+ 182,
+ 867
+ ],
+ [
+ 334,
+ 182,
+ 868
+ ],
+ [
+ 332,
+ 181,
+ 928
+ ],
+ [
+ 330,
+ 181,
+ 929
+ ],
+ [
+ 330,
+ 179,
+ 989
+ ],
+ [
+ 330,
+ 176,
+ 1050
+ ],
+ [
+ 332,
+ 174,
+ 1051
+ ],
+ [
+ 333,
+ 171,
+ 1051
+ ],
+ [
+ 335,
+ 168,
+ 1113
+ ],
+ [
+ 337,
+ 164,
+ 1114
+ ],
+ [
+ 339,
+ 162,
+ 1117
+ ],
+ [
+ 340,
+ 160,
+ 1174
+ ],
+ [
+ 341,
+ 156,
+ 1174
+ ],
+ [
+ 343,
+ 152,
+ 1232
+ ],
+ [
+ 345,
+ 143,
+ 1233
+ ],
+ [
+ 345,
+ 142,
+ 1292
+ ],
+ [
+ 345,
+ 141,
+ 1353
+ ]
+ ],
+ [
+ [
+ 398,
+ 104,
+ 1752
+ ],
+ [
+ 399,
+ 105,
+ 1809
+ ],
+ [
+ 403,
+ 116,
+ 1810
+ ],
+ [
+ 404,
+ 124,
+ 1871
+ ],
+ [
+ 404,
+ 128,
+ 1871
+ ],
+ [
+ 406,
+ 130,
+ 1933
+ ]
+ ],
+ [
+ [
+ 436,
+ 109,
+ 2182
+ ],
+ [
+ 436,
+ 113,
+ 2209
+ ],
+ [
+ 436,
+ 114,
+ 2211
+ ],
+ [
+ 435,
+ 122,
+ 2212
+ ],
+ [
+ 434,
+ 124,
+ 2270
+ ],
+ [
+ 433,
+ 130,
+ 2272
+ ],
+ [
+ 433,
+ 134,
+ 2328
+ ]
+ ]
+ ],
+ ".POINTS_PER_SECOND": 60,
+ ".SEGMENT": "CHARACTER",
+ ".VERSION": "1.0",
+ ".X_DIM": 1032,
+ ".X_POINTS_PER_INCH": 94,
+ ".Y_DIM": 263,
+ ".Y_POINTS_PER_INCH": 94
+ },
+ "0x0643": {
+ ".COORD": [
+ "X",
+ "Y",
+ "T"
+ ],
+ ".HIERARCHY": "CHARACTER",
+ ".PEN": [
+ [
+ [
+ 634,
+ 60,
+ 0
+ ],
+ [
+ 634,
+ 61,
+ 47
+ ],
+ [
+ 634,
+ 63,
+ 50
+ ],
+ [
+ 635,
+ 69,
+ 110
+ ],
+ [
+ 636,
+ 79,
+ 111
+ ],
+ [
+ 636,
+ 85,
+ 140
+ ],
+ [
+ 636,
+ 90,
+ 169
+ ],
+ [
+ 636,
+ 103,
+ 170
+ ],
+ [
+ 637,
+ 118,
+ 230
+ ],
+ [
+ 637,
+ 135,
+ 231
+ ],
+ [
+ 637,
+ 138,
+ 260
+ ],
+ [
+ 637,
+ 148,
+ 290
+ ],
+ [
+ 637,
+ 153,
+ 291
+ ],
+ [
+ 637,
+ 157,
+ 353
+ ],
+ [
+ 637,
+ 161,
+ 354
+ ],
+ [
+ 637,
+ 162,
+ 356
+ ],
+ [
+ 637,
+ 163,
+ 412
+ ],
+ [
+ 637,
+ 168,
+ 413
+ ],
+ [
+ 636,
+ 169,
+ 473
+ ],
+ [
+ 634,
+ 174,
+ 474
+ ],
+ [
+ 633,
+ 175,
+ 477
+ ],
+ [
+ 633,
+ 176,
+ 533
+ ],
+ [
+ 632,
+ 177,
+ 535
+ ],
+ [
+ 627,
+ 178,
+ 594
+ ],
+ [
+ 625,
+ 180,
+ 595
+ ],
+ [
+ 620,
+ 181,
+ 656
+ ],
+ [
+ 613,
+ 182,
+ 657
+ ],
+ [
+ 601,
+ 183,
+ 717
+ ],
+ [
+ 590,
+ 184,
+ 718
+ ],
+ [
+ 582,
+ 185,
+ 778
+ ],
+ [
+ 580,
+ 186,
+ 779
+ ],
+ [
+ 578,
+ 186,
+ 780
+ ],
+ [
+ 573,
+ 186,
+ 839
+ ],
+ [
+ 565,
+ 186,
+ 840
+ ],
+ [
+ 563,
+ 186,
+ 843
+ ],
+ [
+ 559,
+ 186,
+ 902
+ ],
+ [
+ 556,
+ 186,
+ 909
+ ],
+ [
+ 550,
+ 185,
+ 961
+ ],
+ [
+ 546,
+ 184,
+ 1022
+ ],
+ [
+ 544,
+ 184,
+ 1083
+ ],
+ [
+ 542,
+ 183,
+ 1084
+ ],
+ [
+ 539,
+ 183,
+ 1144
+ ],
+ [
+ 538,
+ 182,
+ 1145
+ ],
+ [
+ 535,
+ 180,
+ 1207
+ ],
+ [
+ 534,
+ 179,
+ 1209
+ ],
+ [
+ 534,
+ 178,
+ 1212
+ ],
+ [
+ 533,
+ 176,
+ 1267
+ ],
+ [
+ 532,
+ 176,
+ 1268
+ ],
+ [
+ 531,
+ 174,
+ 1269
+ ],
+ [
+ 531,
+ 172,
+ 1328
+ ],
+ [
+ 530,
+ 168,
+ 1329
+ ],
+ [
+ 528,
+ 162,
+ 1390
+ ],
+ [
+ 527,
+ 158,
+ 1392
+ ],
+ [
+ 527,
+ 157,
+ 1451
+ ],
+ [
+ 526,
+ 154,
+ 1453
+ ],
+ [
+ 526,
+ 153,
+ 1510
+ ],
+ [
+ 526,
+ 152,
+ 1571
+ ]
+ ],
+ [
+ [
+ 597,
+ 77,
+ 2271
+ ],
+ [
+ 595,
+ 77,
+ 2329
+ ],
+ [
+ 591,
+ 79,
+ 2361
+ ],
+ [
+ 587,
+ 81,
+ 2363
+ ],
+ [
+ 583,
+ 83,
+ 2419
+ ],
+ [
+ 581,
+ 84,
+ 2420
+ ],
+ [
+ 578,
+ 87,
+ 2420
+ ],
+ [
+ 576,
+ 88,
+ 2480
+ ],
+ [
+ 572,
+ 96,
+ 2480
+ ],
+ [
+ 571,
+ 102,
+ 2542
+ ],
+ [
+ 571,
+ 107,
+ 2542
+ ],
+ [
+ 573,
+ 111,
+ 2602
+ ],
+ [
+ 578,
+ 117,
+ 2603
+ ],
+ [
+ 581,
+ 118,
+ 2663
+ ],
+ [
+ 583,
+ 118,
+ 2668
+ ],
+ [
+ 586,
+ 118,
+ 2724
+ ],
+ [
+ 593,
+ 118,
+ 2725
+ ],
+ [
+ 601,
+ 115,
+ 2784
+ ],
+ [
+ 603,
+ 113,
+ 2785
+ ],
+ [
+ 603,
+ 112,
+ 2788
+ ],
+ [
+ 603,
+ 111,
+ 2956
+ ],
+ [
+ 600,
+ 115,
+ 2997
+ ],
+ [
+ 597,
+ 119,
+ 3057
+ ],
+ [
+ 594,
+ 122,
+ 3058
+ ],
+ [
+ 588,
+ 128,
+ 3117
+ ],
+ [
+ 585,
+ 131,
+ 3118
+ ],
+ [
+ 582,
+ 134,
+ 3181
+ ],
+ [
+ 581,
+ 134,
+ 3183
+ ],
+ [
+ 580,
+ 135,
+ 3244
+ ]
+ ]
+ ],
+ ".POINTS_PER_SECOND": 60,
+ ".SEGMENT": "CHARACTER",
+ ".VERSION": "1.0",
+ ".X_DIM": 1032,
+ ".X_POINTS_PER_INCH": 94,
+ ".Y_DIM": 263,
+ ".Y_POINTS_PER_INCH": 94
+ }
+}
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 81b9b1ce..77a7fb07 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -1121,6 +1121,7 @@ Rectangle {
{ initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "el_GR", initInputMode: "Greek", inputSequence: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", outputText: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC" },
{ initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "bg_BG", initInputMode: "Cyrillic", inputSequence: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", outputText: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438" },
{ initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "cs_CZ", initInputMode: "Latin", inputSequence: "ahoj", outputText: "Ahoj" },
+ { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ar_AR", initInputMode: "Arabic", inputSequence: "\u0643\u062A\u0627\u0628", outputText: "\u0643\u062A\u0627\u0628" },
]
}
diff --git a/tests/auto/inputpanel/hwr_test_data/arabic/1575_100_0.txt b/tests/auto/inputpanel/hwr_test_data/arabic/1575_100_0.txt
new file mode 100644
index 00000000..909439f2
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/arabic/1575_100_0.txt
@@ -0,0 +1,28 @@
+.VERSION 1.0
+.HIERARCHY CHARACTER
+.COORD X Y T
+.SEGMENT CHARACTER
+.X_DIM 1032
+.Y_DIM 263
+.X_POINTS_PER_INCH 94
+.Y_POINTS_PER_INCH 94
+.POINTS_PER_SECOND 60
+.PEN_DOWN
+354 61 0
+354 64 76
+354 69 92
+354 83 133
+348 104 196
+345 127 198
+345 137 255
+347 157 256
+347 159 260
+347 164 315
+346 170 316
+345 174 376
+345 177 377
+344 179 379
+344 181 437
+344 182 438
+344 183 499
+.PEN_UP
diff --git a/tests/auto/inputpanel/hwr_test_data/arabic/1576_100_0.txt b/tests/auto/inputpanel/hwr_test_data/arabic/1576_100_0.txt
new file mode 100644
index 00000000..6b14f1a0
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/arabic/1576_100_0.txt
@@ -0,0 +1,59 @@
+.VERSION 1.0
+.HIERARCHY CHARACTER
+.COORD X Y T
+.SEGMENT CHARACTER
+.X_DIM 1032
+.Y_DIM 263
+.X_POINTS_PER_INCH 94
+.Y_POINTS_PER_INCH 94
+.POINTS_PER_SECOND 60
+.PEN_DOWN
+264 132 0
+264 133 68
+263 139 69
+262 146 127
+262 149 128
+259 160 132
+259 163 188
+255 180 190
+252 184 251
+251 185 254
+246 186 310
+241 186 374
+236 186 376
+234 186 380
+232 186 433
+218 184 434
+214 184 436
+204 183 493
+195 181 494
+187 180 556
+181 179 558
+175 178 617
+169 178 618
+162 177 676
+159 177 677
+154 177 737
+146 176 738
+145 176 797
+143 174 859
+140 170 861
+140 168 918
+140 165 919
+140 160 978
+140 151 979
+140 139 1041
+142 132 1043
+143 131 1102
+143 127 1103
+143 126 1228
+.PEN_UP
+.PEN_DOWN
+193 204 1784
+193 206 1836
+193 208 1863
+193 210 1867
+193 211 1923
+193 212 1924
+193 213 1984
+.PEN_UP
diff --git a/tests/auto/inputpanel/hwr_test_data/arabic/1578_100_0.txt b/tests/auto/inputpanel/hwr_test_data/arabic/1578_100_0.txt
new file mode 100644
index 00000000..f3fa71a3
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/arabic/1578_100_0.txt
@@ -0,0 +1,77 @@
+.VERSION 1.0
+.HIERARCHY CHARACTER
+.COORD X Y T
+.SEGMENT CHARACTER
+.X_DIM 1032
+.Y_DIM 263
+.X_POINTS_PER_INCH 94
+.Y_POINTS_PER_INCH 94
+.POINTS_PER_SECOND 60
+.PEN_DOWN
+497 124 0
+497 125 76
+497 129 99
+496 132 135
+496 135 136
+495 140 198
+493 148 199
+491 158 259
+491 160 259
+491 165 260
+490 167 319
+487 176 320
+487 178 382
+485 183 383
+483 185 443
+479 188 445
+476 190 501
+471 192 503
+468 192 532
+465 193 562
+456 194 563
+452 195 564
+448 195 624
+436 195 624
+432 195 627
+420 194 687
+410 192 688
+403 190 691
+396 189 746
+381 188 747
+370 186 806
+354 183 807
+340 182 867
+334 182 868
+332 181 928
+330 181 929
+330 179 989
+330 176 1050
+332 174 1051
+333 171 1051
+335 168 1113
+337 164 1114
+339 162 1117
+340 160 1174
+341 156 1174
+343 152 1232
+345 143 1233
+345 142 1292
+345 141 1353
+.PEN_UP
+.PEN_DOWN
+398 104 1752
+399 105 1809
+403 116 1810
+404 124 1871
+404 128 1871
+406 130 1933
+.PEN_UP
+.PEN_DOWN
+436 109 2182
+436 113 2209
+436 114 2211
+435 122 2212
+434 124 2270
+433 130 2272
+433 134 2328
+.PEN_UP
diff --git a/tests/auto/inputpanel/hwr_test_data/arabic/1603_100_0.txt b/tests/auto/inputpanel/hwr_test_data/arabic/1603_100_0.txt
new file mode 100644
index 00000000..8f950deb
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/arabic/1603_100_0.txt
@@ -0,0 +1,99 @@
+.VERSION 1.0
+.HIERARCHY CHARACTER
+.COORD X Y T
+.SEGMENT CHARACTER
+.X_DIM 1032
+.Y_DIM 263
+.X_POINTS_PER_INCH 94
+.Y_POINTS_PER_INCH 94
+.POINTS_PER_SECOND 60
+.PEN_DOWN
+634 60 0
+634 61 47
+634 63 50
+635 69 110
+636 79 111
+636 85 140
+636 90 169
+636 103 170
+637 118 230
+637 135 231
+637 138 260
+637 148 290
+637 153 291
+637 157 353
+637 161 354
+637 162 356
+637 163 412
+637 168 413
+636 169 473
+634 174 474
+633 175 477
+633 176 533
+632 177 535
+627 178 594
+625 180 595
+620 181 656
+613 182 657
+601 183 717
+590 184 718
+582 185 778
+580 186 779
+578 186 780
+573 186 839
+565 186 840
+563 186 843
+559 186 902
+556 186 909
+550 185 961
+546 184 1022
+544 184 1083
+542 183 1084
+539 183 1144
+538 182 1145
+535 180 1207
+534 179 1209
+534 178 1212
+533 176 1267
+532 176 1268
+531 174 1269
+531 172 1328
+530 168 1329
+528 162 1390
+527 158 1392
+527 157 1451
+526 154 1453
+526 153 1510
+526 152 1571
+.PEN_UP
+.PEN_DOWN
+597 77 2271
+595 77 2329
+591 79 2361
+587 81 2363
+583 83 2419
+581 84 2420
+578 87 2420
+576 88 2480
+572 96 2480
+571 102 2542
+571 107 2542
+573 111 2602
+578 117 2603
+581 118 2663
+583 118 2668
+586 118 2724
+593 118 2725
+601 115 2784
+603 113 2785
+603 112 2788
+603 111 2956
+600 115 2997
+597 119 3057
+594 122 3058
+588 128 3117
+585 131 3118
+582 134 3181
+581 134 3183
+580 135 3244
+.PEN_UP