diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-06-04 23:38:09 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-07-08 19:28:39 +0000 |
commit | f989e76c5072f4d5c80ca05e0e52452570368d95 (patch) | |
tree | b6ff8807f30d08ea7b857ba33bf683ec675282c4 | |
parent | a82fd907ad378a412efdb39aff39f5b6d41996f4 (diff) |
Add support for Korean handwriting (T9 Write CJK)
This change adds handwriting support for Korean.
Change-Id: I77eb322020c39259d9609051100c40b271a62c04
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
17 files changed, 2247 insertions, 7 deletions
diff --git a/src/virtualkeyboard/content/components/InputModeKey.qml b/src/virtualkeyboard/content/components/InputModeKey.qml index d880867f..141413e8 100644 --- a/src/virtualkeyboard/content/components/InputModeKey.qml +++ b/src/virtualkeyboard/content/components/InputModeKey.qml @@ -69,6 +69,7 @@ Key { "カ", // InputEngine.Katakana "全角", // InputEngine.FullwidthLatin "中文", // InputEngine.ChineseHandwriting + "한국어", // InputEngine.KoreanHandwriting ] function __nextInputMode(inputMode) { diff --git a/src/virtualkeyboard/content/layouts/ko_KR/handwriting.qml b/src/virtualkeyboard/content/layouts/ko_KR/handwriting.qml new file mode 100644 index 00000000..58fb566b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ko_KR/handwriting.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +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: preferredInputMode() + + Connections { + target: InputContext + onInputMethodHintsChanged: { + var newInputMode = preferredInputMode() + if (InputContext.inputEngine.inputModes.indexOf(newInputMode) !== -1) + InputContext.inputEngine.inputMode = newInputMode + } + } + + function preferredInputMode() { + return InputContext.inputMethodHints & + (Qt.ImhPreferLatin | Qt.ImhEmailCharactersOnly | Qt.ImhUrlCharactersOnly | + Qt.ImhLatinOnly) ? InputEngine.Latin : InputEngine.KoreanHandwriting + } + + KeyboardRow { + Layout.preferredHeight: 3 + KeyboardColumn { + Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width + KeyboardRow { + TraceInputKey { + objectName: "hwrInputArea" + patternRecognitionMode: InputEngine.HandwritingRecoginition + horizontalRulers: + InputContext.inputEngine.inputMode !== InputEngine.KoreanHandwriting ? [] : + [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 { + enabled: InputContext.inputEngine.inputMode !== InputEngine.KoreanHandwriting + } + } + } + } + KeyboardRow { + id: bottomRow + Layout.preferredHeight: 1 + keyWeight: 154 + InputModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + customLayoutsOnly: true + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Apostrophe + text: "'" + alternativeKeys: "<>()#%&*/\\\"'=+-_" + } + Key { + key: Qt.Key_Period + text: "." + alternativeKeys: ":;,.?!" + } + HideKeyboardKey { + id: hideKeyboardKey + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/ko_KR/main.qml b/src/virtualkeyboard/content/layouts/ko_KR/main.qml index 8c9e6fcb..525a0392 100644 --- a/src/virtualkeyboard/content/layouts/ko_KR/main.qml +++ b/src/virtualkeyboard/content/layouts/ko_KR/main.qml @@ -152,6 +152,9 @@ KeyboardLayoutLoader { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } @@ -286,6 +289,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 9d00bb11..e759616e 100644 --- a/src/virtualkeyboard/content/styles/default/style.qml +++ b/src/virtualkeyboard/content/styles/default/style.qml @@ -764,6 +764,8 @@ KeyboardStyle { return "123" case InputEngine.ChineseHandwriting: return "中文" + case InputEngine.KoreanHandwriting: + return "한국어" default: return "Abc" } diff --git a/src/virtualkeyboard/content/styles/retro/style.qml b/src/virtualkeyboard/content/styles/retro/style.qml index 3751608b..68905852 100644 --- a/src/virtualkeyboard/content/styles/retro/style.qml +++ b/src/virtualkeyboard/content/styles/retro/style.qml @@ -878,6 +878,8 @@ KeyboardStyle { return "123" case InputEngine.ChineseHandwriting: return "中文" + case InputEngine.KoreanHandwriting: + return "한국어" default: return "Abc" } diff --git a/src/virtualkeyboard/inputengine.cpp b/src/virtualkeyboard/inputengine.cpp index dd04f645..811b04ca 100644 --- a/src/virtualkeyboard/inputengine.cpp +++ b/src/virtualkeyboard/inputengine.cpp @@ -765,6 +765,7 @@ void InputEngine::timerEvent(QTimerEvent *timerEvent) \li \c InputEngine.Katakana Katakana input mode for Japanese. \li \c InputEngine.FullwidthLatin Fullwidth latin input mode for East Asian languages. \li \c InputEngine.ChineseHandwriting Chinese handwriting. + \li \c InputEngine.KoreanHandwriting Korean handwriting. \endlist */ diff --git a/src/virtualkeyboard/inputengine.h b/src/virtualkeyboard/inputengine.h index d1b99ae4..e8622f63 100644 --- a/src/virtualkeyboard/inputengine.h +++ b/src/virtualkeyboard/inputengine.h @@ -74,7 +74,8 @@ public: Hiragana, Katakana, FullwidthLatin, - ChineseHandwriting + ChineseHandwriting, + KoreanHandwriting }; enum PatternRecognitionMode { PatternRecognitionDisabled, diff --git a/src/virtualkeyboard/shifthandler.cpp b/src/virtualkeyboard/shifthandler.cpp index a5f80d05..47328d60 100644 --- a/src/virtualkeyboard/shifthandler.cpp +++ b/src/virtualkeyboard/shifthandler.cpp @@ -51,7 +51,7 @@ public: resetWhenVisible(false), manualShiftLanguageFilter(QSet<QLocale::Language>() << QLocale::Arabic << QLocale::Persian << QLocale::Hindi << QLocale::Korean), manualCapsInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::Cangjie << InputEngine::Zhuyin), - noAutoUppercaseInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::FullwidthLatin << InputEngine::Pinyin << InputEngine::Cangjie << InputEngine::Zhuyin << InputEngine::ChineseHandwriting), + noAutoUppercaseInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::FullwidthLatin << InputEngine::Pinyin << InputEngine::Cangjie << InputEngine::Zhuyin << InputEngine::ChineseHandwriting << InputEngine::KoreanHandwriting), allCapsInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::Hiragana << InputEngine::Katakana) { timer.start(); diff --git a/src/virtualkeyboard/t9writeinputmethod.cpp b/src/virtualkeyboard/t9writeinputmethod.cpp index ee69d49d..c9e5829b 100644 --- a/src/virtualkeyboard/t9writeinputmethod.cpp +++ b/src/virtualkeyboard/t9writeinputmethod.cpp @@ -455,6 +455,8 @@ public: return SimplifiedChinese; break; } + case QLocale::Korean: + return Korean; default: break; } @@ -618,6 +620,9 @@ public: language = DECUMA_LANG_EN; else if (locale.script() == QLocale::TraditionalChineseScript) language = (locale.country() == QLocale::HongKong) ? DECUMA_LANG_HK : DECUMA_LANG_TW; + } else if (language == DECUMA_LANG_KO) { + if (inputMode != InputEngine::KoreanHandwriting) + language = DECUMA_LANG_EN; } return language; @@ -637,7 +642,7 @@ public: sessionSettings.recognitionMode = mcrMode; // Use scrMode with hidden text or with no predictive mode - if (inputMode != InputEngine::ChineseHandwriting) { + if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) { const Qt::InputMethodHints inputMethodHints = q->inputContext()->inputMethodHints(); if (inputMethodHints.testFlag(Qt::ImhHiddenText) || inputMethodHints.testFlag(Qt::ImhNoPredictiveText)) sessionSettings.recognitionMode = scrMode; @@ -777,6 +782,14 @@ public: } break; + case InputEngine::KoreanHandwriting: + symbolCategories.append(DECUMA_CATEGORY_HANGUL_1001_A); + symbolCategories.append(DECUMA_CATEGORY_HANGUL_1001_B); + symbolCategories.append(DECUMA_CATEGORY_CJK_SYMBOL); + symbolCategories.append(DECUMA_CATEGORY_CJK_GENERAL_PUNCTUATIONS); + symbolCategories.append(DECUMA_CATEGORY_PUNCTUATIONS); + break; + default: return false; } @@ -1250,7 +1263,7 @@ public: // Delete trace history const InputEngine::InputMode inputMode = q->inputEngine()->inputMode(); if (sessionSettings.recognitionMode == mcrMode && !symbolStrokes.isEmpty() && - inputMode != InputEngine::ChineseHandwriting) { + inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) { int activeTraces = symbolStrokes.at(symbolStrokes.count() - 1).toInt(); if (symbolStrokes.count() > 1) activeTraces += symbolStrokes.at(symbolStrokes.count() - 2).toInt(); @@ -1349,7 +1362,7 @@ public: // Swipe right const InputEngine::InputMode inputMode = q->inputEngine()->inputMode(); - if (inputMode != InputEngine::ChineseHandwriting) { + if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) { if (swipeAngle <= SWIPE_ANGLE_THRESHOLD || swipeAngle >= 360 - SWIPE_ANGLE_THRESHOLD) { if (swipeTouchCount == 1) { // Single swipe: space @@ -1505,6 +1518,12 @@ QList<InputEngine::InputMode> T9WriteInputMethod::inputModes(const QString &loca if (!(inputMethodHints & (Qt::ImhDialableCharactersOnly | Qt::ImhFormattedNumbersOnly | Qt::ImhDigitsOnly | Qt::ImhLatinOnly))) availableInputModes.append(InputEngine::ChineseHandwriting); break; + case T9WriteInputMethodPrivate::Korean: + if (d->findHwrDb(T9WriteInputMethodPrivate::Korean, d->defaultHwrDbPath).isEmpty()) + return availableInputModes; + if (!(inputMethodHints & (Qt::ImhDialableCharactersOnly | Qt::ImhFormattedNumbersOnly | Qt::ImhDigitsOnly | Qt::ImhLatinOnly))) + availableInputModes.append(InputEngine::KoreanHandwriting); + break; #endif default: return availableInputModes; @@ -1708,7 +1727,8 @@ bool T9WriteInputMethod::reselect(int cursorPosition, const InputEngine::Reselec return false; const InputEngine::InputMode inputMode = inputEngine()->inputMode(); - const int maxLength = inputMode == InputEngine::ChineseHandwriting ? 0 : 32; + const int maxLength = (inputMode == InputEngine::ChineseHandwriting || + inputMode == InputEngine::KoreanHandwriting) ? 0 : 32; const QString surroundingText = ic->surroundingText(); int replaceFrom = 0; @@ -1787,7 +1807,7 @@ void T9WriteInputMethod::timerEvent(QTimerEvent *timerEvent) d->stopResultTimer(); #ifndef QT_VIRTUALKEYBOARD_RECORD_TRACE_INPUT const InputEngine::InputMode inputMode = inputEngine()->inputMode(); - if (inputMode != InputEngine::ChineseHandwriting) + if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) d->clearTraces(); #endif } else if (d->sessionSettings.recognitionMode == scrMode) { diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro index cfbd55c7..1399d20e 100644 --- a/src/virtualkeyboard/virtualkeyboard.pro +++ b/src/virtualkeyboard/virtualkeyboard.pro @@ -148,6 +148,8 @@ contains(CONFIG, lang-ko.*) { LAYOUT_FILES += \ content/layouts/ko_KR/main.qml \ content/layouts/ko_KR/symbols.qml +t9write-cjk: LAYOUT_FILES += \ + content/layouts/ko_KR/handwriting.qml } contains(CONFIG, lang-nb.*) { LAYOUT_FILES += \ diff --git a/tests/auto/inputpanel/data/inputpanel/handwriting.js b/tests/auto/inputpanel/data/inputpanel/handwriting.js index ac9e7a6f..36f76e84 100644 --- a/tests/auto/inputpanel/data/inputpanel/handwriting.js +++ b/tests/auto/inputpanel/data/inputpanel/handwriting.js @@ -32,6 +32,7 @@ .import "unipen_data.js" as UnipenData .import "unipen_data_simp_chinese.js" as UnipenDataSimpChinese .import "unipen_data_trad_chinese.js" as UnipenDataTradChinese +.import "unipen_data_korean.js" as UnipenDataKorean function emulate(testcase, hwrInputArea, ch, instant) { var chKey = (((typeof ch == "number") ? ch : ch.charCodeAt(0)) + 0x100000000).toString(16).substr(1) @@ -45,6 +46,8 @@ function emulate(testcase, hwrInputArea, ch, instant) { unipenData = UnipenDataSimpChinese else if (UnipenDataTradChinese.unipenData.hasOwnProperty(chKey)) unipenData = UnipenDataTradChinese + else if (UnipenDataKorean.unipenData.hasOwnProperty(chKey)) + unipenData = UnipenDataKorean 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 05667524..e813d392 100644 --- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml @@ -265,6 +265,8 @@ InputPanel { return InputEngine.FullwidthLatin else if (inputModeName === "ChineseHandwriting") return InputEngine.ChineseHandwriting + else if (inputModeName === "KoreanHandwriting") + return InputEngine.KoreanHandwriting else return -1 } diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js b/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js new file mode 100644 index 00000000..1b487c49 --- /dev/null +++ b/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js @@ -0,0 +1,1708 @@ +/**************************************************************************** +** +** 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 = { + "0xad6d": { + ".COORD": [ + "X", + "Y", + "T" + ], + ".HIERARCHY": "CHARACTER", + ".PEN": [ + [ + [ + 379, + 53, + 0 + ], + [ + 380, + 53, + 155 + ], + [ + 382, + 53, + 177 + ], + [ + 385, + 53, + 179 + ], + [ + 391, + 53, + 243 + ], + [ + 400, + 53, + 244 + ], + [ + 421, + 55, + 311 + ], + [ + 437, + 55, + 313 + ], + [ + 441, + 55, + 315 + ], + [ + 448, + 55, + 365 + ], + [ + 454, + 55, + 366 + ], + [ + 461, + 55, + 370 + ], + [ + 467, + 54, + 426 + ], + [ + 472, + 54, + 427 + ], + [ + 475, + 54, + 486 + ], + [ + 477, + 54, + 487 + ], + [ + 478, + 54, + 490 + ], + [ + 479, + 54, + 548 + ], + [ + 480, + 54, + 549 + ], + [ + 482, + 54, + 610 + ], + [ + 485, + 54, + 610 + ], + [ + 488, + 54, + 670 + ], + [ + 489, + 54, + 731 + ], + [ + 489, + 55, + 939 + ], + [ + 489, + 56, + 1003 + ], + [ + 489, + 60, + 1004 + ], + [ + 489, + 64, + 1064 + ], + [ + 489, + 66, + 1065 + ], + [ + 489, + 72, + 1124 + ], + [ + 489, + 75, + 1125 + ], + [ + 489, + 79, + 1131 + ], + [ + 489, + 81, + 1184 + ], + [ + 489, + 86, + 1185 + ], + [ + 489, + 91, + 1245 + ], + [ + 489, + 92, + 1246 + ], + [ + 489, + 97, + 1306 + ], + [ + 489, + 99, + 1307 + ], + [ + 489, + 101, + 1366 + ], + [ + 489, + 102, + 1367 + ], + [ + 489, + 103, + 1427 + ], + [ + 489, + 105, + 1429 + ], + [ + 489, + 106, + 1500 + ], + [ + 489, + 107, + 1549 + ], + [ + 489, + 108, + 1550 + ], + [ + 489, + 109, + 1614 + ] + ], + [ + [ + 383, + 113, + 2999 + ], + [ + 384, + 113, + 3259 + ], + [ + 385, + 112, + 3291 + ], + [ + 386, + 112, + 3360 + ], + [ + 399, + 112, + 3361 + ], + [ + 412, + 112, + 3389 + ], + [ + 434, + 112, + 3449 + ], + [ + 440, + 112, + 3450 + ], + [ + 451, + 112, + 3451 + ], + [ + 455, + 112, + 3510 + ], + [ + 479, + 111, + 3511 + ], + [ + 493, + 110, + 3574 + ], + [ + 506, + 109, + 3576 + ], + [ + 513, + 109, + 3632 + ], + [ + 515, + 109, + 3633 + ], + [ + 516, + 109, + 3636 + ] + ], + [ + [ + 430, + 115, + 5767 + ], + [ + 430, + 116, + 5851 + ], + [ + 432, + 120, + 5884 + ], + [ + 433, + 123, + 5937 + ], + [ + 433, + 127, + 5938 + ], + [ + 434, + 130, + 6000 + ], + [ + 434, + 133, + 6002 + ], + [ + 435, + 139, + 6058 + ], + [ + 435, + 141, + 6059 + ], + [ + 435, + 142, + 6124 + ], + [ + 435, + 143, + 6523 + ] + ], + [ + [ + 393, + 151, + 7943 + ], + [ + 394, + 151, + 8099 + ], + [ + 399, + 150, + 8124 + ], + [ + 412, + 150, + 8184 + ], + [ + 422, + 150, + 8185 + ], + [ + 438, + 150, + 8245 + ], + [ + 448, + 150, + 8246 + ], + [ + 465, + 149, + 8305 + ], + [ + 478, + 149, + 8306 + ], + [ + 485, + 149, + 8366 + ], + [ + 487, + 149, + 8366 + ], + [ + 488, + 149, + 8432 + ], + [ + 489, + 149, + 8490 + ], + [ + 491, + 149, + 8492 + ], + [ + 492, + 149, + 8549 + ], + [ + 492, + 150, + 8835 + ], + [ + 492, + 152, + 8882 + ], + [ + 492, + 155, + 8883 + ], + [ + 492, + 159, + 8944 + ], + [ + 492, + 163, + 8945 + ], + [ + 492, + 168, + 9005 + ], + [ + 491, + 173, + 9005 + ], + [ + 491, + 177, + 9067 + ], + [ + 490, + 182, + 9068 + ], + [ + 490, + 188, + 9126 + ], + [ + 490, + 192, + 9126 + ], + [ + 490, + 193, + 9130 + ], + [ + 490, + 196, + 9188 + ], + [ + 490, + 198, + 9247 + ], + [ + 490, + 200, + 9247 + ], + [ + 490, + 202, + 9307 + ], + [ + 490, + 203, + 9308 + ] + ] + ], + ".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 + }, + "0xc5b4": { + ".COORD": [ + "X", + "Y", + "T" + ], + ".HIERARCHY": "CHARACTER", + ".PEN": [ + [ + [ + 569, + 64, + 0 + ], + [ + 568, + 64, + 53 + ], + [ + 565, + 64, + 54 + ], + [ + 559, + 64, + 114 + ], + [ + 553, + 65, + 115 + ], + [ + 545, + 66, + 174 + ], + [ + 533, + 71, + 175 + ], + [ + 526, + 79, + 242 + ], + [ + 522, + 87, + 245 + ], + [ + 520, + 92, + 246 + ], + [ + 519, + 94, + 296 + ], + [ + 517, + 103, + 297 + ], + [ + 516, + 114, + 357 + ], + [ + 518, + 130, + 358 + ], + [ + 520, + 141, + 417 + ], + [ + 522, + 146, + 418 + ], + [ + 524, + 152, + 478 + ], + [ + 528, + 159, + 479 + ], + [ + 533, + 165, + 540 + ], + [ + 536, + 169, + 541 + ], + [ + 538, + 171, + 601 + ], + [ + 543, + 174, + 601 + ], + [ + 544, + 175, + 604 + ], + [ + 545, + 175, + 662 + ], + [ + 549, + 175, + 664 + ], + [ + 557, + 174, + 723 + ], + [ + 564, + 170, + 727 + ], + [ + 570, + 164, + 789 + ], + [ + 578, + 159, + 793 + ], + [ + 581, + 155, + 849 + ], + [ + 584, + 151, + 849 + ], + [ + 586, + 147, + 852 + ], + [ + 588, + 143, + 904 + ], + [ + 588, + 137, + 905 + ], + [ + 590, + 131, + 907 + ], + [ + 590, + 125, + 965 + ], + [ + 590, + 115, + 966 + ], + [ + 589, + 109, + 997 + ], + [ + 585, + 98, + 1029 + ], + [ + 583, + 88, + 1030 + ], + [ + 580, + 83, + 1089 + ], + [ + 576, + 75, + 1091 + ], + [ + 576, + 73, + 1092 + ], + [ + 572, + 70, + 1151 + ], + [ + 568, + 65, + 1153 + ], + [ + 568, + 64, + 1209 + ], + [ + 567, + 64, + 1453 + ] + ], + [ + [ + 592, + 124, + 2520 + ], + [ + 593, + 124, + 2621 + ], + [ + 595, + 123, + 2645 + ], + [ + 601, + 123, + 2711 + ], + [ + 607, + 122, + 2712 + ], + [ + 614, + 122, + 2779 + ], + [ + 618, + 122, + 2781 + ], + [ + 622, + 121, + 2840 + ], + [ + 623, + 121, + 2957 + ], + [ + 624, + 121, + 3045 + ], + [ + 625, + 120, + 3236 + ] + ], + [ + [ + 614, + 42, + 3848 + ], + [ + 614, + 45, + 3896 + ], + [ + 614, + 47, + 3897 + ], + [ + 614, + 54, + 3900 + ], + [ + 615, + 63, + 3958 + ], + [ + 617, + 76, + 3958 + ], + [ + 619, + 92, + 4017 + ], + [ + 620, + 100, + 4018 + ], + [ + 620, + 115, + 4078 + ], + [ + 620, + 133, + 4079 + ], + [ + 618, + 141, + 4084 + ], + [ + 616, + 153, + 4138 + ], + [ + 616, + 157, + 4139 + ], + [ + 615, + 169, + 4200 + ], + [ + 614, + 176, + 4201 + ], + [ + 614, + 178, + 4205 + ], + [ + 613, + 184, + 4260 + ], + [ + 613, + 188, + 4261 + ], + [ + 613, + 190, + 4420 + ], + [ + 613, + 191, + 4540 + ] + ] + ], + ".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 + }, + "0xd55c": { + ".COORD": [ + "X", + "Y", + "T" + ], + ".HIERARCHY": "CHARACTER", + ".PEN": [ + [ + [ + 169, + 59, + 0 + ], + [ + 171, + 59, + 148 + ], + [ + 175, + 59, + 170 + ], + [ + 183, + 59, + 228 + ], + [ + 197, + 59, + 229 + ], + [ + 210, + 59, + 288 + ], + [ + 223, + 61, + 289 + ], + [ + 233, + 61, + 292 + ], + [ + 241, + 61, + 350 + ], + [ + 252, + 62, + 350 + ], + [ + 260, + 62, + 418 + ], + [ + 265, + 62, + 419 + ], + [ + 266, + 62, + 748 + ] + ], + [ + [ + 224, + 27, + 1367 + ], + [ + 223, + 27, + 1414 + ], + [ + 222, + 34, + 1444 + ], + [ + 222, + 39, + 1502 + ], + [ + 223, + 46, + 1503 + ], + [ + 223, + 47, + 1508 + ], + [ + 223, + 50, + 1566 + ], + [ + 224, + 53, + 1568 + ], + [ + 224, + 56, + 1629 + ], + [ + 224, + 57, + 1630 + ], + [ + 225, + 59, + 1630 + ], + [ + 225, + 61, + 1686 + ], + [ + 225, + 62, + 1687 + ] + ], + [ + [ + 244, + 82, + 3184 + ], + [ + 243, + 81, + 3259 + ], + [ + 242, + 81, + 3285 + ], + [ + 238, + 80, + 3349 + ], + [ + 225, + 80, + 3350 + ], + [ + 210, + 80, + 3412 + ], + [ + 198, + 82, + 3414 + ], + [ + 192, + 84, + 3474 + ], + [ + 186, + 88, + 3476 + ], + [ + 184, + 90, + 3478 + ], + [ + 180, + 95, + 3532 + ], + [ + 178, + 100, + 3533 + ], + [ + 178, + 109, + 3595 + ], + [ + 178, + 117, + 3598 + ], + [ + 181, + 125, + 3657 + ], + [ + 186, + 130, + 3658 + ], + [ + 194, + 136, + 3716 + ], + [ + 197, + 137, + 3717 + ], + [ + 199, + 137, + 3775 + ], + [ + 202, + 137, + 3776 + ], + [ + 204, + 137, + 3780 + ], + [ + 206, + 137, + 3835 + ], + [ + 223, + 135, + 3836 + ], + [ + 234, + 133, + 3897 + ], + [ + 240, + 130, + 3898 + ], + [ + 242, + 129, + 3900 + ], + [ + 244, + 128, + 3958 + ], + [ + 251, + 120, + 3959 + ], + [ + 253, + 117, + 4017 + ], + [ + 253, + 114, + 4020 + ], + [ + 253, + 110, + 4081 + ], + [ + 251, + 104, + 4083 + ], + [ + 249, + 99, + 4140 + ], + [ + 247, + 95, + 4141 + ], + [ + 243, + 89, + 4205 + ], + [ + 242, + 86, + 4206 + ], + [ + 242, + 85, + 4212 + ], + [ + 241, + 84, + 4284 + ], + [ + 240, + 84, + 4324 + ], + [ + 239, + 84, + 4596 + ] + ], + [ + [ + 177, + 144, + 6344 + ], + [ + 178, + 144, + 6573 + ], + [ + 178, + 146, + 6600 + ], + [ + 179, + 148, + 6604 + ], + [ + 179, + 150, + 6657 + ], + [ + 180, + 153, + 6658 + ], + [ + 181, + 160, + 6719 + ], + [ + 182, + 167, + 6720 + ], + [ + 183, + 176, + 6779 + ], + [ + 184, + 182, + 6780 + ], + [ + 184, + 185, + 6840 + ], + [ + 185, + 189, + 6841 + ], + [ + 186, + 189, + 7108 + ], + [ + 195, + 189, + 7174 + ], + [ + 206, + 187, + 7234 + ], + [ + 213, + 186, + 7236 + ], + [ + 219, + 186, + 7294 + ], + [ + 224, + 186, + 7296 + ], + [ + 233, + 186, + 7355 + ], + [ + 241, + 185, + 7355 + ], + [ + 252, + 185, + 7417 + ], + [ + 262, + 185, + 7419 + ], + [ + 268, + 186, + 7421 + ], + [ + 276, + 186, + 7475 + ], + [ + 281, + 186, + 7476 + ], + [ + 289, + 186, + 7536 + ], + [ + 290, + 186, + 7537 + ], + [ + 291, + 186, + 7597 + ], + [ + 292, + 186, + 7660 + ], + [ + 293, + 186, + 7724 + ], + [ + 294, + 186, + 7725 + ], + [ + 295, + 186, + 8172 + ] + ], + [ + [ + 283, + 25, + 9136 + ], + [ + 283, + 26, + 9220 + ], + [ + 283, + 27, + 9244 + ], + [ + 283, + 33, + 9299 + ], + [ + 283, + 41, + 9300 + ], + [ + 282, + 53, + 9359 + ], + [ + 282, + 65, + 9359 + ], + [ + 282, + 78, + 9420 + ], + [ + 282, + 92, + 9421 + ], + [ + 281, + 115, + 9481 + ], + [ + 280, + 124, + 9482 + ], + [ + 279, + 133, + 9484 + ], + [ + 279, + 135, + 9542 + ], + [ + 278, + 142, + 9542 + ], + [ + 277, + 148, + 9605 + ], + [ + 277, + 150, + 9607 + ], + [ + 277, + 151, + 9764 + ], + [ + 277, + 153, + 9816 + ], + [ + 277, + 154, + 9876 + ], + [ + 277, + 153, + 10124 + ], + [ + 277, + 151, + 10180 + ] + ], + [ + [ + 282, + 89, + 10651 + ], + [ + 283, + 89, + 10796 + ], + [ + 286, + 89, + 10821 + ], + [ + 288, + 88, + 10879 + ], + [ + 291, + 88, + 10879 + ], + [ + 294, + 88, + 10941 + ], + [ + 295, + 88, + 10941 + ], + [ + 297, + 88, + 11003 + ], + [ + 298, + 88, + 11004 + ], + [ + 299, + 88, + 11061 + ], + [ + 300, + 88, + 11062 + ], + [ + 301, + 88, + 11121 + ], + [ + 302, + 88, + 11123 + ], + [ + 303, + 88, + 11185 + ], + [ + 304, + 88, + 11187 + ], + [ + 305, + 88, + 11189 + ], + [ + 306, + 88, + 11248 + ], + [ + 307, + 88, + 11249 + ], + [ + 309, + 89, + 11304 + ] + ] + ], + ".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 c74fa013..38b80c0a 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -1103,6 +1103,7 @@ Rectangle { { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 3, inputSequence: "uvwxyz", outputText: "UVWXYZ" }, { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_CN", initInputMode: "ChineseHandwriting", inputSequence: "\u4e2d\u6587", outputText: "\u4e2d\u6587" }, { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_TW", initInputMode: "ChineseHandwriting", inputSequence: "\u570b", outputText: "\u570b" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ko_KR", initInputMode: "KoreanHandwriting", inputSequence: "\uD55C\uAD6D\uC5B4", outputText: "\uD55C\uAD6D\uC5B4" }, ] } diff --git a/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt new file mode 100644 index 00000000..cd2eab9b --- /dev/null +++ b/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt @@ -0,0 +1,121 @@ +.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 +379 53 0 +380 53 155 +382 53 177 +385 53 179 +391 53 243 +400 53 244 +421 55 311 +437 55 313 +441 55 315 +448 55 365 +454 55 366 +461 55 370 +467 54 426 +472 54 427 +475 54 486 +477 54 487 +478 54 490 +479 54 548 +480 54 549 +482 54 610 +485 54 610 +488 54 670 +489 54 731 +489 55 939 +489 56 1003 +489 60 1004 +489 64 1064 +489 66 1065 +489 72 1124 +489 75 1125 +489 79 1131 +489 81 1184 +489 86 1185 +489 91 1245 +489 92 1246 +489 97 1306 +489 99 1307 +489 101 1366 +489 102 1367 +489 103 1427 +489 105 1429 +489 106 1500 +489 107 1549 +489 108 1550 +489 109 1614 +.PEN_UP +.PEN_DOWN +383 113 2999 +384 113 3259 +385 112 3291 +386 112 3360 +399 112 3361 +412 112 3389 +434 112 3449 +440 112 3450 +451 112 3451 +455 112 3510 +479 111 3511 +493 110 3574 +506 109 3576 +513 109 3632 +515 109 3633 +516 109 3636 +.PEN_UP +.PEN_DOWN +430 115 5767 +430 116 5851 +432 120 5884 +433 123 5937 +433 127 5938 +434 130 6000 +434 133 6002 +435 139 6058 +435 141 6059 +435 142 6124 +435 143 6523 +.PEN_UP +.PEN_DOWN +393 151 7943 +394 151 8099 +399 150 8124 +412 150 8184 +422 150 8185 +438 150 8245 +448 150 8246 +465 149 8305 +478 149 8306 +485 149 8366 +487 149 8366 +488 149 8432 +489 149 8490 +491 149 8492 +492 149 8549 +492 150 8835 +492 152 8882 +492 155 8883 +492 159 8944 +492 163 8945 +492 168 9005 +491 173 9005 +491 177 9067 +490 182 9068 +490 188 9126 +490 192 9126 +490 193 9130 +490 196 9188 +490 198 9247 +490 200 9247 +490 202 9307 +490 203 9308 +.PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt new file mode 100644 index 00000000..fd22d87d --- /dev/null +++ b/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt @@ -0,0 +1,93 @@ +.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 +569 64 0 +568 64 53 +565 64 54 +559 64 114 +553 65 115 +545 66 174 +533 71 175 +526 79 242 +522 87 245 +520 92 246 +519 94 296 +517 103 297 +516 114 357 +518 130 358 +520 141 417 +522 146 418 +524 152 478 +528 159 479 +533 165 540 +536 169 541 +538 171 601 +543 174 601 +544 175 604 +545 175 662 +549 175 664 +557 174 723 +564 170 727 +570 164 789 +578 159 793 +581 155 849 +584 151 849 +586 147 852 +588 143 904 +588 137 905 +590 131 907 +590 125 965 +590 115 966 +589 109 997 +585 98 1029 +583 88 1030 +580 83 1089 +576 75 1091 +576 73 1092 +572 70 1151 +568 65 1153 +568 64 1209 +567 64 1453 +.PEN_UP +.PEN_DOWN +592 124 2520 +593 124 2621 +595 123 2645 +601 123 2711 +607 122 2712 +614 122 2779 +618 122 2781 +622 121 2840 +623 121 2957 +624 121 3045 +625 120 3236 +.PEN_UP +.PEN_DOWN +614 42 3848 +614 45 3896 +614 47 3897 +614 54 3900 +615 63 3958 +617 76 3958 +619 92 4017 +620 100 4018 +620 115 4078 +620 133 4079 +618 141 4084 +616 153 4138 +616 157 4139 +615 169 4200 +614 176 4201 +614 178 4205 +613 184 4260 +613 188 4261 +613 190 4420 +613 191 4540 +.PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt new file mode 100644 index 00000000..99f6f912 --- /dev/null +++ b/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt @@ -0,0 +1,159 @@ +.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 +169 59 0 +171 59 148 +175 59 170 +183 59 228 +197 59 229 +210 59 288 +223 61 289 +233 61 292 +241 61 350 +252 62 350 +260 62 418 +265 62 419 +266 62 748 +.PEN_UP +.PEN_DOWN +224 27 1367 +223 27 1414 +222 34 1444 +222 39 1502 +223 46 1503 +223 47 1508 +223 50 1566 +224 53 1568 +224 56 1629 +224 57 1630 +225 59 1630 +225 61 1686 +225 62 1687 +.PEN_UP +.PEN_DOWN +244 82 3184 +243 81 3259 +242 81 3285 +238 80 3349 +225 80 3350 +210 80 3412 +198 82 3414 +192 84 3474 +186 88 3476 +184 90 3478 +180 95 3532 +178 100 3533 +178 109 3595 +178 117 3598 +181 125 3657 +186 130 3658 +194 136 3716 +197 137 3717 +199 137 3775 +202 137 3776 +204 137 3780 +206 137 3835 +223 135 3836 +234 133 3897 +240 130 3898 +242 129 3900 +244 128 3958 +251 120 3959 +253 117 4017 +253 114 4020 +253 110 4081 +251 104 4083 +249 99 4140 +247 95 4141 +243 89 4205 +242 86 4206 +242 85 4212 +241 84 4284 +240 84 4324 +239 84 4596 +.PEN_UP +.PEN_DOWN +177 144 6344 +178 144 6573 +178 146 6600 +179 148 6604 +179 150 6657 +180 153 6658 +181 160 6719 +182 167 6720 +183 176 6779 +184 182 6780 +184 185 6840 +185 189 6841 +186 189 7108 +195 189 7174 +206 187 7234 +213 186 7236 +219 186 7294 +224 186 7296 +233 186 7355 +241 185 7355 +252 185 7417 +262 185 7419 +268 186 7421 +276 186 7475 +281 186 7476 +289 186 7536 +290 186 7537 +291 186 7597 +292 186 7660 +293 186 7724 +294 186 7725 +295 186 8172 +.PEN_UP +.PEN_DOWN +283 25 9136 +283 26 9220 +283 27 9244 +283 33 9299 +283 41 9300 +282 53 9359 +282 65 9359 +282 78 9420 +282 92 9421 +281 115 9481 +280 124 9482 +279 133 9484 +279 135 9542 +278 142 9542 +277 148 9605 +277 150 9607 +277 151 9764 +277 153 9816 +277 154 9876 +277 153 10124 +277 151 10180 +.PEN_UP +.PEN_DOWN +282 89 10651 +283 89 10796 +286 89 10821 +288 88 10879 +291 88 10879 +294 88 10941 +295 88 10941 +297 88 11003 +298 88 11004 +299 88 11061 +300 88 11062 +301 88 11121 +302 88 11123 +303 88 11185 +304 88 11187 +305 88 11189 +306 88 11248 +307 88 11249 +309 89 11304 +.PEN_UP |