Releases: adapt-it/cordova-fonts
Maintenance release
getDefaultFont
This release adds a new method, getDefaultFont:
GetDefaultFont
Parameters:
- successCallback: Callback that returns the string name of the default font on the device.
- errorCallback: Callback that executes if an error occurs during the call.
Android quirks
Android currently returns a hard-coded string for the default font, "Roboto Regular". I haven't yet found a way to get the name of the default font using the Android API (see Issue #2 and the corresponding query to Stack Overflow. The Android code will be updated if I can get a solution to this issue.
Firefox OS quirks
Firefox OS does not provide an API to access the fonts on the device. The Fonts plugin currently returns a hard-coded string for the default font "Fira Sans Regular". See https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/ for more information.
Example
if (navigator.Fonts) {
console.log("Fonts object in navigator");
navigator.Fonts.getDefaultFont(
function (defaultFont) {
if (defaultFont) {
console.log("Default Font: " + defaultFont);
}
},
function (error) {
console.log("DefaultFont error: " + error);
}
);
} else {
console.log("Plugin error: Fonts plugin not found (is it installed?)");
}
Minor updates
This release adds some travis-ci testing and fixes a couple other minor bugs. No other changes.
Release on npm
This release is the first published to npm. Linky: https://www.npmjs.com/package/cordova-plugin-fonts
Firefox OS (unverified)
This release includes support for iOS and Android / Amazon FireOS, as well as firefoxos (unverified).
Firefox OS does not provide an API to access the fonts on the device. The Fonts plugin currently returns a list corresponding to the fonts.mk file found in the mozilla-b2g project (https://github.com/mozilla-b2g/moztt/blob/master/fonts.mk), but it is a hard-coded list and not guaranteed to be correct on any particular version or distro of Firefox OS.
Initial release
Supports iOS, Android and Amazon Fire devices.