Last active
February 24, 2016 14:13
-
-
Save s-shin/266fd1eabdc60edaff1b to your computer and use it in GitHub Desktop.
One-liner to convert icomoon's selection.json to android's string xml.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -rjson -e 'puts "<resources>"; JSON.parse(File.read(ARGV[0]))["icons"].each {|icon| puts " <string name=\"#{ARGV[1]}_#{icon["properties"]["name"]}\">&#x#{icon["properties"]["code"].to_s(16)};</string>"}; puts "</resources>"' path/to/icomoon/selection.json prefix > path/to/values/fonts.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment