keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
376 stars 104 forks source link

bug(developer): if a package has no `<DisplayFont>` but does have `<WebDisplayFont>` then kmc-keyboard-info will error if the font is not in the package #11686

Open mcdurdin opened 3 weeks ago

mcdurdin commented 3 weeks ago

I need to dig deeper on this. The intent is that the web fonts do not need to be in the package:

https://github.com/keymanapp/keyman/blob/fae6277b20dda9d7bbdb8519507a73d5ae30002a/common/schemas/kps/README.md#L12-L13

(I see a typo in that file...)

However, I think that the .keyboard_info generator will fail at present in one specific scenario:

  1. There is a <WebDisplayFonts> or (<WebOSKFonts>) element
  2. It lists at least one .ttf, .otf, or .woff
  3. There is no <DisplayFont> (or <OSKFont> for <WebOSKFonts> above) entry which lists a .ttf, .otf, or .woff.
  4. The referenced .ttf, .otf, or .woff from point 2 is not in the package.

https://github.com/keymanapp/keyman/blob/a001bbd1050dacf25150e5a4d1255c9e244aac98/developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts#L593-L597

_Originally posted by @mcdurdin in https://github.com/keymanapp/keyboards/pull/2800#discussion_r1626867514_

mcdurdin commented 3 weeks ago

See also https://github.com/keymanapp/keyboards/pull/2800#discussion_r1626868388