Permalink
Browse files

file extensions changed

  • Loading branch information...
1 parent 42b72bc commit 312d0843883b2c85038de991503f50815944cd78 @keremciu committed May 9, 2016
View
@@ -1,4 +1,2 @@
.DS_Store
-iconfont.sketchplugin/Contents/Sketch/manifest.json
-/iconfont.sketchplugin/Contents/Sketch/manifest.json
-iconfont.sketchplugin/Contents/Resources/bundle/*
+iconfont.sketchplugin/Contents/Resources/bundle/*
View
@@ -1,6 +1,13 @@
[![Latest Version](https://img.shields.io/github/release/keremciu/sketch-iconfont.svg?style=flat-square)](https://github.com/keremciu/sketch-iconfont/releases)
[![Join the chat at https://gitter.im/keremciu/sketch-iconfont](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/keremciu/sketch-iconfont?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+### New Feature - 29 April 2016
+![demo][demo-image]
+
+Your teammates don't have your icon-fonts? don't worry now you can convert all icons with one command then share it.
+
+[demo-image]: http://g.recordit.co/TU3az70acC.gif
+
## Use Icon Fonts in Sketch
This plugin helps you easily insert and manage icons from icon fonts - such as FontAwesome, Ion or Material Design Icons - in your Sketch designs.
@@ -13,12 +20,12 @@ The plugin itself has no font built-in. You will need to download and install th
### - Features
###### Why you need to use it
-> `For The Designer:`
+> `For The Designer:`
> When a designer wants to add an icon from an icon font - such as material design, fontawesome, etc. - they usually need to find a cheatsheet containing all the font's icons, and then manually copy+paste each one they wish to use into their design - or use a third-party application. Time consuming and cumbersome.
- You can now easily view and add any icon directly Sketch!
-> `For The Developer:`
+> `For The Developer:`
> When a developer wants to find out the name of an icon that was used by the Designer, they need to search through a lengthy list of icons, until they find it. Time consuming and cumbersome.
- You can now easily find out an icon's name directly in Sketch, without needing to perform a search!
@@ -30,7 +37,7 @@ The plugin itself has no font built-in. You will need to download and install th
### Using Sketch Toolbox
1. Install 'Sketch Iconfont' plugin directly from Sketch Toolbox.
-2. Install a font containing an svg font file, or install a font bundle - such as the one provided here: https://github.com/keremciu/font-bundles
+2. Install a font containing an svg font file, or install a font bundle - such as the one provided here: https://github.com/keremciu/font-bundles
### Manually
@@ -41,7 +48,7 @@ The plugin itself has no font built-in. You will need to download and install th
=======
### - Documentation
-###### Its a little documentation about commands
+###### Its a little documentation about commands
Command | Description
----------------------- | -----------------------------------------------------------------------------------------------
@@ -55,11 +62,7 @@ HTML of Selected Icon | To use an icon on web or mobile, select it and use thi
### - Minimum Dependencies
-<<<<<<< HEAD
-- OSX El Capitan.
-=======
- OSX El Capitan & Yosemite ([#44](https://github.com/keremciu/sketch-iconfont/issues/44))
->>>>>>> 89a08fae005b6db0c5fbe0fa244fe0420e1304f3
- Sketch 3.4.4.
You can follow me on twitter to get updates.
@@ -1,4 +1,4 @@
-@import "const/library.cocoascript";
+@import "const/library.js";
var onRun = function(context) {
@@ -1,4 +1,4 @@
-@import "const/library.cocoascript";
+@import "const/library.js";
var handleFont = function(context) {
var handler = context.command.name()
@@ -1,4 +1,4 @@
-@import "library.cocoascript";
+@import "library.js";
var onRun = function(context) {
@@ -54,4 +54,4 @@ var onRun = function(context) {
// if (response == NSOKButton) {
// }
-};
+};
@@ -1,4 +1,4 @@
-@import "library.cocoascript";
+@import "library.js";
var onRun = function(context) {
@@ -1,4 +1,4 @@
-@import "library.cocoascript";
+@import "library.js";
var onRun = function(context) {
@@ -91,4 +91,4 @@ var onRun = function(context) {
Library.create.file(manifest,manifestPath)
doc.showMessage("You've installed it, now go for it: Plugins > Icon Font > Grid Insert")
-};
+};
@@ -1 +0,0 @@
-@import "library.cocoascript";var onRun = function(context) { var plugin = context.plugin var doc = context.document var fileManager = NSFileManager.defaultManager() var scriptFullPath = context.scriptPath var directoryPlugin = [[scriptFullPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] var resources = [directoryPlugin stringByDeletingLastPathComponent] + "/Resources" // 1. Create Window var wrapper = Library.Widgets.window("Remove Font", "Select font to remove") // 2. Fetch fonts.json file var json = Library.fetch.json("fonts.json",plugin) var fonts = [json objectForKey:@"fonts"] // 3. create a combobox to select font which wants to remove var selectbox = [[NSComboBox alloc] initWithFrame:NSMakeRect(90,175,220,24)] selectbox.addItemsWithObjectValues(fonts) selectbox.setItemHeight(20.0) selectbox.selectItemAtIndex(0) selectbox.setEditable(false) wrapper.main.addSubview(selectbox) // 4. create a remove button var submit = [[NSButton alloc] initWithFrame:NSMakeRect(350, 150, 200, 50)] submit.setTitle("") submit.setAction("callAction:") submit.setWantsLayer(true) submit.setCOSJSTargetFunction(function(sender) { wrapper.window.orderOut(nil) NSApp.stopModalWithCode(NSOKButton) }) // 4.1. create a layer for remove button var submit_text = CATextLayer.layer() submit_text.setBackgroundColor(NSColor.blackColor()) submit_text.setForegroundColor(CGColorCreateGenericRGB(215/255, 159/255, 0/255, 1.0)) submit_text.setFontSize(18) submit_text.contentsScale = NSScreen.mainScreen().backingScaleFactor() submit_text.string = "- Remove this font" submit.setLayer(submit_text) wrapper.main.addSubview(submit) var response = NSApp.runModalForWindow(wrapper.window) // if is the response is ok, remove the font if (response == NSOKButton) { selected_font = selectbox.objectValueOfSelectedItem() font = fonts[selected_font] // // 4. Remove the json file of the font // full_path = resources + "/bundle/" + font.path [fileManager removeItemAtPath:full_path error:nil] // // 5. Remove the font from fonts.json file // properties = Library.fetch.json("fonts.json",plugin) if ([properties isKindOfClass:[NSDictionary class]]) { dict = [[NSMutableDictionary alloc] initWithDictionary:properties] list = [[NSMutableDictionary alloc] initWithDictionary:[dict objectForKey:@"fonts"]] [list removeObjectForKey:@""+selected_font] dict[@"fonts"] = list } // 6. Write new data to fonts.json Library.create.file(dict,resources + "/fonts.json") // // 7. Remove the font commands from manifest.json // var manifestPath = directoryPlugin + "/manifest.json" var data = [NSData dataWithContentsOfFile:manifestPath] manifest = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] // 9. Remove the command from manifest.json commands = [manifest objectForKey:@"commands"] for (i = 0; i < commands.length(); i++) { var item = commands[i] // if (selected_font == item.name) { if ([selected_font isEqualToString:@""+item.name]) { if (![commands removeObject:item]) { log('first remove command does not work') } menuid = item.identifier menu = [manifest objectForKey:@"menu"] items = [menu objectForKey:@"items"] first = [items objectAtIndex:0] if (![[first objectForKey:@"items"] removeObject:@""+menuid]) { log('second remove command does not work') } } } log([manifest objectForKey:@"commands"].length()) // manifest commands if ([manifest objectForKey:@"commands"].length() <= 6) { items = ["install","import"] menu = [manifest objectForKey:@"menu"] [menu setValue:items forKeyPath:@"items"]; } // 11. Write new data to manifest file Library.create.file(manifest,manifestPath) doc.showMessage(selected_font + " is deleted from the plugin.") }};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,4 +1,4 @@
-@import "const/library.cocoascript";
+@import "const/library.js";
var onRun = function(context) {
@@ -1,4 +1,4 @@
-@import "const/library.cocoascript"
+@import "const/library.js"
var onRun = function(context) {
@@ -2,46 +2,46 @@
"author" : "Kerem Sevencan",
"commands" : [
{
- "script" : "convert.cocoascript",
+ "script" : "convert.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl l",
"name" : "Convert Icons [Outlines]",
"identifier" : "convert"
},
{
- "script" : "learn.cocoascript",
+ "script" : "learn.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl u",
"name" : "HTML of Selected Icon",
"identifier" : "learn"
},
{
- "script" : "add.cocoascript",
+ "script" : "add.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl i",
"name" : "Name Insert",
"identifier" : "add"
},
{
- "script" : "const/install.cocoascript",
+ "script" : "const/install.js",
"handler" : "onRun",
"name" : "Install a Font-Bundle",
"identifier" : "install"
},
{
- "script" : "const/export.cocoascript",
+ "script" : "const/export.js",
"handler" : "onRun",
"name" : "Export your Font-Bundle",
"identifier" : "export"
},
{
- "script" : "const/import.cocoascript",
+ "script" : "const/import.js",
"handler" : "onRun",
"name" : "Install a Font",
"identifier" : "import"
},
{
- "script" : "const/remove.cocoascript",
+ "script" : "const/remove.js",
"handler" : "onRun",
"name" : "Remove a Font",
"identifier" : "remove"
@@ -55,7 +55,7 @@
]
},
"identifier" : "com.keremciu.sketch.iconfont",
- "version" : "3.3.0",
+ "version" : "3.3.1",
"description" : "Use icon-fonts like a boss.",
"name" : "Icon Font",
"authorEmail" : "info@kerem.ws"
@@ -1,46 +1,46 @@
{
"commands" : [
{
- "script" : "learn.cocoascript",
+ "script" : "learn.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl u",
"name" : "HTML of Selected Icon",
"identifier" : "learn"
},
{
- "script" : "convert.cocoascript",
+ "script" : "convert.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl u",
"name" : "Convert Icons [Outlines]",
"identifier" : "convert"
},
{
- "script" : "add.cocoascript",
+ "script" : "add.js",
"handler" : "onRun",
"shortcut" : "cmd ctrl i",
"name" : "Name Insert",
"identifier" : "add"
},
{
- "script" : "const/install.cocoascript",
+ "script" : "const/install.js",
"handler" : "onRun",
"name" : "Install a Font-Bundle",
"identifier" : "install"
},
{
- "script" : "const/export.cocoascript",
+ "script" : "const/export.js",
"handler" : "onRun",
"name" : "Export your Font-Bundle",
"identifier" : "export"
},
{
- "script" : "const/import.cocoascript",
+ "script" : "const/import.js",
"handler" : "onRun",
"name" : "Install a Font",
"identifier" : "import"
},
{
- "script" : "const/remove.cocoascript",
+ "script" : "const/remove.js",
"handler" : "onRun",
"name" : "Remove a Font",
"identifier" : "remove"

0 comments on commit 312d084

Please sign in to comment.