Advanced Deployment
Quick integration (CMake / qmake): Deployment. QML API after deploy: Quick Start.
Package contents
The release archive contains:
LNVK/
├── bin/ (optional tools, e.g. lndict-compiler)
├── include/lnvk/ (public C++ headers; #include <lnvk>)
├── lib/ (static liblnvk_ui_core.a, liblnvk_engine.a + their cmake/ package exports)
├── integration/
│ ├── LNVKConfig.cmake
│ ├── lnvirtualkeyboard.pri
│ └── dict-features.cmake
├── qml/Ln/VirtualKeyboard/
│ ├── liblnvirtualkeyboardplugin.so (.dll on Windows, .dylib on macOS)
│ ├── qmldir
│ ├── plugins.qmltypes (type info for qmlls / Qt Creator)
├── share/lnvirtualkeyboard/dictionaries/
│ ├── layouts.lnlay (keyboard layouts + input profiles — required)
│ ├── themes.lntheme (bundled dark/light themes — required)
│ ├── compressed/ (default storage tree; LNVK_DICT_STORAGE=compressed)
│ └── mmap/ (opt-in lower-memory tree; LNVK_DICT_STORAGE=mmap)
├── share/lnvirtualkeyboard/fonts/
│ ├── Inter-Variable.ttf
│ ├── NotoSans*.ttf (one font per script)
│ └── NotoSansCJK*.otf (Japanese, Korean, Simplified/Traditional Chinese)
└── share/lnvirtualkeyboard/licenses/
├── LICENSE (proprietary license text)
├── dictionaries-NOTICE.md (per-artifact dictionary attribution)
├── fonts-NOTICE.md (per-font attribution — when shipping bundled fonts)
├── OFL.txt
└── … (upstream license texts — CC BY, CC BY-SA, Unicode, BSD, NAIST, …)
C++ hosts call the Qt API through the QML plugin library (see API Reference — C++ API).
Install footprint
On-disk sizes for a Release build (approximate).
| Component | On-disk size |
|---|---|
| QML plugin | ~910 KiB |
layouts.lnlay | ~215 KiB |
themes.lntheme | ~104 B |
| All dictionary binaries | ~108 MiB |
Pass LANGUAGES to ln_virtual_keyboard_deploy or LNVK_LANGUAGES in qmake to ship only the data each active language needs (see Selecting languages). layouts.lnlay and themes.lntheme are always included when a language list is specified.
Dictionary storage and profiles
Binary dictionaries live under a storage subtree inside share/lnvirtualkeyboard/dictionaries/:
share/lnvirtualkeyboard/dictionaries/
├── layouts.lnlay
├── themes.lntheme
├── compressed/ # default on-disk layout (smaller download)
│ └── pinyin.trie …
└── mmap/ # optional lower-memory variants (larger files)
└── pinyin.trie …
| Knob | Values | Default | Effect |
|---|---|---|---|
LNVK_DICT_STORAGE | compressed | mmap | compressed | Subtree the language files are read from at runtime |
LNVK_DICT_PROFILE | full | standard | embedded | minimal | full | Deploy-time feature bundles (CMake LNVKConfig.cmake) |
LNVK_DICT_FEATURES | prediction, ngram, matrix, bigram | from profile | Omit specific families at deploy |
Set LNVK_DICT_STORAGE in the process environment before the plugin loads. layouts.lnlay and themes.lntheme always resolve from the dictionary root directory (LNVK_DICT_DIR).
Layouts and themes load from share/lnvirtualkeyboard/dictionaries/ at runtime. Bundled keyboard fonts are optional: see Fonts (optional).
Third-party licensing
The release bundles dictionary binaries (share/lnvirtualkeyboard/dictionaries/) and may bundle fonts (share/lnvirtualkeyboard/fonts/). License texts and attribution NOTICEs ship under share/lnvirtualkeyboard/licenses/. Deploy helpers always copy that licenses/ tree with dictionary data.
Dictionary data
The dictionary files under share/lnvirtualkeyboard/dictionaries/ incorporate third-party open data. If you redistribute these files (or ship them inside your product), copy the entire licenses/ directory and follow dictionaries-NOTICE.md plus the bundled upstream license texts. Files that incorporate CC BY-SA inputs are distributed under CC BY-SA 4.0; this applies to the data files only, not to the plugin code or to applications that merely load the dictionaries at runtime.
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(). Pass one file per script you support, the same set as under share/lnvirtualkeyboard/fonts/:
#include <lnvk>
lnvk::qt::FontPaths::setHostFontFiles({
"/opt/myapp/fonts/Inter-Variable.ttf",
"/opt/myapp/fonts/NotoSansCJKjp-Regular.otf",
"/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 (already used inside keyboard components).
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 from share/lnvirtualkeyboard/licenses/ (the deploy helper copies the full licenses/ tree; see Dictionary data).
Custom prediction dictionaries
See Configuration — Custom prediction dictionaries. The release may include bin/lndict-compiler to build .pred files without rebuilding LNVK.
Install layout
Deploy helpers copy QML and data under an install root. The plugin locates assets relative to QCoreApplication::applicationDirPath() (the directory containing your executable).
Install prefix (default)
Use when the binary lives in a bin/ subdirectory. This is the default for ln_virtual_keyboard_deploy() and lnvirtualkeyboard.pri.
<prefix>/
├── bin/myapp ← executable
├── qml/Ln/VirtualKeyboard/ ← plugin + qmldir
└── share/lnvirtualkeyboard/
├── dictionaries/ ← layouts.lnlay, themes.lntheme, per-language data
├── fonts/ ← optional
└── licenses/ ← ship when redistributing fonts or dictionary data
Runtime lookup (dictionaries): <app_dir>/../share/lnvirtualkeyboard/dictionaries/
QML import path: applicationDirPath() + "/../qml"
set_target_properties(myapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
ln_virtual_keyboard_deploy(myapp LANGUAGES en fr FONTS)
Flat prefix
Use when the binary sits directly under the install root (no bin/).
<prefix>/
├── myapp ← executable
├── qml/Ln/VirtualKeyboard/
└── share/lnvirtualkeyboard/
├── dictionaries/
├── fonts/ ← optional
└── licenses/
Runtime lookup (dictionaries): <app_dir>/share/lnvirtualkeyboard/dictionaries/
QML import path: applicationDirPath() + "/qml"
ln_virtual_keyboard_deploy(myapp PREFIX "$<TARGET_FILE_DIR:myapp>" LANGUAGES en fr FONTS)
qmake: set LNVK_DEPLOY_PREFIX = $$OUT_PWD before including lnvirtualkeyboard.pri.
Custom locations
If your tree does not match either layout, set absolute paths at runtime or in the environment:
| Asset | Override |
|---|---|
| Dictionaries | LNVK_DICT_DIR (must contain layouts.lnlay) |
| Fonts | LNVK_FONTS_DIR or FontPaths::setHostFontFiles() |
| QML plugin | QML2_IMPORT_PATH or engine.addImportPath(...) |
See Manual deployment for search order details.
CMake options
Full CMake example (same as the quick guide, with optional knobs):
cmake_minimum_required(VERSION 3.16)
project(MyApp LANGUAGES CXX)
find_package(Qt6 REQUIRED COMPONENTS Quick)
set(LNVK_DIR "/path/to/LNVK/integration") # directory containing LNVKConfig.cmake
find_package(LNVK REQUIRED CONFIG)
add_executable(myapp main.cpp)
target_link_libraries(myapp PRIVATE Qt6::Quick)
set_target_properties(myapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
ln_virtual_keyboard_deploy(myapp LANGUAGES en fr FONTS)
In C++, add the QML import path before engine.load() (install-prefix layout):
engine.addImportPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../qml"));
For a flat prefix, use "/qml" instead, or pass PREFIX "$<TARGET_FILE_DIR:myapp>" to ln_virtual_keyboard_deploy and use "/qml".
cmake -B build -DLNVK_DIR="/path/to/LNVK/integration"
cmake --build build
Selecting languages
By default all dictionaries are deployed. Deploy only specific languages:
ln_virtual_keyboard_deploy(myapp LANGUAGES en fr)
This always copies layouts.lnlay, themes.lntheme, and the licenses/ tree, plus the data files each language needs (selected automatically by the deploy helper). License files are not read at runtime but are required when you redistribute bundled dictionary data (see Dictionary data). See Available layout ids.
Missing layouts.lnlay or themes.lntheme causes startup errors such as Failed to load layout "en" or Failed to load theme "dark", and profile configuration may be sanitized (setActiveProfileIds: active profile ids were corrected).
qmake options
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; see Fonts (optional).
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 files
The plugin resolves the dictionaries directory (must contain layouts.lnlay) in order:
LNVK_DICT_DIRenvironment variable: root directory containinglayouts.lnlay- Compile-time
LNVK_DICT_DIR, set when the plugin is built/installed with a fixed prefix <app_dir>/share/lnvirtualkeyboard/dictionaries/— flat prefix<app_dir>/../share/lnvirtualkeyboard/dictionaries/— install prefix (default)
Each language's files are opened from the storage subtree selected by LNVK_DICT_STORAGE (compressed by default, or mmap; see Dictionary storage and profiles).
Optional deploy profiles (LNVK_DICT_PROFILE, LNVK_DICT_FEATURES) omit prediction, n-gram, matrix, or bigram families at package time; see Dictionary storage and profiles.
Font files (optional)
If you use the bundled fonts, copy share/lnvirtualkeyboard/fonts/ next to your app (same layout as dictionaries):
<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 (absolute path to the fonts directory)- Compile-time
LNVK_FONTS_DIR, set when the plugin is built/installed with a fixed prefix <app_dir>/share/lnvirtualkeyboard/fonts/— flat prefix<app_dir>/../share/lnvirtualkeyboard/fonts/— install prefix
To use application fonts instead, skip this directory and call FontPaths::setHostFontFiles with your font file paths before plugin init. Font files should use the same Qt family names as the bundled set (Noto/Inter) so per-script resolution works automatically.
Embedded deployment
Use the install prefix or flat prefix layout on the device. Example (install prefix):
/opt/myapp/bin/myapp
/opt/myapp/qml/Ln/VirtualKeyboard/
/opt/myapp/share/lnvirtualkeyboard/dictionaries/
/opt/myapp/share/lnvirtualkeyboard/fonts/ (optional)
/opt/myapp/share/lnvirtualkeyboard/licenses/
Set LNVK_FONTS_DIR only when using bundled fonts from a non-standard path.
Yocto (meta-lnvk)
The meta-lnvk layer, supplied with your release, adds the keyboard to Yocto images.
Compatible Yocto releases: kirkstone, langdale, mickledore, nanbield, scarthgap, styhead, walnascar. The layer requires meta-qt5 (Qt 5.15) or meta-qt6 (Qt 6.5 or newer).
Setup
bitbake-layers add-layer /path/to/meta-lnvk
In local.conf, accept the commercial licence flag:
LICENSE_FLAGS_ACCEPTED += "commercial_lenewt"
Install
IMAGE_INSTALL:append = " packagegroup-lnvk"
LNVK_LANGUAGES = "en fr de zh-Hans ja" # empty installs every language
LNVK_DICT_PROFILE = "standard" # optional, see Dictionary storage and profiles
LNVK_LANGUAGES takes the layout ids listed below. LNVK_DICT_PROFILE accepts full (default), standard, embedded or minimal; see Dictionary storage and profiles.
On the image, the plugin is installed in ${libdir}/qml/Ln/VirtualKeyboard, so a QML application finds it without extra configuration. To call the C++ API, see the RPATH note in API Reference.
Available layout ids
Pass these layout ids to LANGUAGES (CMake) or LNVK_LANGUAGES (qmake) to ship only the data you need. Most match a BCP 47 language tag, but ja-12key encodes an input mode. ko covers both Korean profiles (ko-dubeolsik, ko-cheonjiin).
| Layout id | Language | Layout id | Language |
|---|---|---|---|
bg | Bulgarian | nl | Dutch |
bs | Bosnian | pl | Polish |
ca | Catalan | pt | Portuguese |
cs | Czech | ro | Romanian |
da | Danish | ru | Russian |
de | German | sk | Slovak |
en | English | sl | Slovenian |
es | Spanish | sq | Albanian |
et | Estonian | sr | Serbian |
fi | Finnish | sv | Swedish |
fr | French | tr | Turkish |
gl | Galician | uk | Ukrainian |
hr | Croatian | zh-Hans | Chinese Simplified (Pinyin) |
hu | Hungarian | zh-Hant | Chinese Traditional (Pinyin) |
is | Icelandic | zh-Hant-HK | Chinese Hong Kong (Cangjie) |
it | Italian | zh-Hant-TW | Chinese Taiwan (Zhuyin) |
lt | Lithuanian | ja | Japanese (Romaji) |
lv | Latvian | ja-12key | Japanese (12-key flick) |
mk | Macedonian | ko | Korean |
nb | Norwegian Bokmål |
Qt version compatibility
The plugin is compatible with Qt 5.15 and Qt 6.x. Use the release matching your Qt major version.