Adds keyboards to keymanweb.
keyboard spec, ...
keyboard spec can be a string or an object. Multiple keyboard specs can be specified in a single command, which can reduce the round-trip cost of multiple calls to Keyman Cloud servers (when using Keyman Cloud).
When keyboard spec is a string, the Keyman Cloud is used to source the keyboard file. Keymanweb will load webfonts and keyboard file automatically on demand. The string format is one of the following:
'keyboardID': Adds a specific keyboard, linking it to the default language for the keyboard
'@languageID': Adds the default keyboard for the specified ISO639-3 language code
'keyboardID@languageID': Loads a specific keyboard + language combination
The keyboard catalogue is online at http://keyman.com/developer/keymanweb/keyboards.php.
When keyboard spec is an object, then more parameters can be specified, including sourcing the keyboard from locations other than the Keyman Cloud. The specification of the object is related to the Keyman Cloud JSON API (formerly known as KeymanWeb Server Data API):
Keyboard object. Contains the following members:
- name: Name of keyboard (required)
- id: ID of keyboard, together with version always matches the filename of the keyboard (required)
- filename: url of keyboard .js, relative (to page) or absolute (required)
- version: Version of keyboard .js (optional)
- rtl: true if the keyboard targets a right-to-left script (if absent, then false).
- language: array of Language objects that are linked to the keyboard. (required)
Language object. Contains the following members:
- name: Name of language (required)
- id: ISO639-3 language code (required)
- region: Name of region ('World','Africa','Asia','Europe','South America','North America','Oceania','Central America','Middle East', or 'un','af','as','eu','sa','na','oc','ca','me') (required)
- font: Font object (or array of Font objects) describing font for input fields and OSK (if oskFont not present). (optional)
- oskFont: Font object (or array of Font objects) describing font for OSK. (optional)
Font object. Contains the following members:
- family: Font family that KeymanWeb will provide for this font. (required)
- size: Font size (in CSS dimensions), if not specified, then 1em. (optional)
- filename: Array of downloadable filenames for this font, which should be combined with options.fontBaseUri. (required)