From b8493fc4b3c090b5edf442e4c3b213981d2e6f95 Mon Sep 17 00:00:00 2001 From: eb1 Date: Tue, 2 Dec 2014 09:42:25 -0600 Subject: [PATCH] Move API to navigator.Fonts --- plugin.xml | 3 ++- src/ios/CDVFonts.m | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin.xml b/plugin.xml index df2022c..8491af6 100644 --- a/plugin.xml +++ b/plugin.xml @@ -11,8 +11,9 @@ cordova,fonts https://github.com/adapt-it/cordova-fonts.git https://github.com/adapt-it/cordova-fonts/issues + - + diff --git a/src/ios/CDVFonts.m b/src/ios/CDVFonts.m index b50a5ab..02fc4ce 100644 --- a/src/ios/CDVFonts.m +++ b/src/ios/CDVFonts.m @@ -9,18 +9,17 @@ - (void)fonts:(CDVInvokedUrlCommand*)command NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; NSArray *fontNames; - NSMutableArray* fonts = [NSMutableArray array]; + NSMutableArray *fonts = [NSMutableArray array]; NSInteger indFamily, indFont; for (indFamily=0; indFamily<[familyNames count]; ++indFamily) { fontNames = [[NSArray alloc] initWithArray: [UIFont fontNamesForFamilyName: [familyNames objectAtIndex:indFamily]]]; - fonts.addObjectsFromArray(fontNames); - [fontNames release]; + [fonts addObjectsFromArray:fontNames]; } - if (fonts != nil && [fonts length] > 0) { + if (fonts != nil) { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:fonts]; } else { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];