Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eb1 committed Jan 13, 2015
1 parent 79c1d8d commit b51d94e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 92 deletions.
50 changes: 48 additions & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,61 @@

# org.adapt-it.cordova.fonts

This plugin defines a global `fonts` object, which provides access to the fonts installed on the device.
This plugin defines a global `Fonts` object, which provides access to the fonts installed on the device. The `Fonts` object is available from the `navigator` object after the `deviceready` event fires.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.Fonts);
}

## Installation

cordova plugin add https://github.com/adapt-it/cordova-fonts.git

## Supported Platforms

- Android
- iOS

# Fonts

The `Fonts` object provides a way to enumerate through the list of fonts installed on the device.

## Methods

Currently this plugin only provides a single method, **getFontList**.

### GetFontList

**Parameters:**

- **successCallback**: Callback that returns the list of fonts as an array of string values.
- **errorCallback: Callback that executes if an error occurs while retrieving the list of fonts on the local device.

### Example

if (navigator.Fonts) {
console.log("Fonts object in navigator");
navigator.Fonts.getFontList(
function (fontList) {
if (fontlist) {
for (var i = 0; i < fontlist.length; i++) {
console.log("Font: " + fontlist[i]);
}
}
},
function (error) {
console.log("FontList error: " + error);
}
);
} else {
console.log("Plugin error: Fonts plugin not found (is it installed?)");
}


## Internal Development / Unit Testing

(This is only for devs who are debugging the plugin itself)
(This is only for devs who are developing / debugging the plugin itself)

The cordova-fonts plugin uses the cordova-plugin-test-framework to run unit tests. Complete the following to run through the plugin unit tests:

Expand Down
23 changes: 1 addition & 22 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,5 @@
</config-file>
<source-file src="src/android/Fonts.java" target-dir="src/org/adaptit/cordova/Fonts" />
</platform>
<!-- wp7 -->
<!--
<platform name="wp7">
<config-file target="config.xml" parent="/*">
<feature name="Fonts">
<param name="wp-package" value="Fonts"/>
</feature>
</config-file>
<source-file src="src/wp/Fonts.cs" />
</platform>
-->
<!-- wp8 -->
<!--
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="Fonts">
<param name="wp-package" value="Fonts"/>
</feature>
</config-file>
<source-file src="src/wp/Fonts.cs" />
</platform>
-->
<!-- wp7 and Firefox OS not currently supported -->
</plugin>
68 changes: 0 additions & 68 deletions src/wp/Fonts.cs

This file was deleted.

0 comments on commit b51d94e

Please sign in to comment.