keyman icon indicating copy to clipboard operation
keyman copied to clipboard

bug(windows): osk does not use Keyboard Font property from packages

Open mcdurdin opened this issue 2 years ago • 3 comments

I have not yet verified this on other platforms, but it appears that the Keyboard Font property in the package editor is not being used by the OSK on Windows.

Ref: https://github.com/keymanapp/keyboards/pull/2434

I started from this PR, then updated the sil_hebrew.kmn to add:

store(&DISPLAYMAP) '../../../shared/fonts/kbd/kbdhebr/KbdHebr.json'

Then, added KbdHebr.ttf to sil_hebrew.kps, and set the Keyboard Font property to KbdHebr.ttf.

After installing the package in Keyman, it was clear that Keyman was not using the font, because it showed tofu (as you'd expect with DisplayMap). Updating the Keyboard Fonts / On Screen Keyboard font to KbdHebr, it worked; this sets the Font property in the .kvks:

<encoding name="unicode" fontname="KbdHebr" fontsize="9">

However, from my memory, the font specification is intended to be from the .kps, and has been thus for a long time. The details in Keyboard Fonts dialog are intended for development-time use only.

@LornaSIL this relates to your experience with using &DisplayMap communicated recently via email.

mcdurdin avatar Nov 07 '23 05:11 mcdurdin

Anecdotally, I've had issues with mobile keyboards (not sure about OSK) added to Dictionary and Scripture app not respecting keyboard fonts if they were compiled with outside-the-project font paths like ../../../shared/fonts/... Since the server-side change, I keep a local copy with internal fonts for export with apps.

MattGyverLee avatar Nov 07 '23 15:11 MattGyverLee

Anecdotally, I've had issues with mobile keyboards (not sure about OSK) added to Dictionary and Scripture app not respecting keyboard fonts if they were compiled with outside-the-project font paths like ../../../shared/fonts/... Since the server-side change, I keep a local copy with internal fonts for export with apps.

This should not be possible. The compiled keyboard package .kmp does not have any paths -- it's all flattened into a single zip folder. If you can get a repro, then please open an issue on that so we can resolve this.

mcdurdin avatar Nov 08 '23 03:11 mcdurdin

This is a significant change so I think I'd like to bump it to 18.0 now.

mcdurdin avatar Dec 05 '23 07:12 mcdurdin

From discussion with Ross:

  1. kpinstallpackage.pas, InstallKeyboard(): load the font metadata from the package's <Keyboard>/<OSKFont> entry and pass to TKPInstallKeyboard.Execute()
  2. kpinstallkeyboard.pas: TKPInstallKeyboard.Execute(): extract font metadata (ttinfo.pas) and write a new reg entry in HKLM\Software\Wow6432Node\Keyman\Keyman Engine\Installed Keyboards\<kbd> for osk font name.
  3. visualkeyboardinfo.pas: Load the above entry into TVisualKeyboardInfo
  4. UfrmOSKOnScreenKeyboard.pas, Use the data if available, or fall back to .kvk data.
  5. Upgrade scenario -- add osk font name for each keyboard as above.

mcdurdin avatar Nov 27 '24 05:11 mcdurdin

For step 4. See developer change in #12912 which will mean the KVK will have the correct data as it will have be built at compile time using metadata from the kps

rc-swag avatar Jan 20 '25 06:01 rc-swag

Given the changes made to the package compiler, we'll put this on hold for now and review in a future version.

mcdurdin avatar Jan 24 '25 04:01 mcdurdin

As #12912 resolves the issue on the developer side, we'll close this one as no longer important.

mcdurdin avatar Apr 25 '25 06:04 mcdurdin