Deployment
Package contents
The release archive contains:
LNVK/
├── bin/
│ └── lndict-compiler (dictionary compiler utility)
├── include/lnvk/
│ └── lnvk.h (#include <lnvk>)
├── integration/
│ ├── LNVKConfig.cmake
│ └── lnvirtualkeyboard.pri
├── qml/Ln/VirtualKeyboard/
│ ├── liblnvirtualkeyboardplugin.so
│ └── qmldir
├── share/lnvirtualkeyboard/dictionaries/
│ ├── *.trie # IME dictionaries
│ ├── *.pred # word prediction
│ ├── *.bigram # bigram language models
│ ├── *.prism # Pinyin prism
│ └── *.mtx # connection cost matrix
├── share/lnvirtualkeyboard/fonts/
│ ├── Inter-Variable.ttf
│ ├── NotoSans*.ttf
│ └── NotoSansCJK*.otf
└── share/lnvirtualkeyboard/licenses/
├── OFL.txt
├── fonts-NOTICE.md
├── dictionaries-NOTICE.md
└── (other third-party license texts)
Install footprint
On-disk sizes for a Release build. Dictionary files are memory-mapped at runtime; they do not add to the keyboard's heap footprint while idle.
| Component | On-disk size |
|---|---|
| QML plugin | ~910 KiB |
| All dictionary binaries | ~80.5 MiB |
English only (en) | ~1021 KiB |
Japanese (ja, ja-12key) | ~15.1 MiB |
Chinese Simplified (zh-Hans) | ~7.8 MiB |
Pass LANGUAGES to ln_virtual_keyboard_deploy or LNVK_LANGUAGES in qmake to ship only the dictionaries each active language needs (see Selecting languages below). Per-language profile and file lists: Languages.
Layouts, themes, and QML components are embedded inside the shared library via resources.qrc. Bundled keyboard fonts are optional: they ship as separate .ttf / .otf files under share/lnvirtualkeyboard/fonts/ and are registered at plugin load when that directory is present. The keyboard runs without them and falls back to fonts you provide.
Third-party licensing
The release bundles third-party fonts (share/lnvirtualkeyboard/fonts/) and dictionary data (share/lnvirtualkeyboard/dictionaries/). Full license texts and attribution NOTICEs ship under share/lnvirtualkeyboard/licenses/. If you redistribute the bundled fonts or dictionaries, ship those license files alongside them.
Fonts (optional)
Bundled fonts are a convenience, not a requirement. If FontPaths finds no font directory at plugin load, registration is skipped and the keyboard continues normally; there is no startup error.
When present, the plugin registers them with QFontDatabase::addApplicationFont during plugin initialization.
Using your own fonts instead of bundled discovery: call FontPaths::setHostFontFiles before engine.load().
#include <lnvk>
lenewt::FontPaths::setHostFontFiles({
"/opt/myapp/fonts/Inter-Variable.ttf",
"/opt/myapp/fonts/NotoSansArabic-Regular.ttf",
"/opt/myapp/fonts/NotoSansCJKsc-Regular.otf",
});
When setHostFontFiles is called, bundled directory discovery (LNVK_FONTS_DIR, install prefix, etc.) is not used: the host list is the sole source.
QML binds the resolved family read-only: font.family: Lnvk.effectiveFontFamily.
Font family resolution order:
- Per-script Noto/Inter family for the active language if that family is registered
Interfor Latin if availableQGuiApplication::font()if it covers the active writing system- Empty string → Qt platform default
If you redistribute the bundled font files, include OFL.txt and fonts-NOTICE.md.
Dictionary data
Compiled dictionaries derive from the open data sources below. Per-artifact attribution is in dictionaries-NOTICE.md.
| Source | License | Used in |
|---|---|---|
| Unicode Unihan database | Unicode License v3 | pinyin*.trie, cangjie*.trie, zhuyin.trie, japanese.trie |
| CC-CEDICT | CC BY-SA 3.0 | pinyin.trie, pinyin-hant.trie |
| FrequencyWords (OpenSubtitles 2018) | CC BY-SA 4.0 | All prediction-*.pred, transliteration tries, bigram-*.bigram |
| Kannada Wikipedia titles | CC BY-SA 4.0 | transliteration-kn.trie, bigram-kn.bigram |
| rime-essay | LGPL-3.0 | Chinese frequency statistics (rankings only) |
| mecab-ipadic 2.7.0 | NAIST License | japanese.trie (fallback), matrix-ja.mtx |
| Mozc OSS dictionary | BSD 3-Clause + NAIST | japanese.trie (preferred), matrix-ja.mtx |
Dictionary data files that incorporate CC BY-SA inputs are distributed under CC BY-SA 4.0. This applies only to the data files, not to the plugin code or to applications that load the dictionaries at runtime.
Building custom prediction dictionaries
The package includes bin/lndict-compiler so you can generate .pred files without rebuilding the project.
# From your LNVK package root
./bin/lndict-compiler --flat my-words.txt prediction-en-custom.pred
--flat accepts one-word-per-line text files or TSV with explicit frequency (word<TAB>word<TAB>frequency).
Deploy resulting .pred files into share/lnvirtualkeyboard/dictionaries/ and configure custom prediction mode in your app. See the Configuration guide.
CMake integration
Add the release directory to CMAKE_PREFIX_PATH and use find_package:
cmake_minimum_required(VERSION 3.16)
project(MyApp LANGUAGES CXX)
find_package(Qt6 REQUIRED COMPONENTS Quick)
find_package(LNVK REQUIRED)
add_executable(myapp main.cpp)
target_link_libraries(myapp PRIVATE Qt6::Quick)
ln_virtual_keyboard_deploy(myapp)
ln_virtual_keyboard_deploy(myapp FONTS)
ln_virtual_keyboard_deploy(myapp LANGUAGES en fr FONTS)
ln_virtual_keyboard_deploy copies the QML plugin and dictionaries next to your application binary at build time:
<app_dir>/../qml/Ln/VirtualKeyboard/
liblnvirtualkeyboardplugin.*
qmldir
<app_dir>/../share/lnvirtualkeyboard/dictionaries/
(dictionary files)
<app_dir>/../share/lnvirtualkeyboard/fonts/ (optional, when FONTS is passed)
Fonts are optional: pass FONTS to copy share/lnvirtualkeyboard/fonts/, or call FontPaths::setHostFontFiles from C++.
cmake -B build -DCMAKE_PREFIX_PATH="/path/to/LNVK"
cmake --build build
Selecting languages
By default all dictionaries are deployed. Deploy only specific languages:
ln_virtual_keyboard_deploy(myapp LANGUAGES en fr)
qmake integration
Include the .pri file from your .pro:
include(/path/to/LNVK/integration/lnvirtualkeyboard.pri)
This copies the QML plugin and dictionaries to the build output directory.
To deploy only specific languages:
LNVK_LANGUAGES = en fr
include(/path/to/LNVK/integration/lnvirtualkeyboard.pri)
Optional bundled fonts:
LNVK_DEPLOY_FONTS = 1
include(/path/to/LNVK/integration/lnvirtualkeyboard.pri)
Otherwise register fonts from C++ with FontPaths::setHostFontFiles.
Manual deployment
Plugin files
Copy Ln/VirtualKeyboard/ so the QML engine can find it:
- Qt's QML import path: copy
Ln/into your Qt installation'sqml/directory. - Custom location: place
Ln/anywhere and pointQML2_IMPORT_PATHto its parent:
export QML2_IMPORT_PATH=/opt/myapp/lib/qml
# Plugin must be at /opt/myapp/lib/qml/Ln/VirtualKeyboard/
Dictionary search order
The plugin searches for dictionary files relative to your application binary, in order:
LNVK_DICT_DIRenvironment variable: directory containing the requested file (for exampleprediction-en.pred)- Compile-time
LNVK_DICT_DIR: set when the plugin is built/installed with a fixed prefix <app_dir>/../share/lnvirtualkeyboard/dictionaries/<file><app_dir>/../data/dictionaries/<file><app_dir>/data/dictionaries/<file>
Font files (optional)
If you use the bundled fonts, copy share/lnvirtualkeyboard/fonts/ next to your app:
<app_dir>/../share/lnvirtualkeyboard/fonts/
Inter-Variable.ttf
NotoSans*.ttf
NotoSansCJK*.otf
Or point LNVK_FONTS_DIR at any directory containing those files. FontPaths search order when auto-locating bundled fonts:
LNVK_FONTS_DIRenvironment variable- Compile-time
LNVK_FONTS_DIR <app_dir>/../share/lnvirtualkeyboard/fonts/<app_dir>/../fonts/<app_dir>/fonts/- Walk up from
<app_dir>looking for afonts/directory that containsInter-Variable.ttf
To use application fonts instead, skip this directory and call FontPaths::setHostFontFiles with your font file paths before plugin init.
Embedded deployment
A typical embedded filesystem layout:
/usr/lib/qml/Ln/VirtualKeyboard/
liblnvirtualkeyboardplugin.so
qmldir
/usr/share/lnvirtualkeyboard/dictionaries/
(selected dictionary files)
/usr/share/lnvirtualkeyboard/fonts/ (optional, omit if using app fonts)
Ensure the QML import path includes the parent of Ln/. If your binary is at /usr/bin/myapp, dictionaries resolve to /usr/share/lnvirtualkeyboard/dictionaries/. Set LNVK_FONTS_DIR only when using bundled fonts.
Qt version compatibility
The plugin targets Qt 5 and Qt 6. Use a build for Qt 5.15 through any Qt 6.x minor version. Older Qt 5 releases before 5.15 are supported on request.
Available language codes
Pass these codes to LANGUAGES (CMake) or LNVK_LANGUAGES (qmake) to ship only the dictionaries you need:
| Code | Language | Code | Language |
|---|---|---|---|
ar | Arabic | lv | Latvian |
be | Belarusian | mk | Macedonian |
bg | Bulgarian | mt | Maltese |
bn | Bengali | nb | Norwegian Bokmål |
bs | Bosnian | nl | Dutch |
ca | Catalan | pl | Polish |
cs | Czech | pt | Portuguese |
cy | Welsh | ro | Romanian |
da | Danish | ru | Russian |
de | German | sk | Slovak |
el | Greek | sl | Slovenian |
en | English | sq | Albanian |
es | Spanish | sr | Serbian |
et | Estonian | sv | Swedish |
fi | Finnish | ta | Tamil |
fr | French | te | Telugu |
ga | Irish | th | Thai |
gl | Galician | tr | Turkish |
he | Hebrew | uk | Ukrainian |
hi | Hindi (transliteration) | vi | Vietnamese |
hi-Deva | Hindi (Devanagari) | zh-Hans | Chinese Simplified (Pinyin) |
hr | Croatian | zh-Hant | Chinese Traditional (Pinyin) |
hu | Hungarian | zh-Hant-HK | Chinese Hong Kong (Cangjie) |
hy | Armenian | zh-Hant-TW | Chinese Taiwan (Zhuyin) |
is | Icelandic | ja | Japanese (Romaji) |
it | Italian | ja-12key | Japanese (12-key flick) |
ka | Georgian | ko | Korean |
kn | Kannada | lt | Lithuanian |