Relates to #3621.
Add support for `&layerChanged` system store. This store is set to `1`
before a `begin postKeystroke`, if the keystroke it follows resulted in
a layer change, either programatically through a keyboard rule, or
through a `nextlayer` property of the touched key.
Relates to #3621.
This adds basic compiler support for the `begin newContext` and
`begin postKeystroke` statements, along with the corresponding `gn` and
`gpk` entry points in the compiled JavaScript keyboard.
TODO: `readonly` semantics, usage constraints, `&layerChanged`.
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.
Fixes#5609.
If a user attempted to export the OSK to a BMP or PNG, and their base
keyboard was a European layout (102 key), then Keyman Developer would
crash as it attempted to recalculate and redraw the keyboard when
constructing the OSK object, and there would be no window for the
OSK object to draw to (or measure dimensions against).
This fix uses a temporary off-screen canvas to facilitate calculation of
dimensions, and avoids drawing or invalidating if no window is
available.
From a security perspective "Anywhere, but warn me before installing an app that's not from the Microsoft Store" would be the best option for a non-computer-savvy user, so maybe we should word it like this:
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>