Skip to content

Commit

Permalink
Added new icons. Now covering all icons from Material.io/resources/icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ConfusedVorlon committed Oct 31, 2019
1 parent 27d3743 commit d12e877
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Example/HS-Font-Icons/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: UIColor.black]
}

//GMDCaseGenerator.printNewCases()
GMDCaseGenerator.printNewCases()
FACaseGenerator.printNewCases()

return true
Expand Down
6 changes: 4 additions & 2 deletions Example/HS-Font-Icons/GMDCaseGenerator.swift

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions Example/HS-Font-Icons/UpdatingNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ When/if we get an 'official' name for the item, I'll rename the _tmp one
Get the latest woff file from Google
https://github.com/google/material-design-icons/tree/master/iconfont

(better option now at https://github.com/jossef/material-design-icons-iconfont/blob/master/dist/fonts/MaterialIcons-Regular.ttf )

Convert to ttf with https://everythingfonts.com/woff2-to-ttf

Array of iconNames can be scraped with the following js
Expand All @@ -29,14 +31,14 @@ var iconNames = []

for (var i=0; i<x.length; i++) {
var element = x[i];
var cName = element.classList[0].slice(9)
var parts = cName.split("_")
var initialName = element.innerText
var parts = initialName.split("_")
parts = parts.map(function(part){return part.charAt(0).toUpperCase() + part.substr(1);})

var name = parts.join("")
name = name.slice(0,1).toLowerCase()+name.slice(1)

var protectedWords = ["public","extension","class"]
var protectedWords = ["public","extension","class","repeat"]
if (protectedWords.indexOf(name) > -1 ) {
name = "_" + name
}
Expand Down
Loading

0 comments on commit d12e877

Please sign in to comment.