From f36bdfabafb5cae85ee7883181e88b39de8af779 Mon Sep 17 00:00:00 2001
From: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Date: Wed, 7 Jun 2017 00:05:42 +0300
Subject: [PATCH] Add support for Japanese handwriting (T9 Write CJK)

This change adds handwriting support for Japanese.

Change-Id: Ifc8f0e32c8b3211c13aee8be5cb2e05fae09d3b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
---
 .../content/components/InputModeKey.qml       |    1 +
 .../content/layouts/ja_JP/handwriting.qml     |  116 +
 .../content/layouts/ja_JP/main.qml            |   10 +-
 .../content/styles/default/style.qml          |    2 +
 .../content/styles/retro/style.qml            |    2 +
 src/virtualkeyboard/inputengine.cpp           |    1 +
 src/virtualkeyboard/inputengine.h             |    1 +
 src/virtualkeyboard/shifthandler.cpp          |    2 +-
 src/virtualkeyboard/t9writeinputmethod.cpp    |   42 +-
 src/virtualkeyboard/virtualkeyboard.pro       |    2 +
 .../inputpanel/data/inputpanel/handwriting.js |    3 +
 .../inputpanel/data/inputpanel/inputpanel.qml |    2 +
 .../data/inputpanel/unipen_data_japanese.js   | 2503 +++++++++++++++++
 tests/auto/inputpanel/data/tst_inputpanel.qml |    1 +
 .../hwr_test_data/japanese/26085_100_0.txt    |   94 +
 .../hwr_test_data/japanese/26412_100_0.txt    |  121 +
 .../hwr_test_data/japanese/35486_100_0.txt    |  333 +++
 17 files changed, 3227 insertions(+), 9 deletions(-)
 create mode 100644 src/virtualkeyboard/content/layouts/ja_JP/handwriting.qml
 create mode 100644 tests/auto/inputpanel/data/inputpanel/unipen_data_japanese.js
 create mode 100644 tests/auto/inputpanel/hwr_test_data/japanese/26085_100_0.txt
 create mode 100644 tests/auto/inputpanel/hwr_test_data/japanese/26412_100_0.txt
 create mode 100644 tests/auto/inputpanel/hwr_test_data/japanese/35486_100_0.txt

diff --git a/src/virtualkeyboard/content/components/InputModeKey.qml b/src/virtualkeyboard/content/components/InputModeKey.qml
index 141413e8..dc4c8266 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.JapaneseHandwriting
         "한국어", // InputEngine.KoreanHandwriting
     ]
 
diff --git a/src/virtualkeyboard/content/layouts/ja_JP/handwriting.qml b/src/virtualkeyboard/content/layouts/ja_JP/handwriting.qml
new file mode 100644
index 00000000..0820cbbc
--- /dev/null
+++ b/src/virtualkeyboard/content/layouts/ja_JP/handwriting.qml
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** 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.JapaneseHandwriting
+    }
+
+    KeyboardRow {
+        Layout.preferredHeight: 3
+        KeyboardColumn {
+            Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width
+            KeyboardRow {
+                TraceInputKey {
+                    objectName: "hwrInputArea"
+                    patternRecognitionMode: InputEngine.HandwritingRecoginition
+                    horizontalRulers:
+                        InputContext.inputEngine.inputMode !== InputEngine.JapaneseHandwriting ? [] :
+                            [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
+        }
+        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/ja_JP/main.qml b/src/virtualkeyboard/content/layouts/ja_JP/main.qml
index 772702af..06d8fd0b 100644
--- a/src/virtualkeyboard/content/layouts/ja_JP/main.qml
+++ b/src/virtualkeyboard/content/layouts/ja_JP/main.qml
@@ -189,10 +189,11 @@ KeyboardLayoutLoader {
             KeyboardRow {
                 keyWeight: 154
                 SymbolModeKey {
-                    weight: 217
+                    weight: 194
                 }
                 ChangeLanguageKey {
-                    weight: 174
+                }
+                HandwritingModeKey {
                 }
                 Key {
                     key: Qt.Key_Left
@@ -378,10 +379,11 @@ KeyboardLayoutLoader {
             KeyboardRow {
                 keyWeight: 154
                 SymbolModeKey {
-                    weight: 217
+                    weight: 194
                 }
                 ChangeLanguageKey {
-                    weight: 174
+                }
+                HandwritingModeKey {
                 }
                 Key {
                     key: Qt.Key_Left
diff --git a/src/virtualkeyboard/content/styles/default/style.qml b/src/virtualkeyboard/content/styles/default/style.qml
index e759616e..b4848f68 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.JapaneseHandwriting:
+                        return "日本語"
                     case InputEngine.KoreanHandwriting:
                         return "한국어"
                     default:
diff --git a/src/virtualkeyboard/content/styles/retro/style.qml b/src/virtualkeyboard/content/styles/retro/style.qml
index 68905852..26def327 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.JapaneseHandwriting:
+                    return "日本語"
                 case InputEngine.KoreanHandwriting:
                     return "한국어"
                 default:
diff --git a/src/virtualkeyboard/inputengine.cpp b/src/virtualkeyboard/inputengine.cpp
index 811b04ca..097e99bd 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.JapaneseHandwriting Japanese handwriting.
         \li \c InputEngine.KoreanHandwriting Korean handwriting.
     \endlist
 */
diff --git a/src/virtualkeyboard/inputengine.h b/src/virtualkeyboard/inputengine.h
index e8622f63..2d7980d1 100644
--- a/src/virtualkeyboard/inputengine.h
+++ b/src/virtualkeyboard/inputengine.h
@@ -75,6 +75,7 @@ public:
         Katakana,
         FullwidthLatin,
         ChineseHandwriting,
+        JapaneseHandwriting,
         KoreanHandwriting
     };
     enum PatternRecognitionMode {
diff --git a/src/virtualkeyboard/shifthandler.cpp b/src/virtualkeyboard/shifthandler.cpp
index 47328d60..62d23775 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 << InputEngine::KoreanHandwriting),
+        noAutoUppercaseInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::FullwidthLatin << InputEngine::Pinyin << InputEngine::Cangjie << InputEngine::Zhuyin << InputEngine::ChineseHandwriting << InputEngine::JapaneseHandwriting << 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 c9e5829b..d081fad2 100644
--- a/src/virtualkeyboard/t9writeinputmethod.cpp
+++ b/src/virtualkeyboard/t9writeinputmethod.cpp
@@ -455,6 +455,9 @@ public:
             return SimplifiedChinese;
             break;
         }
+        case QLocale::Japanese:
+            return Japanese;
+            break;
         case QLocale::Korean:
             return Korean;
         default:
@@ -620,6 +623,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_JP) {
+            if (inputMode != InputEngine::JapaneseHandwriting)
+                language = DECUMA_LANG_EN;
         } else if (language == DECUMA_LANG_KO) {
             if (inputMode != InputEngine::KoreanHandwriting)
                 language = DECUMA_LANG_EN;
@@ -642,7 +648,9 @@ public:
         sessionSettings.recognitionMode = mcrMode;
 
         // Use scrMode with hidden text or with no predictive mode
-        if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) {
+        if (inputMode != InputEngine::ChineseHandwriting &&
+                inputMode != InputEngine::JapaneseHandwriting &&
+                inputMode != InputEngine::KoreanHandwriting) {
             const Qt::InputMethodHints inputMethodHints = q->inputContext()->inputMethodHints();
             if (inputMethodHints.testFlag(Qt::ImhHiddenText) || inputMethodHints.testFlag(Qt::ImhNoPredictiveText))
                 sessionSettings.recognitionMode = scrMode;
@@ -782,6 +790,18 @@ public:
             }
             break;
 
+        case InputEngine::JapaneseHandwriting:
+            symbolCategories.append(DECUMA_CATEGORY_JIS_LEVEL_1);
+            symbolCategories.append(DECUMA_CATEGORY_JIS_LEVEL_2);
+            symbolCategories.append(DECUMA_CATEGORY_HIRAGANA);
+            symbolCategories.append(DECUMA_CATEGORY_KATAKANA);
+            symbolCategories.append(DECUMA_CATEGORY_HIRAGANASMALL);
+            symbolCategories.append(DECUMA_CATEGORY_KATAKANASMALL);
+            symbolCategories.append(DECUMA_CATEGORY_CJK_SYMBOL);
+            symbolCategories.append(DECUMA_CATEGORY_CJK_GENERAL_PUNCTUATIONS);
+            symbolCategories.append(DECUMA_CATEGORY_PUNCTUATIONS);
+            break;
+
         case InputEngine::KoreanHandwriting:
             symbolCategories.append(DECUMA_CATEGORY_HANGUL_1001_A);
             symbolCategories.append(DECUMA_CATEGORY_HANGUL_1001_B);
@@ -1263,7 +1283,9 @@ public:
         // Delete trace history
         const InputEngine::InputMode inputMode = q->inputEngine()->inputMode();
         if (sessionSettings.recognitionMode == mcrMode && !symbolStrokes.isEmpty() &&
-                inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) {
+                inputMode != InputEngine::ChineseHandwriting &&
+                inputMode != InputEngine::JapaneseHandwriting &&
+                inputMode != InputEngine::KoreanHandwriting) {
             int activeTraces = symbolStrokes.at(symbolStrokes.count() - 1).toInt();
             if (symbolStrokes.count() > 1)
                 activeTraces += symbolStrokes.at(symbolStrokes.count() - 2).toInt();
@@ -1362,7 +1384,9 @@ public:
 
                 // Swipe right
                 const InputEngine::InputMode inputMode = q->inputEngine()->inputMode();
-                if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting) {
+                if (inputMode != InputEngine::ChineseHandwriting &&
+                        inputMode != InputEngine::JapaneseHandwriting &&
+                        inputMode != InputEngine::KoreanHandwriting) {
                     if (swipeAngle <= SWIPE_ANGLE_THRESHOLD || swipeAngle >= 360 - SWIPE_ANGLE_THRESHOLD) {
                         if (swipeTouchCount == 1) {
                             // Single swipe: space
@@ -1518,6 +1542,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::Japanese:
+        if (d->findHwrDb(T9WriteInputMethodPrivate::Japanese, d->defaultHwrDbPath).isEmpty())
+            return availableInputModes;
+        if (!(inputMethodHints & (Qt::ImhDialableCharactersOnly | Qt::ImhFormattedNumbersOnly | Qt::ImhDigitsOnly | Qt::ImhLatinOnly)))
+            availableInputModes.append(InputEngine::JapaneseHandwriting);
+        break;
     case T9WriteInputMethodPrivate::Korean:
         if (d->findHwrDb(T9WriteInputMethodPrivate::Korean, d->defaultHwrDbPath).isEmpty())
             return availableInputModes;
@@ -1728,6 +1758,7 @@ bool T9WriteInputMethod::reselect(int cursorPosition, const InputEngine::Reselec
 
     const InputEngine::InputMode inputMode = inputEngine()->inputMode();
     const int maxLength = (inputMode == InputEngine::ChineseHandwriting ||
+            inputMode == InputEngine::JapaneseHandwriting ||
             inputMode == InputEngine::KoreanHandwriting) ? 0 : 32;
     const QString surroundingText = ic->surroundingText();
     int replaceFrom = 0;
@@ -1807,8 +1838,11 @@ void T9WriteInputMethod::timerEvent(QTimerEvent *timerEvent)
             d->stopResultTimer();
 #ifndef QT_VIRTUALKEYBOARD_RECORD_TRACE_INPUT
             const InputEngine::InputMode inputMode = inputEngine()->inputMode();
-            if (inputMode != InputEngine::ChineseHandwriting && inputMode != InputEngine::KoreanHandwriting)
+            if (inputMode != InputEngine::ChineseHandwriting &&
+                    inputMode != InputEngine::JapaneseHandwriting &&
+                    inputMode != InputEngine::KoreanHandwriting) {
                 d->clearTraces();
+            }
 #endif
         } else if (d->sessionSettings.recognitionMode == scrMode) {
             d->select();
diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro
index 1399d20e..5af6a00e 100644
--- a/src/virtualkeyboard/virtualkeyboard.pro
+++ b/src/virtualkeyboard/virtualkeyboard.pro
@@ -143,6 +143,8 @@ contains(CONFIG, lang-ja.*) {
     LAYOUT_FILES += \
         content/layouts/ja_JP/main.qml \
         content/layouts/ja_JP/symbols.qml
+t9write-cjk: LAYOUT_FILES += \
+        content/layouts/ja_JP/handwriting.qml
 }
 contains(CONFIG, lang-ko.*) {
     LAYOUT_FILES += \
diff --git a/tests/auto/inputpanel/data/inputpanel/handwriting.js b/tests/auto/inputpanel/data/inputpanel/handwriting.js
index 36f76e84..41478a7b 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_japanese.js" as UnipenDataJapanese
 .import "unipen_data_korean.js" as UnipenDataKorean
 
 function emulate(testcase, hwrInputArea, ch, instant) {
@@ -46,6 +47,8 @@ function emulate(testcase, hwrInputArea, ch, instant) {
         unipenData = UnipenDataSimpChinese
     else if (UnipenDataTradChinese.unipenData.hasOwnProperty(chKey))
         unipenData = UnipenDataTradChinese
+    else if (UnipenDataJapanese.unipenData.hasOwnProperty(chKey))
+        unipenData = UnipenDataJapanese
     else if (UnipenDataKorean.unipenData.hasOwnProperty(chKey))
         unipenData = UnipenDataKorean
     else
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
index e813d392..4fc167e4 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 === "JapaneseHandwriting")
+            return InputEngine.JapaneseHandwriting
         else if (inputModeName === "KoreanHandwriting")
             return InputEngine.KoreanHandwriting
         else
diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data_japanese.js b/tests/auto/inputpanel/data/inputpanel/unipen_data_japanese.js
new file mode 100644
index 00000000..bef4fc56
--- /dev/null
+++ b/tests/auto/inputpanel/data/inputpanel/unipen_data_japanese.js
@@ -0,0 +1,2503 @@
+/****************************************************************************
+**
+** 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 = {
+    "0x65e5": {
+        ".COORD": [
+            "X",
+            "Y",
+            "T"
+        ],
+        ".HIERARCHY": "CHARACTER",
+        ".PEN": [
+            [
+                [
+                    113,
+                    59,
+                    0
+                ],
+                [
+                    113,
+                    64,
+                    56
+                ],
+                [
+                    113,
+                    71,
+                    86
+                ],
+                [
+                    113,
+                    78,
+                    92
+                ],
+                [
+                    113,
+                    85,
+                    148
+                ],
+                [
+                    113,
+                    95,
+                    149
+                ],
+                [
+                    113,
+                    109,
+                    212
+                ],
+                [
+                    111,
+                    127,
+                    213
+                ],
+                [
+                    111,
+                    131,
+                    268
+                ],
+                [
+                    111,
+                    143,
+                    269
+                ],
+                [
+                    110,
+                    150,
+                    330
+                ],
+                [
+                    109,
+                    156,
+                    331
+                ],
+                [
+                    109,
+                    160,
+                    391
+                ],
+                [
+                    109,
+                    164,
+                    392
+                ],
+                [
+                    109,
+                    167,
+                    453
+                ],
+                [
+                    109,
+                    170,
+                    455
+                ],
+                [
+                    109,
+                    171,
+                    512
+                ],
+                [
+                    109,
+                    172,
+                    513
+                ],
+                [
+                    109,
+                    173,
+                    516
+                ],
+                [
+                    109,
+                    175,
+                    573
+                ],
+                [
+                    109,
+                    177,
+                    634
+                ],
+                [
+                    109,
+                    178,
+                    636
+                ],
+                [
+                    110,
+                    179,
+                    698
+                ],
+                [
+                    110,
+                    180,
+                    701
+                ]
+            ],
+            [
+                [
+                    116,
+                    58,
+                    1545
+                ],
+                [
+                    117,
+                    58,
+                    1612
+                ],
+                [
+                    130,
+                    57,
+                    1640
+                ],
+                [
+                    153,
+                    58,
+                    1699
+                ],
+                [
+                    165,
+                    59,
+                    1700
+                ],
+                [
+                    187,
+                    60,
+                    1764
+                ],
+                [
+                    195,
+                    62,
+                    1766
+                ],
+                [
+                    200,
+                    63,
+                    1820
+                ],
+                [
+                    202,
+                    63,
+                    1821
+                ],
+                [
+                    203,
+                    63,
+                    2004
+                ],
+                [
+                    203,
+                    65,
+                    2061
+                ],
+                [
+                    203,
+                    69,
+                    2061
+                ],
+                [
+                    204,
+                    72,
+                    2124
+                ],
+                [
+                    204,
+                    87,
+                    2125
+                ],
+                [
+                    203,
+                    90,
+                    2183
+                ],
+                [
+                    200,
+                    103,
+                    2185
+                ],
+                [
+                    198,
+                    115,
+                    2188
+                ],
+                [
+                    198,
+                    119,
+                    2248
+                ],
+                [
+                    197,
+                    139,
+                    2248
+                ],
+                [
+                    196,
+                    148,
+                    2304
+                ],
+                [
+                    195,
+                    158,
+                    2307
+                ],
+                [
+                    195,
+                    160,
+                    2308
+                ],
+                [
+                    195,
+                    165,
+                    2364
+                ],
+                [
+                    195,
+                    173,
+                    2365
+                ],
+                [
+                    194,
+                    179,
+                    2425
+                ],
+                [
+                    194,
+                    181,
+                    2426
+                ],
+                [
+                    194,
+                    185,
+                    2427
+                ],
+                [
+                    194,
+                    187,
+                    2485
+                ],
+                [
+                    193,
+                    190,
+                    2486
+                ],
+                [
+                    193,
+                    189,
+                    2740
+                ]
+            ],
+            [
+                [
+                    113,
+                    123,
+                    3457
+                ],
+                [
+                    114,
+                    123,
+                    3517
+                ],
+                [
+                    120,
+                    123,
+                    3545
+                ],
+                [
+                    127,
+                    123,
+                    3547
+                ],
+                [
+                    131,
+                    123,
+                    3610
+                ],
+                [
+                    166,
+                    126,
+                    3611
+                ],
+                [
+                    185,
+                    127,
+                    3669
+                ],
+                [
+                    194,
+                    128,
+                    3670
+                ],
+                [
+                    195,
+                    128,
+                    3731
+                ]
+            ],
+            [
+                [
+                    110,
+                    180,
+                    4616
+                ],
+                [
+                    110,
+                    181,
+                    4683
+                ],
+                [
+                    115,
+                    181,
+                    4701
+                ],
+                [
+                    122,
+                    182,
+                    4765
+                ],
+                [
+                    143,
+                    182,
+                    4765
+                ],
+                [
+                    174,
+                    183,
+                    4820
+                ],
+                [
+                    179,
+                    184,
+                    4821
+                ],
+                [
+                    181,
+                    184,
+                    4824
+                ],
+                [
+                    187,
+                    184,
+                    4882
+                ],
+                [
+                    188,
+                    184,
+                    4972
+                ],
+                [
+                    190,
+                    184,
+                    5036
+                ],
+                [
+                    191,
+                    184,
+                    5096
+                ],
+                [
+                    192,
+                    184,
+                    5098
+                ],
+                [
+                    193,
+                    184,
+                    5157
+                ]
+            ]
+        ],
+        ".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
+    },
+    "0x672c": {
+        ".COORD": [
+            "X",
+            "Y",
+            "T"
+        ],
+        ".HIERARCHY": "CHARACTER",
+        ".PEN": [
+            [
+                [
+                    314,
+                    61,
+                    0
+                ],
+                [
+                    315,
+                    61,
+                    71
+                ],
+                [
+                    319,
+                    61,
+                    95
+                ],
+                [
+                    329,
+                    61,
+                    154
+                ],
+                [
+                    341,
+                    61,
+                    155
+                ],
+                [
+                    355,
+                    61,
+                    215
+                ],
+                [
+                    381,
+                    61,
+                    216
+                ],
+                [
+                    398,
+                    60,
+                    277
+                ],
+                [
+                    402,
+                    60,
+                    277
+                ],
+                [
+                    413,
+                    60,
+                    279
+                ],
+                [
+                    424,
+                    60,
+                    340
+                ],
+                [
+                    436,
+                    61,
+                    342
+                ],
+                [
+                    437,
+                    61,
+                    343
+                ],
+                [
+                    443,
+                    61,
+                    398
+                ],
+                [
+                    449,
+                    62,
+                    399
+                ],
+                [
+                    452,
+                    63,
+                    462
+                ],
+                [
+                    453,
+                    63,
+                    599
+                ],
+                [
+                    452,
+                    62,
+                    871
+                ]
+            ],
+            [
+                [
+                    386,
+                    40,
+                    2172
+                ],
+                [
+                    386,
+                    41,
+                    2327
+                ],
+                [
+                    386,
+                    45,
+                    2351
+                ],
+                [
+                    386,
+                    48,
+                    2415
+                ],
+                [
+                    386,
+                    51,
+                    2418
+                ],
+                [
+                    386,
+                    54,
+                    2423
+                ],
+                [
+                    386,
+                    60,
+                    2479
+                ],
+                [
+                    384,
+                    69,
+                    2480
+                ],
+                [
+                    384,
+                    72,
+                    2537
+                ],
+                [
+                    384,
+                    89,
+                    2539
+                ],
+                [
+                    383,
+                    102,
+                    2596
+                ],
+                [
+                    382,
+                    113,
+                    2597
+                ],
+                [
+                    382,
+                    117,
+                    2599
+                ],
+                [
+                    381,
+                    123,
+                    2657
+                ],
+                [
+                    380,
+                    130,
+                    2658
+                ],
+                [
+                    380,
+                    135,
+                    2718
+                ],
+                [
+                    380,
+                    143,
+                    2718
+                ],
+                [
+                    380,
+                    147,
+                    2779
+                ],
+                [
+                    380,
+                    151,
+                    2780
+                ],
+                [
+                    380,
+                    157,
+                    2840
+                ],
+                [
+                    380,
+                    162,
+                    2841
+                ],
+                [
+                    380,
+                    163,
+                    2900
+                ],
+                [
+                    380,
+                    165,
+                    2901
+                ],
+                [
+                    380,
+                    168,
+                    2968
+                ],
+                [
+                    380,
+                    170,
+                    2970
+                ],
+                [
+                    380,
+                    173,
+                    3021
+                ],
+                [
+                    380,
+                    174,
+                    3082
+                ],
+                [
+                    380,
+                    175,
+                    3087
+                ],
+                [
+                    380,
+                    176,
+                    3143
+                ],
+                [
+                    380,
+                    177,
+                    3204
+                ],
+                [
+                    380,
+                    178,
+                    3266
+                ]
+            ],
+            [
+                [
+                    386,
+                    66,
+                    4292
+                ],
+                [
+                    383,
+                    68,
+                    4355
+                ],
+                [
+                    380,
+                    71,
+                    4386
+                ],
+                [
+                    374,
+                    78,
+                    4391
+                ],
+                [
+                    366,
+                    85,
+                    4444
+                ],
+                [
+                    360,
+                    88,
+                    4445
+                ],
+                [
+                    357,
+                    91,
+                    4446
+                ],
+                [
+                    346,
+                    97,
+                    4505
+                ],
+                [
+                    345,
+                    98,
+                    4506
+                ],
+                [
+                    328,
+                    105,
+                    4565
+                ],
+                [
+                    323,
+                    108,
+                    4566
+                ],
+                [
+                    321,
+                    109,
+                    4626
+                ],
+                [
+                    322,
+                    108,
+                    4959
+                ]
+            ],
+            [
+                [
+                    382,
+                    63,
+                    5579
+                ],
+                [
+                    383,
+                    64,
+                    5630
+                ],
+                [
+                    385,
+                    67,
+                    5631
+                ],
+                [
+                    387,
+                    71,
+                    5692
+                ],
+                [
+                    391,
+                    80,
+                    5693
+                ],
+                [
+                    394,
+                    85,
+                    5695
+                ],
+                [
+                    397,
+                    90,
+                    5750
+                ],
+                [
+                    403,
+                    99,
+                    5751
+                ],
+                [
+                    407,
+                    102,
+                    5811
+                ],
+                [
+                    416,
+                    108,
+                    5812
+                ],
+                [
+                    417,
+                    110,
+                    5815
+                ],
+                [
+                    424,
+                    114,
+                    5872
+                ],
+                [
+                    427,
+                    115,
+                    5873
+                ],
+                [
+                    433,
+                    118,
+                    5935
+                ],
+                [
+                    436,
+                    121,
+                    5936
+                ],
+                [
+                    439,
+                    123,
+                    5997
+                ],
+                [
+                    440,
+                    123,
+                    6111
+                ]
+            ],
+            [
+                [
+                    321,
+                    131,
+                    7508
+                ],
+                [
+                    323,
+                    131,
+                    7590
+                ],
+                [
+                    325,
+                    131,
+                    7611
+                ],
+                [
+                    341,
+                    131,
+                    7661
+                ],
+                [
+                    369,
+                    133,
+                    7662
+                ],
+                [
+                    387,
+                    134,
+                    7723
+                ],
+                [
+                    397,
+                    135,
+                    7723
+                ],
+                [
+                    404,
+                    135,
+                    7784
+                ],
+                [
+                    406,
+                    135,
+                    7785
+                ],
+                [
+                    407,
+                    135,
+                    7880
+                ],
+                [
+                    408,
+                    135,
+                    8103
+                ],
+                [
+                    409,
+                    135,
+                    8147
+                ],
+                [
+                    410,
+                    135,
+                    8148
+                ],
+                [
+                    414,
+                    135,
+                    8208
+                ],
+                [
+                    416,
+                    135,
+                    8271
+                ],
+                [
+                    418,
+                    135,
+                    8330
+                ],
+                [
+                    419,
+                    135,
+                    8330
+                ],
+                [
+                    421,
+                    135,
+                    8391
+                ],
+                [
+                    422,
+                    135,
+                    8453
+                ],
+                [
+                    423,
+                    135,
+                    8456
+                ],
+                [
+                    424,
+                    135,
+                    8516
+                ],
+                [
+                    425,
+                    135,
+                    8519
+                ],
+                [
+                    426,
+                    135,
+                    8735
+                ]
+            ]
+        ],
+        ".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
+    },
+    "0x8a9e": {
+        ".COORD": [
+            "X",
+            "Y",
+            "T"
+        ],
+        ".HIERARCHY": "CHARACTER",
+        ".PEN": [
+            [
+                [
+                    513,
+                    47,
+                    0
+                ],
+                [
+                    514,
+                    47,
+                    83
+                ],
+                [
+                    515,
+                    47,
+                    106
+                ],
+                [
+                    517,
+                    47,
+                    148
+                ],
+                [
+                    524,
+                    48,
+                    149
+                ],
+                [
+                    531,
+                    48,
+                    209
+                ],
+                [
+                    538,
+                    49,
+                    210
+                ],
+                [
+                    542,
+                    49,
+                    210
+                ],
+                [
+                    548,
+                    50,
+                    276
+                ],
+                [
+                    556,
+                    51,
+                    276
+                ],
+                [
+                    557,
+                    51,
+                    331
+                ],
+                [
+                    559,
+                    51,
+                    398
+                ],
+                [
+                    563,
+                    51,
+                    399
+                ]
+            ],
+            [
+                [
+                    509,
+                    76,
+                    1311
+                ],
+                [
+                    510,
+                    76,
+                    1365
+                ],
+                [
+                    512,
+                    76,
+                    1395
+                ],
+                [
+                    519,
+                    75,
+                    1396
+                ],
+                [
+                    522,
+                    75,
+                    1450
+                ],
+                [
+                    526,
+                    74,
+                    1451
+                ],
+                [
+                    530,
+                    74,
+                    1451
+                ],
+                [
+                    536,
+                    74,
+                    1511
+                ],
+                [
+                    545,
+                    74,
+                    1511
+                ],
+                [
+                    547,
+                    74,
+                    1514
+                ],
+                [
+                    552,
+                    74,
+                    1572
+                ],
+                [
+                    554,
+                    74,
+                    1633
+                ],
+                [
+                    557,
+                    74,
+                    1634
+                ],
+                [
+                    559,
+                    74,
+                    1694
+                ],
+                [
+                    560,
+                    73,
+                    1695
+                ],
+                [
+                    561,
+                    73,
+                    1834
+                ],
+                [
+                    562,
+                    73,
+                    1875
+                ],
+                [
+                    563,
+                    73,
+                    1876
+                ],
+                [
+                    564,
+                    73,
+                    1935
+                ]
+            ],
+            [
+                [
+                    509,
+                    97,
+                    4408
+                ],
+                [
+                    510,
+                    97,
+                    4480
+                ],
+                [
+                    514,
+                    96,
+                    4483
+                ],
+                [
+                    518,
+                    96,
+                    4512
+                ],
+                [
+                    526,
+                    96,
+                    4569
+                ],
+                [
+                    528,
+                    96,
+                    4570
+                ],
+                [
+                    538,
+                    95,
+                    4629
+                ],
+                [
+                    551,
+                    95,
+                    4630
+                ],
+                [
+                    554,
+                    95,
+                    4689
+                ],
+                [
+                    556,
+                    95,
+                    4690
+                ],
+                [
+                    557,
+                    95,
+                    4752
+                ],
+                [
+                    558,
+                    95,
+                    4811
+                ],
+                [
+                    559,
+                    95,
+                    4811
+                ],
+                [
+                    560,
+                    94,
+                    4875
+                ],
+                [
+                    561,
+                    94,
+                    4877
+                ],
+                [
+                    562,
+                    94,
+                    4937
+                ]
+            ],
+            [
+                [
+                    512,
+                    120,
+                    8559
+                ],
+                [
+                    512,
+                    121,
+                    8626
+                ],
+                [
+                    512,
+                    123,
+                    8651
+                ],
+                [
+                    512,
+                    126,
+                    8722
+                ],
+                [
+                    512,
+                    132,
+                    8723
+                ],
+                [
+                    512,
+                    140,
+                    8784
+                ],
+                [
+                    511,
+                    142,
+                    8786
+                ],
+                [
+                    510,
+                    146,
+                    8787
+                ],
+                [
+                    509,
+                    148,
+                    8843
+                ],
+                [
+                    508,
+                    152,
+                    8844
+                ],
+                [
+                    508,
+                    157,
+                    8904
+                ],
+                [
+                    508,
+                    161,
+                    8905
+                ],
+                [
+                    508,
+                    162,
+                    8967
+                ],
+                [
+                    507,
+                    162,
+                    8969
+                ]
+            ],
+            [
+                [
+                    510,
+                    119,
+                    9777
+                ],
+                [
+                    513,
+                    117,
+                    9846
+                ],
+                [
+                    514,
+                    116,
+                    9847
+                ],
+                [
+                    518,
+                    116,
+                    9851
+                ],
+                [
+                    522,
+                    116,
+                    9907
+                ],
+                [
+                    532,
+                    116,
+                    9908
+                ],
+                [
+                    540,
+                    116,
+                    9969
+                ],
+                [
+                    542,
+                    116,
+                    9971
+                ],
+                [
+                    544,
+                    116,
+                    10036
+                ],
+                [
+                    545,
+                    116,
+                    10090
+                ],
+                [
+                    546,
+                    116,
+                    10151
+                ],
+                [
+                    547,
+                    116,
+                    10154
+                ],
+                [
+                    548,
+                    116,
+                    10214
+                ],
+                [
+                    551,
+                    118,
+                    10220
+                ],
+                [
+                    552,
+                    118,
+                    10273
+                ],
+                [
+                    553,
+                    119,
+                    10274
+                ],
+                [
+                    554,
+                    119,
+                    10274
+                ],
+                [
+                    556,
+                    120,
+                    10334
+                ],
+                [
+                    557,
+                    120,
+                    10398
+                ],
+                [
+                    558,
+                    121,
+                    10456
+                ],
+                [
+                    559,
+                    121,
+                    10457
+                ],
+                [
+                    560,
+                    121,
+                    10524
+                ],
+                [
+                    560,
+                    124,
+                    10576
+                ],
+                [
+                    561,
+                    126,
+                    10578
+                ],
+                [
+                    561,
+                    128,
+                    10638
+                ],
+                [
+                    561,
+                    133,
+                    10639
+                ],
+                [
+                    561,
+                    138,
+                    10698
+                ],
+                [
+                    561,
+                    144,
+                    10699
+                ],
+                [
+                    560,
+                    147,
+                    10761
+                ],
+                [
+                    558,
+                    152,
+                    10763
+                ],
+                [
+                    558,
+                    153,
+                    10765
+                ],
+                [
+                    558,
+                    155,
+                    10818
+                ],
+                [
+                    558,
+                    158,
+                    10819
+                ],
+                [
+                    558,
+                    161,
+                    10881
+                ],
+                [
+                    558,
+                    162,
+                    10941
+                ],
+                [
+                    558,
+                    164,
+                    10942
+                ]
+            ],
+            [
+                [
+                    507,
+                    164,
+                    11623
+                ],
+                [
+                    508,
+                    164,
+                    11682
+                ],
+                [
+                    510,
+                    164,
+                    11701
+                ],
+                [
+                    512,
+                    163,
+                    11706
+                ],
+                [
+                    517,
+                    163,
+                    11761
+                ],
+                [
+                    520,
+                    163,
+                    11762
+                ],
+                [
+                    527,
+                    162,
+                    11763
+                ],
+                [
+                    532,
+                    162,
+                    11821
+                ],
+                [
+                    536,
+                    161,
+                    11822
+                ],
+                [
+                    537,
+                    161,
+                    11882
+                ],
+                [
+                    538,
+                    161,
+                    11883
+                ],
+                [
+                    541,
+                    161,
+                    11943
+                ],
+                [
+                    543,
+                    161,
+                    11944
+                ],
+                [
+                    544,
+                    161,
+                    12010
+                ],
+                [
+                    548,
+                    161,
+                    12012
+                ],
+                [
+                    550,
+                    161,
+                    12067
+                ],
+                [
+                    552,
+                    161,
+                    12069
+                ],
+                [
+                    554,
+                    161,
+                    12126
+                ],
+                [
+                    555,
+                    161,
+                    12188
+                ],
+                [
+                    556,
+                    161,
+                    12189
+                ],
+                [
+                    559,
+                    161,
+                    12251
+                ],
+                [
+                    560,
+                    161,
+                    12259
+                ],
+                [
+                    562,
+                    161,
+                    12313
+                ],
+                [
+                    563,
+                    161,
+                    12373
+                ]
+            ],
+            [
+                [
+                    600,
+                    48,
+                    18967
+                ],
+                [
+                    601,
+                    48,
+                    19050
+                ],
+                [
+                    605,
+                    48,
+                    19082
+                ],
+                [
+                    607,
+                    48,
+                    19140
+                ],
+                [
+                    610,
+                    48,
+                    19141
+                ],
+                [
+                    620,
+                    48,
+                    19199
+                ],
+                [
+                    638,
+                    48,
+                    19200
+                ],
+                [
+                    651,
+                    48,
+                    19260
+                ],
+                [
+                    658,
+                    49,
+                    19261
+                ],
+                [
+                    668,
+                    51,
+                    19321
+                ],
+                [
+                    673,
+                    51,
+                    19321
+                ],
+                [
+                    674,
+                    51,
+                    19322
+                ],
+                [
+                    676,
+                    51,
+                    19382
+                ],
+                [
+                    683,
+                    51,
+                    19383
+                ],
+                [
+                    688,
+                    51,
+                    19387
+                ],
+                [
+                    692,
+                    50,
+                    19444
+                ],
+                [
+                    696,
+                    50,
+                    19446
+                ],
+                [
+                    697,
+                    49,
+                    19451
+                ],
+                [
+                    699,
+                    49,
+                    19503
+                ],
+                [
+                    701,
+                    49,
+                    19504
+                ],
+                [
+                    706,
+                    48,
+                    19563
+                ],
+                [
+                    708,
+                    48,
+                    19564
+                ],
+                [
+                    709,
+                    48,
+                    19631
+                ],
+                [
+                    710,
+                    48,
+                    19636
+                ],
+                [
+                    711,
+                    48,
+                    19687
+                ]
+            ],
+            [
+                [
+                    624,
+                    44,
+                    21231
+                ],
+                [
+                    624,
+                    45,
+                    21296
+                ],
+                [
+                    624,
+                    49,
+                    21297
+                ],
+                [
+                    624,
+                    51,
+                    21356
+                ],
+                [
+                    624,
+                    59,
+                    21357
+                ],
+                [
+                    624,
+                    60,
+                    21362
+                ],
+                [
+                    624,
+                    65,
+                    21416
+                ],
+                [
+                    624,
+                    66,
+                    21417
+                ],
+                [
+                    624,
+                    71,
+                    21477
+                ],
+                [
+                    624,
+                    73,
+                    21539
+                ],
+                [
+                    624,
+                    76,
+                    21599
+                ],
+                [
+                    623,
+                    78,
+                    21600
+                ],
+                [
+                    623,
+                    79,
+                    21661
+                ]
+            ],
+            [
+                [
+                    621,
+                    78,
+                    23544
+                ],
+                [
+                    622,
+                    78,
+                    23699
+                ],
+                [
+                    623,
+                    78,
+                    23726
+                ],
+                [
+                    628,
+                    78,
+                    23731
+                ],
+                [
+                    630,
+                    78,
+                    23781
+                ],
+                [
+                    640,
+                    79,
+                    23782
+                ],
+                [
+                    643,
+                    79,
+                    23815
+                ],
+                [
+                    653,
+                    80,
+                    23845
+                ],
+                [
+                    661,
+                    80,
+                    23847
+                ],
+                [
+                    670,
+                    80,
+                    23903
+                ],
+                [
+                    676,
+                    79,
+                    23904
+                ],
+                [
+                    677,
+                    79,
+                    23979
+                ],
+                [
+                    678,
+                    79,
+                    24027
+                ],
+                [
+                    678,
+                    80,
+                    24307
+                ],
+                [
+                    678,
+                    81,
+                    24360
+                ],
+                [
+                    678,
+                    83,
+                    24362
+                ],
+                [
+                    677,
+                    88,
+                    24422
+                ],
+                [
+                    676,
+                    95,
+                    24423
+                ],
+                [
+                    676,
+                    96,
+                    24427
+                ],
+                [
+                    676,
+                    100,
+                    24484
+                ],
+                [
+                    676,
+                    104,
+                    24485
+                ],
+                [
+                    676,
+                    106,
+                    24490
+                ],
+                [
+                    676,
+                    108,
+                    24545
+                ],
+                [
+                    676,
+                    109,
+                    24546
+                ],
+                [
+                    676,
+                    111,
+                    24606
+                ],
+                [
+                    676,
+                    112,
+                    24606
+                ],
+                [
+                    676,
+                    113,
+                    24670
+                ],
+                [
+                    676,
+                    114,
+                    24675
+                ],
+                [
+                    676,
+                    116,
+                    24729
+                ],
+                [
+                    676,
+                    118,
+                    24789
+                ]
+            ],
+            [
+                [
+                    622,
+                    78,
+                    25560
+                ],
+                [
+                    622,
+                    79,
+                    25675
+                ],
+                [
+                    622,
+                    80,
+                    25703
+                ],
+                [
+                    622,
+                    83,
+                    25707
+                ],
+                [
+                    622,
+                    89,
+                    25759
+                ],
+                [
+                    622,
+                    95,
+                    25763
+                ],
+                [
+                    621,
+                    100,
+                    25822
+                ],
+                [
+                    621,
+                    105,
+                    25824
+                ],
+                [
+                    621,
+                    106,
+                    25827
+                ],
+                [
+                    620,
+                    110,
+                    25880
+                ],
+                [
+                    620,
+                    112,
+                    25881
+                ],
+                [
+                    620,
+                    113,
+                    25943
+                ],
+                [
+                    620,
+                    115,
+                    26002
+                ],
+                [
+                    620,
+                    116,
+                    26063
+                ]
+            ],
+            [
+                [
+                    592,
+                    116,
+                    27111
+                ],
+                [
+                    598,
+                    116,
+                    27189
+                ],
+                [
+                    620,
+                    116,
+                    27216
+                ],
+                [
+                    637,
+                    117,
+                    27275
+                ],
+                [
+                    654,
+                    118,
+                    27276
+                ],
+                [
+                    664,
+                    119,
+                    27337
+                ],
+                [
+                    674,
+                    120,
+                    27339
+                ],
+                [
+                    677,
+                    120,
+                    27397
+                ],
+                [
+                    683,
+                    120,
+                    27398
+                ],
+                [
+                    687,
+                    120,
+                    27458
+                ],
+                [
+                    688,
+                    120,
+                    27459
+                ],
+                [
+                    689,
+                    120,
+                    27518
+                ],
+                [
+                    692,
+                    120,
+                    27519
+                ],
+                [
+                    692,
+                    119,
+                    27579
+                ],
+                [
+                    696,
+                    119,
+                    27581
+                ],
+                [
+                    697,
+                    119,
+                    27639
+                ],
+                [
+                    698,
+                    119,
+                    27640
+                ],
+                [
+                    699,
+                    119,
+                    27708
+                ],
+                [
+                    700,
+                    119,
+                    27761
+                ]
+            ],
+            [
+                [
+                    616,
+                    126,
+                    30647
+                ],
+                [
+                    616,
+                    128,
+                    30740
+                ],
+                [
+                    616,
+                    132,
+                    30771
+                ],
+                [
+                    616,
+                    137,
+                    30831
+                ],
+                [
+                    616,
+                    143,
+                    30832
+                ],
+                [
+                    616,
+                    147,
+                    30835
+                ],
+                [
+                    616,
+                    149,
+                    30892
+                ],
+                [
+                    616,
+                    154,
+                    30893
+                ],
+                [
+                    616,
+                    158,
+                    30951
+                ],
+                [
+                    616,
+                    160,
+                    30952
+                ],
+                [
+                    616,
+                    163,
+                    31012
+                ],
+                [
+                    616,
+                    166,
+                    31013
+                ],
+                [
+                    616,
+                    167,
+                    31073
+                ],
+                [
+                    615,
+                    168,
+                    31074
+                ],
+                [
+                    615,
+                    170,
+                    31136
+                ],
+                [
+                    615,
+                    171,
+                    31196
+                ],
+                [
+                    615,
+                    172,
+                    31323
+                ]
+            ],
+            [
+                [
+                    614,
+                    127,
+                    32047
+                ],
+                [
+                    620,
+                    126,
+                    32108
+                ],
+                [
+                    630,
+                    125,
+                    32138
+                ],
+                [
+                    640,
+                    125,
+                    32200
+                ],
+                [
+                    645,
+                    125,
+                    32202
+                ],
+                [
+                    648,
+                    125,
+                    32265
+                ],
+                [
+                    653,
+                    125,
+                    32320
+                ],
+                [
+                    655,
+                    125,
+                    32321
+                ],
+                [
+                    658,
+                    125,
+                    32322
+                ],
+                [
+                    659,
+                    125,
+                    32381
+                ],
+                [
+                    667,
+                    127,
+                    32382
+                ],
+                [
+                    670,
+                    127,
+                    32442
+                ],
+                [
+                    672,
+                    127,
+                    32442
+                ],
+                [
+                    675,
+                    128,
+                    32504
+                ],
+                [
+                    676,
+                    128,
+                    32505
+                ],
+                [
+                    677,
+                    128,
+                    32564
+                ],
+                [
+                    678,
+                    128,
+                    32625
+                ],
+                [
+                    679,
+                    128,
+                    32686
+                ],
+                [
+                    680,
+                    129,
+                    32755
+                ],
+                [
+                    680,
+                    131,
+                    32808
+                ],
+                [
+                    680,
+                    132,
+                    32809
+                ],
+                [
+                    679,
+                    136,
+                    32868
+                ],
+                [
+                    677,
+                    143,
+                    32869
+                ],
+                [
+                    675,
+                    152,
+                    32929
+                ],
+                [
+                    675,
+                    156,
+                    32930
+                ],
+                [
+                    675,
+                    157,
+                    32991
+                ],
+                [
+                    674,
+                    161,
+                    32992
+                ],
+                [
+                    674,
+                    167,
+                    33051
+                ],
+                [
+                    674,
+                    170,
+                    33052
+                ],
+                [
+                    674,
+                    171,
+                    33113
+                ],
+                [
+                    674,
+                    172,
+                    33114
+                ],
+                [
+                    674,
+                    173,
+                    33173
+                ],
+                [
+                    674,
+                    174,
+                    33174
+                ],
+                [
+                    674,
+                    175,
+                    33238
+                ],
+                [
+                    674,
+                    176,
+                    33242
+                ],
+                [
+                    673,
+                    176,
+                    33386
+                ]
+            ],
+            [
+                [
+                    617,
+                    172,
+                    34039
+                ],
+                [
+                    618,
+                    171,
+                    34117
+                ],
+                [
+                    621,
+                    170,
+                    34146
+                ],
+                [
+                    622,
+                    170,
+                    34147
+                ],
+                [
+                    630,
+                    169,
+                    34206
+                ],
+                [
+                    637,
+                    169,
+                    34207
+                ],
+                [
+                    641,
+                    168,
+                    34212
+                ],
+                [
+                    649,
+                    168,
+                    34271
+                ],
+                [
+                    653,
+                    168,
+                    34272
+                ],
+                [
+                    660,
+                    168,
+                    34275
+                ],
+                [
+                    662,
+                    168,
+                    34327
+                ],
+                [
+                    664,
+                    168,
+                    34389
+                ],
+                [
+                    667,
+                    168,
+                    34391
+                ],
+                [
+                    668,
+                    168,
+                    34448
+                ],
+                [
+                    669,
+                    169,
+                    34449
+                ],
+                [
+                    670,
+                    170,
+                    34509
+                ],
+                [
+                    672,
+                    171,
+                    34510
+                ],
+                [
+                    674,
+                    171,
+                    34571
+                ],
+                [
+                    675,
+                    172,
+                    34632
+                ],
+                [
+                    676,
+                    172,
+                    34811
+                ]
+            ]
+        ],
+        ".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 38b80c0a..d3312f76 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: "ja_JP", initInputMode: "JapaneseHandwriting", inputSequence: "\u65E5\u672C\u8A9E", outputText: "\u65E5\u672C\u8A9E" },
                 { 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/japanese/26085_100_0.txt b/tests/auto/inputpanel/hwr_test_data/japanese/26085_100_0.txt
new file mode 100644
index 00000000..57dbf06f
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/japanese/26085_100_0.txt
@@ -0,0 +1,94 @@
+.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
+113 59 0
+113 64 56
+113 71 86
+113 78 92
+113 85 148
+113 95 149
+113 109 212
+111 127 213
+111 131 268
+111 143 269
+110 150 330
+109 156 331
+109 160 391
+109 164 392
+109 167 453
+109 170 455
+109 171 512
+109 172 513
+109 173 516
+109 175 573
+109 177 634
+109 178 636
+110 179 698
+110 180 701
+.PEN_UP
+.PEN_DOWN
+116 58 1545
+117 58 1612
+130 57 1640
+153 58 1699
+165 59 1700
+187 60 1764
+195 62 1766
+200 63 1820
+202 63 1821
+203 63 2004
+203 65 2061
+203 69 2061
+204 72 2124
+204 87 2125
+203 90 2183
+200 103 2185
+198 115 2188
+198 119 2248
+197 139 2248
+196 148 2304
+195 158 2307
+195 160 2308
+195 165 2364
+195 173 2365
+194 179 2425
+194 181 2426
+194 185 2427
+194 187 2485
+193 190 2486
+193 189 2740
+.PEN_UP
+.PEN_DOWN
+113 123 3457
+114 123 3517
+120 123 3545
+127 123 3547
+131 123 3610
+166 126 3611
+185 127 3669
+194 128 3670
+195 128 3731
+.PEN_UP
+.PEN_DOWN
+110 180 4616
+110 181 4683
+115 181 4701
+122 182 4765
+143 182 4765
+174 183 4820
+179 184 4821
+181 184 4824
+187 184 4882
+188 184 4972
+190 184 5036
+191 184 5096
+192 184 5098
+193 184 5157
+.PEN_UP
diff --git a/tests/auto/inputpanel/hwr_test_data/japanese/26412_100_0.txt b/tests/auto/inputpanel/hwr_test_data/japanese/26412_100_0.txt
new file mode 100644
index 00000000..2518d293
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/japanese/26412_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
+314 61 0
+315 61 71
+319 61 95
+329 61 154
+341 61 155
+355 61 215
+381 61 216
+398 60 277
+402 60 277
+413 60 279
+424 60 340
+436 61 342
+437 61 343
+443 61 398
+449 62 399
+452 63 462
+453 63 599
+452 62 871
+.PEN_UP
+.PEN_DOWN
+386 40 2172
+386 41 2327
+386 45 2351
+386 48 2415
+386 51 2418
+386 54 2423
+386 60 2479
+384 69 2480
+384 72 2537
+384 89 2539
+383 102 2596
+382 113 2597
+382 117 2599
+381 123 2657
+380 130 2658
+380 135 2718
+380 143 2718
+380 147 2779
+380 151 2780
+380 157 2840
+380 162 2841
+380 163 2900
+380 165 2901
+380 168 2968
+380 170 2970
+380 173 3021
+380 174 3082
+380 175 3087
+380 176 3143
+380 177 3204
+380 178 3266
+.PEN_UP
+.PEN_DOWN
+386 66 4292
+383 68 4355
+380 71 4386
+374 78 4391
+366 85 4444
+360 88 4445
+357 91 4446
+346 97 4505
+345 98 4506
+328 105 4565
+323 108 4566
+321 109 4626
+322 108 4959
+.PEN_UP
+.PEN_DOWN
+382 63 5579
+383 64 5630
+385 67 5631
+387 71 5692
+391 80 5693
+394 85 5695
+397 90 5750
+403 99 5751
+407 102 5811
+416 108 5812
+417 110 5815
+424 114 5872
+427 115 5873
+433 118 5935
+436 121 5936
+439 123 5997
+440 123 6111
+.PEN_UP
+.PEN_DOWN
+321 131 7508
+323 131 7590
+325 131 7611
+341 131 7661
+369 133 7662
+387 134 7723
+397 135 7723
+404 135 7784
+406 135 7785
+407 135 7880
+408 135 8103
+409 135 8147
+410 135 8148
+414 135 8208
+416 135 8271
+418 135 8330
+419 135 8330
+421 135 8391
+422 135 8453
+423 135 8456
+424 135 8516
+425 135 8519
+426 135 8735
+.PEN_UP
diff --git a/tests/auto/inputpanel/hwr_test_data/japanese/35486_100_0.txt b/tests/auto/inputpanel/hwr_test_data/japanese/35486_100_0.txt
new file mode 100644
index 00000000..90293518
--- /dev/null
+++ b/tests/auto/inputpanel/hwr_test_data/japanese/35486_100_0.txt
@@ -0,0 +1,333 @@
+.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
+513 47 0
+514 47 83
+515 47 106
+517 47 148
+524 48 149
+531 48 209
+538 49 210
+542 49 210
+548 50 276
+556 51 276
+557 51 331
+559 51 398
+563 51 399
+.PEN_UP
+.PEN_DOWN
+509 76 1311
+510 76 1365
+512 76 1395
+519 75 1396
+522 75 1450
+526 74 1451
+530 74 1451
+536 74 1511
+545 74 1511
+547 74 1514
+552 74 1572
+554 74 1633
+557 74 1634
+559 74 1694
+560 73 1695
+561 73 1834
+562 73 1875
+563 73 1876
+564 73 1935
+.PEN_UP
+.PEN_DOWN
+509 97 4408
+510 97 4480
+514 96 4483
+518 96 4512
+526 96 4569
+528 96 4570
+538 95 4629
+551 95 4630
+554 95 4689
+556 95 4690
+557 95 4752
+558 95 4811
+559 95 4811
+560 94 4875
+561 94 4877
+562 94 4937
+.PEN_UP
+.PEN_DOWN
+512 120 8559
+512 121 8626
+512 123 8651
+512 126 8722
+512 132 8723
+512 140 8784
+511 142 8786
+510 146 8787
+509 148 8843
+508 152 8844
+508 157 8904
+508 161 8905
+508 162 8967
+507 162 8969
+.PEN_UP
+.PEN_DOWN
+510 119 9777
+513 117 9846
+514 116 9847
+518 116 9851
+522 116 9907
+532 116 9908
+540 116 9969
+542 116 9971
+544 116 10036
+545 116 10090
+546 116 10151
+547 116 10154
+548 116 10214
+551 118 10220
+552 118 10273
+553 119 10274
+554 119 10274
+556 120 10334
+557 120 10398
+558 121 10456
+559 121 10457
+560 121 10524
+560 124 10576
+561 126 10578
+561 128 10638
+561 133 10639
+561 138 10698
+561 144 10699
+560 147 10761
+558 152 10763
+558 153 10765
+558 155 10818
+558 158 10819
+558 161 10881
+558 162 10941
+558 164 10942
+.PEN_UP
+.PEN_DOWN
+507 164 11623
+508 164 11682
+510 164 11701
+512 163 11706
+517 163 11761
+520 163 11762
+527 162 11763
+532 162 11821
+536 161 11822
+537 161 11882
+538 161 11883
+541 161 11943
+543 161 11944
+544 161 12010
+548 161 12012
+550 161 12067
+552 161 12069
+554 161 12126
+555 161 12188
+556 161 12189
+559 161 12251
+560 161 12259
+562 161 12313
+563 161 12373
+.PEN_UP
+.PEN_DOWN
+600 48 18967
+601 48 19050
+605 48 19082
+607 48 19140
+610 48 19141
+620 48 19199
+638 48 19200
+651 48 19260
+658 49 19261
+668 51 19321
+673 51 19321
+674 51 19322
+676 51 19382
+683 51 19383
+688 51 19387
+692 50 19444
+696 50 19446
+697 49 19451
+699 49 19503
+701 49 19504
+706 48 19563
+708 48 19564
+709 48 19631
+710 48 19636
+711 48 19687
+.PEN_UP
+.PEN_DOWN
+624 44 21231
+624 45 21296
+624 49 21297
+624 51 21356
+624 59 21357
+624 60 21362
+624 65 21416
+624 66 21417
+624 71 21477
+624 73 21539
+624 76 21599
+623 78 21600
+623 79 21661
+.PEN_UP
+.PEN_DOWN
+621 78 23544
+622 78 23699
+623 78 23726
+628 78 23731
+630 78 23781
+640 79 23782
+643 79 23815
+653 80 23845
+661 80 23847
+670 80 23903
+676 79 23904
+677 79 23979
+678 79 24027
+678 80 24307
+678 81 24360
+678 83 24362
+677 88 24422
+676 95 24423
+676 96 24427
+676 100 24484
+676 104 24485
+676 106 24490
+676 108 24545
+676 109 24546
+676 111 24606
+676 112 24606
+676 113 24670
+676 114 24675
+676 116 24729
+676 118 24789
+.PEN_UP
+.PEN_DOWN
+622 78 25560
+622 79 25675
+622 80 25703
+622 83 25707
+622 89 25759
+622 95 25763
+621 100 25822
+621 105 25824
+621 106 25827
+620 110 25880
+620 112 25881
+620 113 25943
+620 115 26002
+620 116 26063
+.PEN_UP
+.PEN_DOWN
+592 116 27111
+598 116 27189
+620 116 27216
+637 117 27275
+654 118 27276
+664 119 27337
+674 120 27339
+677 120 27397
+683 120 27398
+687 120 27458
+688 120 27459
+689 120 27518
+692 120 27519
+692 119 27579
+696 119 27581
+697 119 27639
+698 119 27640
+699 119 27708
+700 119 27761
+.PEN_UP
+.PEN_DOWN
+616 126 30647
+616 128 30740
+616 132 30771
+616 137 30831
+616 143 30832
+616 147 30835
+616 149 30892
+616 154 30893
+616 158 30951
+616 160 30952
+616 163 31012
+616 166 31013
+616 167 31073
+615 168 31074
+615 170 31136
+615 171 31196
+615 172 31323
+.PEN_UP
+.PEN_DOWN
+614 127 32047
+620 126 32108
+630 125 32138
+640 125 32200
+645 125 32202
+648 125 32265
+653 125 32320
+655 125 32321
+658 125 32322
+659 125 32381
+667 127 32382
+670 127 32442
+672 127 32442
+675 128 32504
+676 128 32505
+677 128 32564
+678 128 32625
+679 128 32686
+680 129 32755
+680 131 32808
+680 132 32809
+679 136 32868
+677 143 32869
+675 152 32929
+675 156 32930
+675 157 32991
+674 161 32992
+674 167 33051
+674 170 33052
+674 171 33113
+674 172 33114
+674 173 33173
+674 174 33174
+674 175 33238
+674 176 33242
+673 176 33386
+.PEN_UP
+.PEN_DOWN
+617 172 34039
+618 171 34117
+621 170 34146
+622 170 34147
+630 169 34206
+637 169 34207
+641 168 34212
+649 168 34271
+653 168 34272
+660 168 34275
+662 168 34327
+664 168 34389
+667 168 34391
+668 168 34448
+669 169 34449
+670 170 34509
+672 171 34510
+674 171 34571
+675 172 34632
+676 172 34811
+.PEN_UP
-- 
GitLab