Offer Products Case Studies Expertises About us Contact Blog
FR EN

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.

ComponentOn-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:

  1. Per-script Noto/Inter family for the active language if that family is registered
  2. Inter for Latin if available
  3. QGuiApplication::font() if it covers the active writing system
  4. 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.

SourceLicenseUsed in
Unicode Unihan databaseUnicode License v3pinyin*.trie, cangjie*.trie, zhuyin.trie, japanese.trie
CC-CEDICTCC BY-SA 3.0pinyin.trie, pinyin-hant.trie
FrequencyWords (OpenSubtitles 2018)CC BY-SA 4.0All prediction-*.pred, transliteration tries, bigram-*.bigram
Kannada Wikipedia titlesCC BY-SA 4.0transliteration-kn.trie, bigram-kn.bigram
rime-essayLGPL-3.0Chinese frequency statistics (rankings only)
mecab-ipadic 2.7.0NAIST Licensejapanese.trie (fallback), matrix-ja.mtx
Mozc OSS dictionaryBSD 3-Clause + NAISTjapanese.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's qml/ directory.
  • Custom location: place Ln/ anywhere and point QML2_IMPORT_PATH to 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:

  1. LNVK_DICT_DIR environment variable: directory containing the requested file (for example prediction-en.pred)
  2. Compile-time LNVK_DICT_DIR: set when the plugin is built/installed with a fixed prefix
  3. <app_dir>/../share/lnvirtualkeyboard/dictionaries/<file>
  4. <app_dir>/../data/dictionaries/<file>
  5. <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:

  1. LNVK_FONTS_DIR environment variable
  2. Compile-time LNVK_FONTS_DIR
  3. <app_dir>/../share/lnvirtualkeyboard/fonts/
  4. <app_dir>/../fonts/
  5. <app_dir>/fonts/
  6. Walk up from <app_dir> looking for a fonts/ directory that contains Inter-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:

CodeLanguageCodeLanguage
arArabiclvLatvian
beBelarusianmkMacedonian
bgBulgarianmtMaltese
bnBengalinbNorwegian Bokmål
bsBosniannlDutch
caCatalanplPolish
csCzechptPortuguese
cyWelshroRomanian
daDanishruRussian
deGermanskSlovak
elGreekslSlovenian
enEnglishsqAlbanian
esSpanishsrSerbian
etEstoniansvSwedish
fiFinnishtaTamil
frFrenchteTelugu
gaIrishthThai
glGaliciantrTurkish
heHebrewukUkrainian
hiHindi (transliteration)viVietnamese
hi-DevaHindi (Devanagari)zh-HansChinese Simplified (Pinyin)
hrCroatianzh-HantChinese Traditional (Pinyin)
huHungarianzh-Hant-HKChinese Hong Kong (Cangjie)
hyArmenianzh-Hant-TWChinese Taiwan (Zhuyin)
isIcelandicjaJapanese (Romaji)
itItalianja-12keyJapanese (12-key flick)
kaGeorgiankoKorean
knKannadaltLithuanian