Skip to content

Commit

Permalink
wp support
Browse files Browse the repository at this point in the history
  • Loading branch information
eb1 committed Jan 27, 2015
1 parent 5f8a927 commit 4445309
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
19 changes: 18 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,22 @@
<runs />
</js-module>
</platform>
<!-- windows phone not currently supported -->
<!-- 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>
</plugin>
32 changes: 32 additions & 0 deletions src/wp/Fonts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Runtime.Serialization;

namespace WPCordovaClassLib.Cordova.Commands
{
/// <summary>
/// Provides information about system locale, culture settings, number formats, ect.
/// </summary>
public class Fonts : BaseCommand
{
/// <summary>
/// Gets the string identifier for the client's current language.
/// </summary>
/// <param name="options"></param>
public void getFontList(string options)
{
try
{
FontFamily[] fontFamilies;

InstalledFontCollection installedFontCollection = new InstalledFontCollection();
fontFamilies = installedFontCollection.Families;
PluginResult result = new PluginResult(PluginResult.Status.OK, this.WrapIntoJSON(fontFamilies));
this.DispatchCommandResult(result);
}
catch (Exception)
{
this.DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new GlobalizationError()));
}
}
}
}

0 comments on commit 4445309

Please sign in to comment.