Fixes#5779.
Fixes#5731 (I believe mitigation is sufficient to close this issue).
A variety of interrelated font and font size display issues resolved:
1. KVK font was not applied early enough for size calculations, which
meant that we were calculating font scaling per key based on a
default font when transforming from the KVK data for desktop devices
(defaultLayout.ts)
2. Font scaling for non-default layers was calculated when elements were
not visible and had no size information, giving incorrect values. To
resolve this, font scaling is now calculated when a layer is made
visible, which had performance impacts; resolved by reducing
unnecessary `layer.refreshLayout()` calls; see performance point 1
below (oskView.ts:layerChangeHandler())
3. `getViewportScale()` would return an incorrect scaled value when
emulating touch devices on a desktop browser (kmwutils.ts)
4. After switching keyboards, the device-specific scaling factor was not
maintained (oskView.ts:refreshLayout())
Related performance improvements:
1. Multiple calls to `layer.refreshLayout()` in `refreshLayout()` have
been eliminated, and only the currently visible layer is now
refreshed. This dramatically reduces the number of calls to
`getIdealFontSize()` which was the primary concern of #5731.
(visualKeyboards.ts)
2. Unnecessary use of `innerHTML` replaced with `innerText`
(oskBaseKey.ts)
Minor Keyman Developer performance improvement:
1. The web debugger no longer recalculates the OSK twice (test.js)
Fixes#5464.
The keyboards repository already has code to validate .xsd files, using
xmllint. This adds the same functionality directly into kmcomp and TIKE.
This change adds integration/regression tests for ibus-keyman. It
re-uses the unit tests that we have for core.
Also modifies one test so that the context doesn't use characters
used in the keyboard. This makes it easier to setup in ibus-keyman
tests.
While adding nested subdirs to `meson.build` works it still adds the
directory with the wrong path separator on Windows. This suddenly
caused problems when building.
This change adds package templates to the test folder and compiles
a keyboard package for each of the test keyboards. These
packages are useful for manual testing in addition to the automated
tests.
The copy keyword inside of configure_file got added in meson 0.47.
However, we still support Bionic which comes with meson 0.45. This
change adds a workaround.
This change generates kmp.json based on the test files specified in
meson.build. It will also generate .kmx files in the build directory
and copies the .kmn files to it as well.