/home/mip/mip/public/vendor/laravel-filemanager/files/folder-1/821668/builder.tar
generate.py 0000664 00000022336 15243426175 0006731 0 ustar 00 from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_PATH = os.path.join(ROOT_PATH, 'less')
def main():
generate_font_files()
data = get_build_data()
rename_svg_glyph_names(data)
generate_scss(data)
generate_less(data)
generate_cheatsheet(data)
generate_component_json(data)
generate_composer_json(data)
generate_bower_json(data)
def generate_font_files():
print "Generate Fonts"
cmd = "fontforge -script %s/scripts/generate_font.py" % (BUILDER_PATH)
call(cmd, shell=True)
def rename_svg_glyph_names(data):
# hacky and slow (but safe) way to rename glyph-name attributes
svg_path = os.path.join(FONTS_FOLDER_PATH, 'ionicons.svg')
svg_file = open(svg_path, 'r+')
svg_text = svg_file.read()
svg_file.seek(0)
for ionicon in data['icons']:
# uniF2CA
org_name = 'uni%s' % (ionicon['code'].replace('0x', '').upper())
ion_name = 'ion-%s' % (ionicon['name'])
svg_text = svg_text.replace(org_name, ion_name)
svg_file.write(svg_text)
svg_file.close()
def generate_less(data):
print "Generate LESS"
font_name = data['name']
font_version = data['version']
css_prefix = data['prefix']
variables_file_path = os.path.join(LESS_FOLDER_PATH, '_ionicons-variables.less')
icons_file_path = os.path.join(LESS_FOLDER_PATH, '_ionicons-icons.less')
d = []
d.append('/*!');
d.append('Ionicons, v%s' % (font_version) );
d.append('Created by Ben Sperry for the Ionic Framework, http://ionicons.com/');
d.append('https://twitter.com/benjsperry https://twitter.com/ionicframework');
d.append('MIT License: https://github.com/driftyco/ionicons');
d.append('*/');
d.append('// Ionicons Variables')
d.append('// --------------------------\n')
d.append('@ionicons-font-path: "../fonts";')
d.append('@ionicons-font-family: "%s";' % (font_name) )
d.append('@ionicons-version: "%s";' % (font_version) )
d.append('@ionicons-prefix: %s;' % (css_prefix) )
d.append('')
for ionicon in data['icons']:
chr_code = ionicon['code'].replace('0x', '\\')
d.append('@ionicon-var-%s: "%s";' % (ionicon['name'], chr_code) )
f = open(variables_file_path, 'w')
f.write( '\n'.join(d) )
f.close()
d = []
d.append('// Ionicons Icons')
d.append('// --------------------------\n')
group = [ '.%s' % (data['name'].lower()) ]
for ionicon in data['icons']:
group.append('.@{ionicons-prefix}%s:before' % (ionicon['name']) )
d.append( ',\n'.join(group) )
d.append('{')
d.append(' &:extend(.ion);')
d.append('}')
for ionicon in data['icons']:
chr_code = ionicon['code'].replace('0x', '\\')
d.append('.@{ionicons-prefix}%s:before { content: @ionicon-var-%s; }' % (ionicon['name'], ionicon['name']) )
f = open(icons_file_path, 'w')
f.write( '\n'.join(d) )
f.close()
def generate_scss(data):
print "Generate SCSS"
font_name = data['name']
font_version = data['version']
css_prefix = data['prefix']
variables_file_path = os.path.join(SCSS_FOLDER_PATH, '_ionicons-variables.scss')
icons_file_path = os.path.join(SCSS_FOLDER_PATH, '_ionicons-icons.scss')
d = []
d.append('// Ionicons Variables')
d.append('// --------------------------\n')
d.append('$ionicons-font-path: "../fonts" !default;')
d.append('$ionicons-font-family: "%s" !default;' % (font_name) )
d.append('$ionicons-version: "%s" !default;' % (font_version) )
d.append('$ionicons-prefix: %s !default;' % (css_prefix) )
d.append('')
for ionicon in data['icons']:
chr_code = ionicon['code'].replace('0x', '\\')
d.append('$ionicon-var-%s: "%s";' % (ionicon['name'], chr_code) )
f = open(variables_file_path, 'w')
f.write( '\n'.join(d) )
f.close()
d = []
d.append('// Ionicons Icons')
d.append('// --------------------------\n')
group = [ '.%s' % (data['name'].lower()) ]
for ionicon in data['icons']:
group.append('.#{$ionicons-prefix}%s:before' % (ionicon['name']) )
d.append( ',\n'.join(group) )
d.append('{')
d.append(' @extend .ion;')
d.append('}')
for ionicon in data['icons']:
chr_code = ionicon['code'].replace('0x', '\\')
d.append('.#{$ionicons-prefix}%s:before { content: $ionicon-var-%s; }' % (ionicon['name'], ionicon['name']) )
f = open(icons_file_path, 'w')
f.write( '\n'.join(d) )
f.close()
generate_css_from_scss(data)
def generate_css_from_scss(data):
print "Generate CSS From SCSS"
scss_file_path = os.path.join(SCSS_FOLDER_PATH, 'ionicons.scss')
css_file_path = os.path.join(CSS_FOLDER_PATH, 'ionicons.css')
css_min_file_path = os.path.join(CSS_FOLDER_PATH, 'ionicons.min.css')
cmd = "sass %s %s --style compact" % (scss_file_path, css_file_path)
call(cmd, shell=True)
print "Generate Minified CSS From SCSS"
cmd = "sass %s %s --style compressed" % (scss_file_path, css_min_file_path)
call(cmd, shell=True)
def generate_cheatsheet(data):
print "Generate Cheatsheet"
cheatsheet_file_path = os.path.join(ROOT_PATH, 'cheatsheet.html')
template_path = os.path.join(BUILDER_PATH, 'cheatsheet', 'template.html')
icon_row_path = os.path.join(BUILDER_PATH, 'cheatsheet', 'icon-row.html')
f = open(template_path, 'r')
template_html = f.read()
f.close()
f = open(icon_row_path, 'r')
icon_row_template = f.read()
f.close()
content = []
for ionicon in data['icons']:
css_code = ionicon['code'].replace('0x', '\\')
escaped_html_code = ionicon['code'].replace('0x', '&#x') + ';'
html_code = ionicon['code'].replace('0x', '&#x') + ';'
item_row = icon_row_template
item_row = item_row.replace('{{name}}', ionicon['name'])
item_row = item_row.replace('{{prefix}}', data['prefix'])
item_row = item_row.replace('{{css_code}}', css_code)
item_row = item_row.replace('{{escaped_html_code}}', escaped_html_code)
item_row = item_row.replace('{{html_code}}', html_code)
content.append(item_row)
template_html = template_html.replace("{{font_name}}", data["name"])
template_html = template_html.replace("{{font_version}}", data["version"])
template_html = template_html.replace("{{icon_count}}", str(len(data["icons"])) )
template_html = template_html.replace("{{content}}", '\n'.join(content) )
f = open(cheatsheet_file_path, 'w')
f.write(template_html)
f.close()
def generate_component_json(data):
print "Generate component.json"
d = {
"name": data['name'],
"repo": "driftyco/ionicons",
"description": "The premium icon font for Ionic Framework.",
"version": data['version'],
"keywords": [],
"dependencies": {},
"development": {},
"license": "MIT",
"styles": [
"css/%s.css" % (data['name'].lower())
],
"fonts": [
"fonts/%s.eot" % (data['name'].lower()),
"fonts/%s.svg" % (data['name'].lower()),
"fonts/%s.ttf" % (data['name'].lower()),
"fonts/%s.woff" % (data['name'].lower())
]
}
txt = json.dumps(d, indent=4, separators=(',', ': '))
component_file_path = os.path.join(ROOT_PATH, 'component.json')
f = open(component_file_path, 'w')
f.write(txt)
f.close()
def generate_composer_json(data):
print "Generate composer.json"
d = {
"name": "driftyco/ionicons",
"description": "The premium icon font for Ionic Framework.",
"keywords": [ "fonts", "icon font", "icons", "ionic", "web font"],
"homepage": "http://ionicons.com/",
"authors": [
{
"name": "Ben Sperry",
"email": "ben@drifty.com",
"role": "Designer",
"homepage": "https://twitter.com/benjsperry"
},
{
"name": "Adam Bradley",
"email": "adam@drifty.com",
"role": "Developer",
"homepage": "https://twitter.com/adamdbradley"
},
{
"name": "Max Lynch",
"email": "max@drifty.com",
"role": "Developer",
"homepage": "https://twitter.com/maxlynch"
}
],
"extra": {},
"license": [ "MIT" ]
}
txt = json.dumps(d, indent=4, separators=(',', ': '))
composer_file_path = os.path.join(ROOT_PATH, 'composer.json')
f = open(composer_file_path, 'w')
f.write(txt)
f.close()
def generate_bower_json(data):
print "Generate bower.json"
d = {
"name": data['name'],
"version": data['version'],
"homepage": "https://github.com/driftyco/ionicons",
"authors": [
"Ben Sperry <ben@drifty.com>",
"Adam Bradley <adam@drifty.com>",
"Max Lynch <max@drifty.com>"
],
"description": "Ionicons - free and beautiful icons from the creators of Ionic Framework",
"main": [
"css/%s.css" % (data['name'].lower()),
"fonts/*"
],
"keywords": [ "fonts", "icon font", "icons", "ionic", "web font"],
"license": "MIT",
"ignore": [
"**/.*",
"builder",
"node_modules",
"bower_components",
"test",
"tests"
]
}
txt = json.dumps(d, indent=4, separators=(',', ': '))
bower_file_path = os.path.join(ROOT_PATH, 'bower.json')
f = open(bower_file_path, 'w')
f.write(txt)
f.close()
def get_build_data():
build_data_path = os.path.join(BUILDER_PATH, 'build_data.json')
f = open(build_data_path, 'r')
data = json.loads(f.read())
f.close()
return data
if __name__ == "__main__":
main()
build_data.json 0000664 00000140417 15243426175 0007551 0 ustar 00 {
"build_hash": "c9df150ee06f9db1642a5350c56829ae",
"prefix": "ion-",
"version": "2.0.0",
"name": "Ionicons",
"icons": [
{
"code": "0xf101",
"name": "alert"
},
{
"code": "0xf100",
"name": "alert-circled"
},
{
"code": "0xf2c7",
"name": "android-add"
},
{
"code": "0xf359",
"name": "android-add-circle"
},
{
"code": "0xf35a",
"name": "android-alarm-clock"
},
{
"code": "0xf35b",
"name": "android-alert"
},
{
"code": "0xf35c",
"name": "android-apps"
},
{
"code": "0xf2c9",
"name": "android-archive"
},
{
"code": "0xf2ca",
"name": "android-arrow-back"
},
{
"code": "0xf35d",
"name": "android-arrow-down"
},
{
"code": "0xf35f",
"name": "android-arrow-dropdown"
},
{
"code": "0xf35e",
"name": "android-arrow-dropdown-circle"
},
{
"code": "0xf361",
"name": "android-arrow-dropleft"
},
{
"code": "0xf360",
"name": "android-arrow-dropleft-circle"
},
{
"code": "0xf363",
"name": "android-arrow-dropright"
},
{
"code": "0xf362",
"name": "android-arrow-dropright-circle"
},
{
"code": "0xf365",
"name": "android-arrow-dropup"
},
{
"code": "0xf364",
"name": "android-arrow-dropup-circle"
},
{
"code": "0xf30f",
"name": "android-arrow-forward"
},
{
"code": "0xf366",
"name": "android-arrow-up"
},
{
"code": "0xf367",
"name": "android-attach"
},
{
"code": "0xf368",
"name": "android-bar"
},
{
"code": "0xf369",
"name": "android-bicycle"
},
{
"code": "0xf36a",
"name": "android-boat"
},
{
"code": "0xf36b",
"name": "android-bookmark"
},
{
"code": "0xf36c",
"name": "android-bulb"
},
{
"code": "0xf36d",
"name": "android-bus"
},
{
"code": "0xf2d1",
"name": "android-calendar"
},
{
"code": "0xf2d2",
"name": "android-call"
},
{
"code": "0xf2d3",
"name": "android-camera"
},
{
"code": "0xf36e",
"name": "android-cancel"
},
{
"code": "0xf36f",
"name": "android-car"
},
{
"code": "0xf370",
"name": "android-cart"
},
{
"code": "0xf2d4",
"name": "android-chat"
},
{
"code": "0xf374",
"name": "android-checkbox"
},
{
"code": "0xf371",
"name": "android-checkbox-blank"
},
{
"code": "0xf373",
"name": "android-checkbox-outline"
},
{
"code": "0xf372",
"name": "android-checkbox-outline-blank"
},
{
"code": "0xf375",
"name": "android-checkmark-circle"
},
{
"code": "0xf376",
"name": "android-clipboard"
},
{
"code": "0xf2d7",
"name": "android-close"
},
{
"code": "0xf37a",
"name": "android-cloud"
},
{
"code": "0xf377",
"name": "android-cloud-circle"
},
{
"code": "0xf378",
"name": "android-cloud-done"
},
{
"code": "0xf379",
"name": "android-cloud-outline"
},
{
"code": "0xf37b",
"name": "android-color-palette"
},
{
"code": "0xf37c",
"name": "android-compass"
},
{
"code": "0xf2d8",
"name": "android-contact"
},
{
"code": "0xf2d9",
"name": "android-contacts"
},
{
"code": "0xf37d",
"name": "android-contract"
},
{
"code": "0xf37e",
"name": "android-create"
},
{
"code": "0xf37f",
"name": "android-delete"
},
{
"code": "0xf380",
"name": "android-desktop"
},
{
"code": "0xf381",
"name": "android-document"
},
{
"code": "0xf383",
"name": "android-done"
},
{
"code": "0xf382",
"name": "android-done-all"
},
{
"code": "0xf2dd",
"name": "android-download"
},
{
"code": "0xf384",
"name": "android-drafts"
},
{
"code": "0xf385",
"name": "android-exit"
},
{
"code": "0xf386",
"name": "android-expand"
},
{
"code": "0xf388",
"name": "android-favorite"
},
{
"code": "0xf387",
"name": "android-favorite-outline"
},
{
"code": "0xf389",
"name": "android-film"
},
{
"code": "0xf2e0",
"name": "android-folder"
},
{
"code": "0xf38a",
"name": "android-folder-open"
},
{
"code": "0xf38b",
"name": "android-funnel"
},
{
"code": "0xf38c",
"name": "android-globe"
},
{
"code": "0xf2e3",
"name": "android-hand"
},
{
"code": "0xf38d",
"name": "android-hangout"
},
{
"code": "0xf38e",
"name": "android-happy"
},
{
"code": "0xf38f",
"name": "android-home"
},
{
"code": "0xf2e4",
"name": "android-image"
},
{
"code": "0xf390",
"name": "android-laptop"
},
{
"code": "0xf391",
"name": "android-list"
},
{
"code": "0xf2e9",
"name": "android-locate"
},
{
"code": "0xf392",
"name": "android-lock"
},
{
"code": "0xf2eb",
"name": "android-mail"
},
{
"code": "0xf393",
"name": "android-map"
},
{
"code": "0xf394",
"name": "android-menu"
},
{
"code": "0xf2ec",
"name": "android-microphone"
},
{
"code": "0xf395",
"name": "android-microphone-off"
},
{
"code": "0xf396",
"name": "android-more-horizontal"
},
{
"code": "0xf397",
"name": "android-more-vertical"
},
{
"code": "0xf398",
"name": "android-navigate"
},
{
"code": "0xf39b",
"name": "android-notifications"
},
{
"code": "0xf399",
"name": "android-notifications-none"
},
{
"code": "0xf39a",
"name": "android-notifications-off"
},
{
"code": "0xf39c",
"name": "android-open"
},
{
"code": "0xf39d",
"name": "android-options"
},
{
"code": "0xf39e",
"name": "android-people"
},
{
"code": "0xf3a0",
"name": "android-person"
},
{
"code": "0xf39f",
"name": "android-person-add"
},
{
"code": "0xf3a1",
"name": "android-phone-landscape"
},
{
"code": "0xf3a2",
"name": "android-phone-portrait"
},
{
"code": "0xf3a3",
"name": "android-pin"
},
{
"code": "0xf3a4",
"name": "android-plane"
},
{
"code": "0xf2f0",
"name": "android-playstore"
},
{
"code": "0xf3a5",
"name": "android-print"
},
{
"code": "0xf3a6",
"name": "android-radio-button-off"
},
{
"code": "0xf3a7",
"name": "android-radio-button-on"
},
{
"code": "0xf3a8",
"name": "android-refresh"
},
{
"code": "0xf2f4",
"name": "android-remove"
},
{
"code": "0xf3a9",
"name": "android-remove-circle"
},
{
"code": "0xf3aa",
"name": "android-restaurant"
},
{
"code": "0xf3ab",
"name": "android-sad"
},
{
"code": "0xf2f5",
"name": "android-search"
},
{
"code": "0xf2f6",
"name": "android-send"
},
{
"code": "0xf2f7",
"name": "android-settings"
},
{
"code": "0xf2f8",
"name": "android-share"
},
{
"code": "0xf3ac",
"name": "android-share-alt"
},
{
"code": "0xf2fc",
"name": "android-star"
},
{
"code": "0xf3ad",
"name": "android-star-half"
},
{
"code": "0xf3ae",
"name": "android-star-outline"
},
{
"code": "0xf2fd",
"name": "android-stopwatch"
},
{
"code": "0xf3af",
"name": "android-subway"
},
{
"code": "0xf3b0",
"name": "android-sunny"
},
{
"code": "0xf3b1",
"name": "android-sync"
},
{
"code": "0xf3b2",
"name": "android-textsms"
},
{
"code": "0xf3b3",
"name": "android-time"
},
{
"code": "0xf3b4",
"name": "android-train"
},
{
"code": "0xf3b5",
"name": "android-unlock"
},
{
"code": "0xf3b6",
"name": "android-upload"
},
{
"code": "0xf3b7",
"name": "android-volume-down"
},
{
"code": "0xf3b8",
"name": "android-volume-mute"
},
{
"code": "0xf3b9",
"name": "android-volume-off"
},
{
"code": "0xf3ba",
"name": "android-volume-up"
},
{
"code": "0xf3bb",
"name": "android-walk"
},
{
"code": "0xf3bc",
"name": "android-warning"
},
{
"code": "0xf3bd",
"name": "android-watch"
},
{
"code": "0xf305",
"name": "android-wifi"
},
{
"code": "0xf313",
"name": "aperture"
},
{
"code": "0xf102",
"name": "archive"
},
{
"code": "0xf103",
"name": "arrow-down-a"
},
{
"code": "0xf104",
"name": "arrow-down-b"
},
{
"code": "0xf105",
"name": "arrow-down-c"
},
{
"code": "0xf25e",
"name": "arrow-expand"
},
{
"code": "0xf25f",
"name": "arrow-graph-down-left"
},
{
"code": "0xf260",
"name": "arrow-graph-down-right"
},
{
"code": "0xf261",
"name": "arrow-graph-up-left"
},
{
"code": "0xf262",
"name": "arrow-graph-up-right"
},
{
"code": "0xf106",
"name": "arrow-left-a"
},
{
"code": "0xf107",
"name": "arrow-left-b"
},
{
"code": "0xf108",
"name": "arrow-left-c"
},
{
"code": "0xf263",
"name": "arrow-move"
},
{
"code": "0xf264",
"name": "arrow-resize"
},
{
"code": "0xf265",
"name": "arrow-return-left"
},
{
"code": "0xf266",
"name": "arrow-return-right"
},
{
"code": "0xf109",
"name": "arrow-right-a"
},
{
"code": "0xf10a",
"name": "arrow-right-b"
},
{
"code": "0xf10b",
"name": "arrow-right-c"
},
{
"code": "0xf267",
"name": "arrow-shrink"
},
{
"code": "0xf268",
"name": "arrow-swap"
},
{
"code": "0xf10c",
"name": "arrow-up-a"
},
{
"code": "0xf10d",
"name": "arrow-up-b"
},
{
"code": "0xf10e",
"name": "arrow-up-c"
},
{
"code": "0xf314",
"name": "asterisk"
},
{
"code": "0xf10f",
"name": "at"
},
{
"code": "0xf3bf",
"name": "backspace"
},
{
"code": "0xf3be",
"name": "backspace-outline"
},
{
"code": "0xf110",
"name": "bag"
},
{
"code": "0xf111",
"name": "battery-charging"
},
{
"code": "0xf112",
"name": "battery-empty"
},
{
"code": "0xf113",
"name": "battery-full"
},
{
"code": "0xf114",
"name": "battery-half"
},
{
"code": "0xf115",
"name": "battery-low"
},
{
"code": "0xf269",
"name": "beaker"
},
{
"code": "0xf26a",
"name": "beer"
},
{
"code": "0xf116",
"name": "bluetooth"
},
{
"code": "0xf315",
"name": "bonfire"
},
{
"code": "0xf26b",
"name": "bookmark"
},
{
"code": "0xf3c0",
"name": "bowtie"
},
{
"code": "0xf26c",
"name": "briefcase"
},
{
"code": "0xf2be",
"name": "bug"
},
{
"code": "0xf26d",
"name": "calculator"
},
{
"code": "0xf117",
"name": "calendar"
},
{
"code": "0xf118",
"name": "camera"
},
{
"code": "0xf119",
"name": "card"
},
{
"code": "0xf316",
"name": "cash"
},
{
"code": "0xf11b",
"name": "chatbox"
},
{
"code": "0xf11a",
"name": "chatbox-working"
},
{
"code": "0xf11c",
"name": "chatboxes"
},
{
"code": "0xf11e",
"name": "chatbubble"
},
{
"code": "0xf11d",
"name": "chatbubble-working"
},
{
"code": "0xf11f",
"name": "chatbubbles"
},
{
"code": "0xf122",
"name": "checkmark"
},
{
"code": "0xf120",
"name": "checkmark-circled"
},
{
"code": "0xf121",
"name": "checkmark-round"
},
{
"code": "0xf123",
"name": "chevron-down"
},
{
"code": "0xf124",
"name": "chevron-left"
},
{
"code": "0xf125",
"name": "chevron-right"
},
{
"code": "0xf126",
"name": "chevron-up"
},
{
"code": "0xf127",
"name": "clipboard"
},
{
"code": "0xf26e",
"name": "clock"
},
{
"code": "0xf12a",
"name": "close"
},
{
"code": "0xf128",
"name": "close-circled"
},
{
"code": "0xf129",
"name": "close-round"
},
{
"code": "0xf317",
"name": "closed-captioning"
},
{
"code": "0xf12b",
"name": "cloud"
},
{
"code": "0xf271",
"name": "code"
},
{
"code": "0xf26f",
"name": "code-download"
},
{
"code": "0xf270",
"name": "code-working"
},
{
"code": "0xf272",
"name": "coffee"
},
{
"code": "0xf273",
"name": "compass"
},
{
"code": "0xf12c",
"name": "compose"
},
{
"code": "0xf274",
"name": "connection-bars"
},
{
"code": "0xf275",
"name": "contrast"
},
{
"code": "0xf3c1",
"name": "crop"
},
{
"code": "0xf318",
"name": "cube"
},
{
"code": "0xf12d",
"name": "disc"
},
{
"code": "0xf12f",
"name": "document"
},
{
"code": "0xf12e",
"name": "document-text"
},
{
"code": "0xf130",
"name": "drag"
},
{
"code": "0xf276",
"name": "earth"
},
{
"code": "0xf3c2",
"name": "easel"
},
{
"code": "0xf2bf",
"name": "edit"
},
{
"code": "0xf277",
"name": "egg"
},
{
"code": "0xf131",
"name": "eject"
},
{
"code": "0xf132",
"name": "email"
},
{
"code": "0xf3c3",
"name": "email-unread"
},
{
"code": "0xf3c5",
"name": "erlenmeyer-flask"
},
{
"code": "0xf3c4",
"name": "erlenmeyer-flask-bubbles"
},
{
"code": "0xf133",
"name": "eye"
},
{
"code": "0xf306",
"name": "eye-disabled"
},
{
"code": "0xf278",
"name": "female"
},
{
"code": "0xf134",
"name": "filing"
},
{
"code": "0xf135",
"name": "film-marker"
},
{
"code": "0xf319",
"name": "fireball"
},
{
"code": "0xf279",
"name": "flag"
},
{
"code": "0xf31a",
"name": "flame"
},
{
"code": "0xf137",
"name": "flash"
},
{
"code": "0xf136",
"name": "flash-off"
},
{
"code": "0xf139",
"name": "folder"
},
{
"code": "0xf27a",
"name": "fork"
},
{
"code": "0xf2c0",
"name": "fork-repo"
},
{
"code": "0xf13a",
"name": "forward"
},
{
"code": "0xf31b",
"name": "funnel"
},
{
"code": "0xf13d",
"name": "gear-a"
},
{
"code": "0xf13e",
"name": "gear-b"
},
{
"code": "0xf13f",
"name": "grid"
},
{
"code": "0xf27b",
"name": "hammer"
},
{
"code": "0xf31c",
"name": "happy"
},
{
"code": "0xf3c6",
"name": "happy-outline"
},
{
"code": "0xf140",
"name": "headphone"
},
{
"code": "0xf141",
"name": "heart"
},
{
"code": "0xf31d",
"name": "heart-broken"
},
{
"code": "0xf143",
"name": "help"
},
{
"code": "0xf27c",
"name": "help-buoy"
},
{
"code": "0xf142",
"name": "help-circled"
},
{
"code": "0xf144",
"name": "home"
},
{
"code": "0xf27d",
"name": "icecream"
},
{
"code": "0xf147",
"name": "image"
},
{
"code": "0xf148",
"name": "images"
},
{
"code": "0xf14a",
"name": "information"
},
{
"code": "0xf149",
"name": "information-circled"
},
{
"code": "0xf14b",
"name": "ionic"
},
{
"code": "0xf3c8",
"name": "ios-alarm"
},
{
"code": "0xf3c7",
"name": "ios-alarm-outline"
},
{
"code": "0xf3ca",
"name": "ios-albums"
},
{
"code": "0xf3c9",
"name": "ios-albums-outline"
},
{
"code": "0xf3cc",
"name": "ios-americanfootball"
},
{
"code": "0xf3cb",
"name": "ios-americanfootball-outline"
},
{
"code": "0xf3ce",
"name": "ios-analytics"
},
{
"code": "0xf3cd",
"name": "ios-analytics-outline"
},
{
"code": "0xf3cf",
"name": "ios-arrow-back"
},
{
"code": "0xf3d0",
"name": "ios-arrow-down"
},
{
"code": "0xf3d1",
"name": "ios-arrow-forward"
},
{
"code": "0xf3d2",
"name": "ios-arrow-left"
},
{
"code": "0xf3d3",
"name": "ios-arrow-right"
},
{
"code": "0xf3d4",
"name": "ios-arrow-thin-down"
},
{
"code": "0xf3d5",
"name": "ios-arrow-thin-left"
},
{
"code": "0xf3d6",
"name": "ios-arrow-thin-right"
},
{
"code": "0xf3d7",
"name": "ios-arrow-thin-up"
},
{
"code": "0xf3d8",
"name": "ios-arrow-up"
},
{
"code": "0xf3da",
"name": "ios-at"
},
{
"code": "0xf3d9",
"name": "ios-at-outline"
},
{
"code": "0xf3dc",
"name": "ios-barcode"
},
{
"code": "0xf3db",
"name": "ios-barcode-outline"
},
{
"code": "0xf3de",
"name": "ios-baseball"
},
{
"code": "0xf3dd",
"name": "ios-baseball-outline"
},
{
"code": "0xf3e0",
"name": "ios-basketball"
},
{
"code": "0xf3df",
"name": "ios-basketball-outline"
},
{
"code": "0xf3e2",
"name": "ios-bell"
},
{
"code": "0xf3e1",
"name": "ios-bell-outline"
},
{
"code": "0xf3e4",
"name": "ios-body"
},
{
"code": "0xf3e3",
"name": "ios-body-outline"
},
{
"code": "0xf3e6",
"name": "ios-bolt"
},
{
"code": "0xf3e5",
"name": "ios-bolt-outline"
},
{
"code": "0xf3e8",
"name": "ios-book"
},
{
"code": "0xf3e7",
"name": "ios-book-outline"
},
{
"code": "0xf3ea",
"name": "ios-bookmarks"
},
{
"code": "0xf3e9",
"name": "ios-bookmarks-outline"
},
{
"code": "0xf3ec",
"name": "ios-box"
},
{
"code": "0xf3eb",
"name": "ios-box-outline"
},
{
"code": "0xf3ee",
"name": "ios-briefcase"
},
{
"code": "0xf3ed",
"name": "ios-briefcase-outline"
},
{
"code": "0xf3f0",
"name": "ios-browsers"
},
{
"code": "0xf3ef",
"name": "ios-browsers-outline"
},
{
"code": "0xf3f2",
"name": "ios-calculator"
},
{
"code": "0xf3f1",
"name": "ios-calculator-outline"
},
{
"code": "0xf3f4",
"name": "ios-calendar"
},
{
"code": "0xf3f3",
"name": "ios-calendar-outline"
},
{
"code": "0xf3f6",
"name": "ios-camera"
},
{
"code": "0xf3f5",
"name": "ios-camera-outline"
},
{
"code": "0xf3f8",
"name": "ios-cart"
},
{
"code": "0xf3f7",
"name": "ios-cart-outline"
},
{
"code": "0xf3fa",
"name": "ios-chatboxes"
},
{
"code": "0xf3f9",
"name": "ios-chatboxes-outline"
},
{
"code": "0xf3fc",
"name": "ios-chatbubble"
},
{
"code": "0xf3fb",
"name": "ios-chatbubble-outline"
},
{
"code": "0xf3ff",
"name": "ios-checkmark"
},
{
"code": "0xf3fd",
"name": "ios-checkmark-empty"
},
{
"code": "0xf3fe",
"name": "ios-checkmark-outline"
},
{
"code": "0xf400",
"name": "ios-circle-filled"
},
{
"code": "0xf401",
"name": "ios-circle-outline"
},
{
"code": "0xf403",
"name": "ios-clock"
},
{
"code": "0xf402",
"name": "ios-clock-outline"
},
{
"code": "0xf406",
"name": "ios-close"
},
{
"code": "0xf404",
"name": "ios-close-empty"
},
{
"code": "0xf405",
"name": "ios-close-outline"
},
{
"code": "0xf40c",
"name": "ios-cloud"
},
{
"code": "0xf408",
"name": "ios-cloud-download"
},
{
"code": "0xf407",
"name": "ios-cloud-download-outline"
},
{
"code": "0xf409",
"name": "ios-cloud-outline"
},
{
"code": "0xf40b",
"name": "ios-cloud-upload"
},
{
"code": "0xf40a",
"name": "ios-cloud-upload-outline"
},
{
"code": "0xf410",
"name": "ios-cloudy"
},
{
"code": "0xf40e",
"name": "ios-cloudy-night"
},
{
"code": "0xf40d",
"name": "ios-cloudy-night-outline"
},
{
"code": "0xf40f",
"name": "ios-cloudy-outline"
},
{
"code": "0xf412",
"name": "ios-cog"
},
{
"code": "0xf411",
"name": "ios-cog-outline"
},
{
"code": "0xf414",
"name": "ios-color-filter"
},
{
"code": "0xf413",
"name": "ios-color-filter-outline"
},
{
"code": "0xf416",
"name": "ios-color-wand"
},
{
"code": "0xf415",
"name": "ios-color-wand-outline"
},
{
"code": "0xf418",
"name": "ios-compose"
},
{
"code": "0xf417",
"name": "ios-compose-outline"
},
{
"code": "0xf41a",
"name": "ios-contact"
},
{
"code": "0xf419",
"name": "ios-contact-outline"
},
{
"code": "0xf41c",
"name": "ios-copy"
},
{
"code": "0xf41b",
"name": "ios-copy-outline"
},
{
"code": "0xf41e",
"name": "ios-crop"
},
{
"code": "0xf41d",
"name": "ios-crop-strong"
},
{
"code": "0xf420",
"name": "ios-download"
},
{
"code": "0xf41f",
"name": "ios-download-outline"
},
{
"code": "0xf421",
"name": "ios-drag"
},
{
"code": "0xf423",
"name": "ios-email"
},
{
"code": "0xf422",
"name": "ios-email-outline"
},
{
"code": "0xf425",
"name": "ios-eye"
},
{
"code": "0xf424",
"name": "ios-eye-outline"
},
{
"code": "0xf427",
"name": "ios-fastforward"
},
{
"code": "0xf426",
"name": "ios-fastforward-outline"
},
{
"code": "0xf429",
"name": "ios-filing"
},
{
"code": "0xf428",
"name": "ios-filing-outline"
},
{
"code": "0xf42b",
"name": "ios-film"
},
{
"code": "0xf42a",
"name": "ios-film-outline"
},
{
"code": "0xf42d",
"name": "ios-flag"
},
{
"code": "0xf42c",
"name": "ios-flag-outline"
},
{
"code": "0xf42f",
"name": "ios-flame"
},
{
"code": "0xf42e",
"name": "ios-flame-outline"
},
{
"code": "0xf431",
"name": "ios-flask"
},
{
"code": "0xf430",
"name": "ios-flask-outline"
},
{
"code": "0xf433",
"name": "ios-flower"
},
{
"code": "0xf432",
"name": "ios-flower-outline"
},
{
"code": "0xf435",
"name": "ios-folder"
},
{
"code": "0xf434",
"name": "ios-folder-outline"
},
{
"code": "0xf437",
"name": "ios-football"
},
{
"code": "0xf436",
"name": "ios-football-outline"
},
{
"code": "0xf439",
"name": "ios-game-controller-a"
},
{
"code": "0xf438",
"name": "ios-game-controller-a-outline"
},
{
"code": "0xf43b",
"name": "ios-game-controller-b"
},
{
"code": "0xf43a",
"name": "ios-game-controller-b-outline"
},
{
"code": "0xf43d",
"name": "ios-gear"
},
{
"code": "0xf43c",
"name": "ios-gear-outline"
},
{
"code": "0xf43f",
"name": "ios-glasses"
},
{
"code": "0xf43e",
"name": "ios-glasses-outline"
},
{
"code": "0xf441",
"name": "ios-grid-view"
},
{
"code": "0xf440",
"name": "ios-grid-view-outline"
},
{
"code": "0xf443",
"name": "ios-heart"
},
{
"code": "0xf442",
"name": "ios-heart-outline"
},
{
"code": "0xf446",
"name": "ios-help"
},
{
"code": "0xf444",
"name": "ios-help-empty"
},
{
"code": "0xf445",
"name": "ios-help-outline"
},
{
"code": "0xf448",
"name": "ios-home"
},
{
"code": "0xf447",
"name": "ios-home-outline"
},
{
"code": "0xf44a",
"name": "ios-infinite"
},
{
"code": "0xf449",
"name": "ios-infinite-outline"
},
{
"code": "0xf44d",
"name": "ios-information"
},
{
"code": "0xf44b",
"name": "ios-information-empty"
},
{
"code": "0xf44c",
"name": "ios-information-outline"
},
{
"code": "0xf44e",
"name": "ios-ionic-outline"
},
{
"code": "0xf450",
"name": "ios-keypad"
},
{
"code": "0xf44f",
"name": "ios-keypad-outline"
},
{
"code": "0xf452",
"name": "ios-lightbulb"
},
{
"code": "0xf451",
"name": "ios-lightbulb-outline"
},
{
"code": "0xf454",
"name": "ios-list"
},
{
"code": "0xf453",
"name": "ios-list-outline"
},
{
"code": "0xf456",
"name": "ios-location"
},
{
"code": "0xf455",
"name": "ios-location-outline"
},
{
"code": "0xf458",
"name": "ios-locked"
},
{
"code": "0xf457",
"name": "ios-locked-outline"
},
{
"code": "0xf45a",
"name": "ios-loop"
},
{
"code": "0xf459",
"name": "ios-loop-strong"
},
{
"code": "0xf45c",
"name": "ios-medical"
},
{
"code": "0xf45b",
"name": "ios-medical-outline"
},
{
"code": "0xf45e",
"name": "ios-medkit"
},
{
"code": "0xf45d",
"name": "ios-medkit-outline"
},
{
"code": "0xf461",
"name": "ios-mic"
},
{
"code": "0xf45f",
"name": "ios-mic-off"
},
{
"code": "0xf460",
"name": "ios-mic-outline"
},
{
"code": "0xf464",
"name": "ios-minus"
},
{
"code": "0xf462",
"name": "ios-minus-empty"
},
{
"code": "0xf463",
"name": "ios-minus-outline"
},
{
"code": "0xf466",
"name": "ios-monitor"
},
{
"code": "0xf465",
"name": "ios-monitor-outline"
},
{
"code": "0xf468",
"name": "ios-moon"
},
{
"code": "0xf467",
"name": "ios-moon-outline"
},
{
"code": "0xf46a",
"name": "ios-more"
},
{
"code": "0xf469",
"name": "ios-more-outline"
},
{
"code": "0xf46b",
"name": "ios-musical-note"
},
{
"code": "0xf46c",
"name": "ios-musical-notes"
},
{
"code": "0xf46e",
"name": "ios-navigate"
},
{
"code": "0xf46d",
"name": "ios-navigate-outline"
},
{
"code": "0xf470",
"name": "ios-nutrition"
},
{
"code": "0xf46f",
"name": "ios-nutrition-outline"
},
{
"code": "0xf472",
"name": "ios-paper"
},
{
"code": "0xf471",
"name": "ios-paper-outline"
},
{
"code": "0xf474",
"name": "ios-paperplane"
},
{
"code": "0xf473",
"name": "ios-paperplane-outline"
},
{
"code": "0xf476",
"name": "ios-partlysunny"
},
{
"code": "0xf475",
"name": "ios-partlysunny-outline"
},
{
"code": "0xf478",
"name": "ios-pause"
},
{
"code": "0xf477",
"name": "ios-pause-outline"
},
{
"code": "0xf47a",
"name": "ios-paw"
},
{
"code": "0xf479",
"name": "ios-paw-outline"
},
{
"code": "0xf47c",
"name": "ios-people"
},
{
"code": "0xf47b",
"name": "ios-people-outline"
},
{
"code": "0xf47e",
"name": "ios-person"
},
{
"code": "0xf47d",
"name": "ios-person-outline"
},
{
"code": "0xf480",
"name": "ios-personadd"
},
{
"code": "0xf47f",
"name": "ios-personadd-outline"
},
{
"code": "0xf482",
"name": "ios-photos"
},
{
"code": "0xf481",
"name": "ios-photos-outline"
},
{
"code": "0xf484",
"name": "ios-pie"
},
{
"code": "0xf483",
"name": "ios-pie-outline"
},
{
"code": "0xf486",
"name": "ios-pint"
},
{
"code": "0xf485",
"name": "ios-pint-outline"
},
{
"code": "0xf488",
"name": "ios-play"
},
{
"code": "0xf487",
"name": "ios-play-outline"
},
{
"code": "0xf48b",
"name": "ios-plus"
},
{
"code": "0xf489",
"name": "ios-plus-empty"
},
{
"code": "0xf48a",
"name": "ios-plus-outline"
},
{
"code": "0xf48d",
"name": "ios-pricetag"
},
{
"code": "0xf48c",
"name": "ios-pricetag-outline"
},
{
"code": "0xf48f",
"name": "ios-pricetags"
},
{
"code": "0xf48e",
"name": "ios-pricetags-outline"
},
{
"code": "0xf491",
"name": "ios-printer"
},
{
"code": "0xf490",
"name": "ios-printer-outline"
},
{
"code": "0xf493",
"name": "ios-pulse"
},
{
"code": "0xf492",
"name": "ios-pulse-strong"
},
{
"code": "0xf495",
"name": "ios-rainy"
},
{
"code": "0xf494",
"name": "ios-rainy-outline"
},
{
"code": "0xf497",
"name": "ios-recording"
},
{
"code": "0xf496",
"name": "ios-recording-outline"
},
{
"code": "0xf499",
"name": "ios-redo"
},
{
"code": "0xf498",
"name": "ios-redo-outline"
},
{
"code": "0xf49c",
"name": "ios-refresh"
},
{
"code": "0xf49a",
"name": "ios-refresh-empty"
},
{
"code": "0xf49b",
"name": "ios-refresh-outline"
},
{
"code": "0xf49d",
"name": "ios-reload"
},
{
"code": "0xf49f",
"name": "ios-reverse-camera"
},
{
"code": "0xf49e",
"name": "ios-reverse-camera-outline"
},
{
"code": "0xf4a1",
"name": "ios-rewind"
},
{
"code": "0xf4a0",
"name": "ios-rewind-outline"
},
{
"code": "0xf4a3",
"name": "ios-rose"
},
{
"code": "0xf4a2",
"name": "ios-rose-outline"
},
{
"code": "0xf4a5",
"name": "ios-search"
},
{
"code": "0xf4a4",
"name": "ios-search-strong"
},
{
"code": "0xf4a7",
"name": "ios-settings"
},
{
"code": "0xf4a6",
"name": "ios-settings-strong"
},
{
"code": "0xf4a9",
"name": "ios-shuffle"
},
{
"code": "0xf4a8",
"name": "ios-shuffle-strong"
},
{
"code": "0xf4ab",
"name": "ios-skipbackward"
},
{
"code": "0xf4aa",
"name": "ios-skipbackward-outline"
},
{
"code": "0xf4ad",
"name": "ios-skipforward"
},
{
"code": "0xf4ac",
"name": "ios-skipforward-outline"
},
{
"code": "0xf4ae",
"name": "ios-snowy"
},
{
"code": "0xf4b0",
"name": "ios-speedometer"
},
{
"code": "0xf4af",
"name": "ios-speedometer-outline"
},
{
"code": "0xf4b3",
"name": "ios-star"
},
{
"code": "0xf4b1",
"name": "ios-star-half"
},
{
"code": "0xf4b2",
"name": "ios-star-outline"
},
{
"code": "0xf4b5",
"name": "ios-stopwatch"
},
{
"code": "0xf4b4",
"name": "ios-stopwatch-outline"
},
{
"code": "0xf4b7",
"name": "ios-sunny"
},
{
"code": "0xf4b6",
"name": "ios-sunny-outline"
},
{
"code": "0xf4b9",
"name": "ios-telephone"
},
{
"code": "0xf4b8",
"name": "ios-telephone-outline"
},
{
"code": "0xf4bb",
"name": "ios-tennisball"
},
{
"code": "0xf4ba",
"name": "ios-tennisball-outline"
},
{
"code": "0xf4bd",
"name": "ios-thunderstorm"
},
{
"code": "0xf4bc",
"name": "ios-thunderstorm-outline"
},
{
"code": "0xf4bf",
"name": "ios-time"
},
{
"code": "0xf4be",
"name": "ios-time-outline"
},
{
"code": "0xf4c1",
"name": "ios-timer"
},
{
"code": "0xf4c0",
"name": "ios-timer-outline"
},
{
"code": "0xf4c3",
"name": "ios-toggle"
},
{
"code": "0xf4c2",
"name": "ios-toggle-outline"
},
{
"code": "0xf4c5",
"name": "ios-trash"
},
{
"code": "0xf4c4",
"name": "ios-trash-outline"
},
{
"code": "0xf4c7",
"name": "ios-undo"
},
{
"code": "0xf4c6",
"name": "ios-undo-outline"
},
{
"code": "0xf4c9",
"name": "ios-unlocked"
},
{
"code": "0xf4c8",
"name": "ios-unlocked-outline"
},
{
"code": "0xf4cb",
"name": "ios-upload"
},
{
"code": "0xf4ca",
"name": "ios-upload-outline"
},
{
"code": "0xf4cd",
"name": "ios-videocam"
},
{
"code": "0xf4cc",
"name": "ios-videocam-outline"
},
{
"code": "0xf4ce",
"name": "ios-volume-high"
},
{
"code": "0xf4cf",
"name": "ios-volume-low"
},
{
"code": "0xf4d1",
"name": "ios-wineglass"
},
{
"code": "0xf4d0",
"name": "ios-wineglass-outline"
},
{
"code": "0xf4d3",
"name": "ios-world"
},
{
"code": "0xf4d2",
"name": "ios-world-outline"
},
{
"code": "0xf1f9",
"name": "ipad"
},
{
"code": "0xf1fa",
"name": "iphone"
},
{
"code": "0xf1fb",
"name": "ipod"
},
{
"code": "0xf295",
"name": "jet"
},
{
"code": "0xf296",
"name": "key"
},
{
"code": "0xf297",
"name": "knife"
},
{
"code": "0xf1fc",
"name": "laptop"
},
{
"code": "0xf1fd",
"name": "leaf"
},
{
"code": "0xf298",
"name": "levels"
},
{
"code": "0xf299",
"name": "lightbulb"
},
{
"code": "0xf1fe",
"name": "link"
},
{
"code": "0xf29a",
"name": "load-a"
},
{
"code": "0xf29b",
"name": "load-b"
},
{
"code": "0xf29c",
"name": "load-c"
},
{
"code": "0xf29d",
"name": "load-d"
},
{
"code": "0xf1ff",
"name": "location"
},
{
"code": "0xf4d4",
"name": "lock-combination"
},
{
"code": "0xf200",
"name": "locked"
},
{
"code": "0xf29e",
"name": "log-in"
},
{
"code": "0xf29f",
"name": "log-out"
},
{
"code": "0xf201",
"name": "loop"
},
{
"code": "0xf2a0",
"name": "magnet"
},
{
"code": "0xf2a1",
"name": "male"
},
{
"code": "0xf202",
"name": "man"
},
{
"code": "0xf203",
"name": "map"
},
{
"code": "0xf2a2",
"name": "medkit"
},
{
"code": "0xf33f",
"name": "merge"
},
{
"code": "0xf204",
"name": "mic-a"
},
{
"code": "0xf205",
"name": "mic-b"
},
{
"code": "0xf206",
"name": "mic-c"
},
{
"code": "0xf209",
"name": "minus"
},
{
"code": "0xf207",
"name": "minus-circled"
},
{
"code": "0xf208",
"name": "minus-round"
},
{
"code": "0xf2c1",
"name": "model-s"
},
{
"code": "0xf20a",
"name": "monitor"
},
{
"code": "0xf20b",
"name": "more"
},
{
"code": "0xf340",
"name": "mouse"
},
{
"code": "0xf20c",
"name": "music-note"
},
{
"code": "0xf20e",
"name": "navicon"
},
{
"code": "0xf20d",
"name": "navicon-round"
},
{
"code": "0xf2a3",
"name": "navigate"
},
{
"code": "0xf341",
"name": "network"
},
{
"code": "0xf2c2",
"name": "no-smoking"
},
{
"code": "0xf2a4",
"name": "nuclear"
},
{
"code": "0xf342",
"name": "outlet"
},
{
"code": "0xf4d5",
"name": "paintbrush"
},
{
"code": "0xf4d6",
"name": "paintbucket"
},
{
"code": "0xf2c3",
"name": "paper-airplane"
},
{
"code": "0xf20f",
"name": "paperclip"
},
{
"code": "0xf210",
"name": "pause"
},
{
"code": "0xf213",
"name": "person"
},
{
"code": "0xf211",
"name": "person-add"
},
{
"code": "0xf212",
"name": "person-stalker"
},
{
"code": "0xf2a5",
"name": "pie-graph"
},
{
"code": "0xf2a6",
"name": "pin"
},
{
"code": "0xf2a7",
"name": "pinpoint"
},
{
"code": "0xf2a8",
"name": "pizza"
},
{
"code": "0xf214",
"name": "plane"
},
{
"code": "0xf343",
"name": "planet"
},
{
"code": "0xf215",
"name": "play"
},
{
"code": "0xf30a",
"name": "playstation"
},
{
"code": "0xf218",
"name": "plus"
},
{
"code": "0xf216",
"name": "plus-circled"
},
{
"code": "0xf217",
"name": "plus-round"
},
{
"code": "0xf344",
"name": "podium"
},
{
"code": "0xf219",
"name": "pound"
},
{
"code": "0xf2a9",
"name": "power"
},
{
"code": "0xf2aa",
"name": "pricetag"
},
{
"code": "0xf2ab",
"name": "pricetags"
},
{
"code": "0xf21a",
"name": "printer"
},
{
"code": "0xf345",
"name": "pull-request"
},
{
"code": "0xf346",
"name": "qr-scanner"
},
{
"code": "0xf347",
"name": "quote"
},
{
"code": "0xf2ac",
"name": "radio-waves"
},
{
"code": "0xf21b",
"name": "record"
},
{
"code": "0xf21c",
"name": "refresh"
},
{
"code": "0xf21e",
"name": "reply"
},
{
"code": "0xf21d",
"name": "reply-all"
},
{
"code": "0xf348",
"name": "ribbon-a"
},
{
"code": "0xf349",
"name": "ribbon-b"
},
{
"code": "0xf34a",
"name": "sad"
},
{
"code": "0xf4d7",
"name": "sad-outline"
},
{
"code": "0xf34b",
"name": "scissors"
},
{
"code": "0xf21f",
"name": "search"
},
{
"code": "0xf2ad",
"name": "settings"
},
{
"code": "0xf220",
"name": "share"
},
{
"code": "0xf221",
"name": "shuffle"
},
{
"code": "0xf222",
"name": "skip-backward"
},
{
"code": "0xf223",
"name": "skip-forward"
},
{
"code": "0xf225",
"name": "social-android"
},
{
"code": "0xf224",
"name": "social-android-outline"
},
{
"code": "0xf4d9",
"name": "social-angular"
},
{
"code": "0xf4d8",
"name": "social-angular-outline"
},
{
"code": "0xf227",
"name": "social-apple"
},
{
"code": "0xf226",
"name": "social-apple-outline"
},
{
"code": "0xf2af",
"name": "social-bitcoin"
},
{
"code": "0xf2ae",
"name": "social-bitcoin-outline"
},
{
"code": "0xf229",
"name": "social-buffer"
},
{
"code": "0xf228",
"name": "social-buffer-outline"
},
{
"code": "0xf4db",
"name": "social-chrome"
},
{
"code": "0xf4da",
"name": "social-chrome-outline"
},
{
"code": "0xf4dd",
"name": "social-codepen"
},
{
"code": "0xf4dc",
"name": "social-codepen-outline"
},
{
"code": "0xf4df",
"name": "social-css3"
},
{
"code": "0xf4de",
"name": "social-css3-outline"
},
{
"code": "0xf22b",
"name": "social-designernews"
},
{
"code": "0xf22a",
"name": "social-designernews-outline"
},
{
"code": "0xf22d",
"name": "social-dribbble"
},
{
"code": "0xf22c",
"name": "social-dribbble-outline"
},
{
"code": "0xf22f",
"name": "social-dropbox"
},
{
"code": "0xf22e",
"name": "social-dropbox-outline"
},
{
"code": "0xf4e1",
"name": "social-euro"
},
{
"code": "0xf4e0",
"name": "social-euro-outline"
},
{
"code": "0xf231",
"name": "social-facebook"
},
{
"code": "0xf230",
"name": "social-facebook-outline"
},
{
"code": "0xf34d",
"name": "social-foursquare"
},
{
"code": "0xf34c",
"name": "social-foursquare-outline"
},
{
"code": "0xf2c4",
"name": "social-freebsd-devil"
},
{
"code": "0xf233",
"name": "social-github"
},
{
"code": "0xf232",
"name": "social-github-outline"
},
{
"code": "0xf34f",
"name": "social-google"
},
{
"code": "0xf34e",
"name": "social-google-outline"
},
{
"code": "0xf235",
"name": "social-googleplus"
},
{
"code": "0xf234",
"name": "social-googleplus-outline"
},
{
"code": "0xf237",
"name": "social-hackernews"
},
{
"code": "0xf236",
"name": "social-hackernews-outline"
},
{
"code": "0xf4e3",
"name": "social-html5"
},
{
"code": "0xf4e2",
"name": "social-html5-outline"
},
{
"code": "0xf351",
"name": "social-instagram"
},
{
"code": "0xf350",
"name": "social-instagram-outline"
},
{
"code": "0xf4e5",
"name": "social-javascript"
},
{
"code": "0xf4e4",
"name": "social-javascript-outline"
},
{
"code": "0xf239",
"name": "social-linkedin"
},
{
"code": "0xf238",
"name": "social-linkedin-outline"
},
{
"code": "0xf4e6",
"name": "social-markdown"
},
{
"code": "0xf4e7",
"name": "social-nodejs"
},
{
"code": "0xf4e8",
"name": "social-octocat"
},
{
"code": "0xf2b1",
"name": "social-pinterest"
},
{
"code": "0xf2b0",
"name": "social-pinterest-outline"
},
{
"code": "0xf4e9",
"name": "social-python"
},
{
"code": "0xf23b",
"name": "social-reddit"
},
{
"code": "0xf23a",
"name": "social-reddit-outline"
},
{
"code": "0xf23d",
"name": "social-rss"
},
{
"code": "0xf23c",
"name": "social-rss-outline"
},
{
"code": "0xf4ea",
"name": "social-sass"
},
{
"code": "0xf23f",
"name": "social-skype"
},
{
"code": "0xf23e",
"name": "social-skype-outline"
},
{
"code": "0xf4ec",
"name": "social-snapchat"
},
{
"code": "0xf4eb",
"name": "social-snapchat-outline"
},
{
"code": "0xf241",
"name": "social-tumblr"
},
{
"code": "0xf240",
"name": "social-tumblr-outline"
},
{
"code": "0xf2c5",
"name": "social-tux"
},
{
"code": "0xf4ee",
"name": "social-twitch"
},
{
"code": "0xf4ed",
"name": "social-twitch-outline"
},
{
"code": "0xf243",
"name": "social-twitter"
},
{
"code": "0xf242",
"name": "social-twitter-outline"
},
{
"code": "0xf353",
"name": "social-usd"
},
{
"code": "0xf352",
"name": "social-usd-outline"
},
{
"code": "0xf245",
"name": "social-vimeo"
},
{
"code": "0xf244",
"name": "social-vimeo-outline"
},
{
"code": "0xf4f0",
"name": "social-whatsapp"
},
{
"code": "0xf4ef",
"name": "social-whatsapp-outline"
},
{
"code": "0xf247",
"name": "social-windows"
},
{
"code": "0xf246",
"name": "social-windows-outline"
},
{
"code": "0xf249",
"name": "social-wordpress"
},
{
"code": "0xf248",
"name": "social-wordpress-outline"
},
{
"code": "0xf24b",
"name": "social-yahoo"
},
{
"code": "0xf24a",
"name": "social-yahoo-outline"
},
{
"code": "0xf4f2",
"name": "social-yen"
},
{
"code": "0xf4f1",
"name": "social-yen-outline"
},
{
"code": "0xf24d",
"name": "social-youtube"
},
{
"code": "0xf24c",
"name": "social-youtube-outline"
},
{
"code": "0xf4f4",
"name": "soup-can"
},
{
"code": "0xf4f3",
"name": "soup-can-outline"
},
{
"code": "0xf2b2",
"name": "speakerphone"
},
{
"code": "0xf2b3",
"name": "speedometer"
},
{
"code": "0xf2b4",
"name": "spoon"
},
{
"code": "0xf24e",
"name": "star"
},
{
"code": "0xf2b5",
"name": "stats-bars"
},
{
"code": "0xf30b",
"name": "steam"
},
{
"code": "0xf24f",
"name": "stop"
},
{
"code": "0xf2b6",
"name": "thermometer"
},
{
"code": "0xf250",
"name": "thumbsdown"
},
{
"code": "0xf251",
"name": "thumbsup"
},
{
"code": "0xf355",
"name": "toggle"
},
{
"code": "0xf354",
"name": "toggle-filled"
},
{
"code": "0xf4f5",
"name": "transgender"
},
{
"code": "0xf252",
"name": "trash-a"
},
{
"code": "0xf253",
"name": "trash-b"
},
{
"code": "0xf356",
"name": "trophy"
},
{
"code": "0xf4f7",
"name": "tshirt"
},
{
"code": "0xf4f6",
"name": "tshirt-outline"
},
{
"code": "0xf2b7",
"name": "umbrella"
},
{
"code": "0xf357",
"name": "university"
},
{
"code": "0xf254",
"name": "unlocked"
},
{
"code": "0xf255",
"name": "upload"
},
{
"code": "0xf2b8",
"name": "usb"
},
{
"code": "0xf256",
"name": "videocamera"
},
{
"code": "0xf257",
"name": "volume-high"
},
{
"code": "0xf258",
"name": "volume-low"
},
{
"code": "0xf259",
"name": "volume-medium"
},
{
"code": "0xf25a",
"name": "volume-mute"
},
{
"code": "0xf358",
"name": "wand"
},
{
"code": "0xf25b",
"name": "waterdrop"
},
{
"code": "0xf25c",
"name": "wifi"
},
{
"code": "0xf2b9",
"name": "wineglass"
},
{
"code": "0xf25d",
"name": "woman"
},
{
"code": "0xf2ba",
"name": "wrench"
},
{
"code": "0xf30c",
"name": "xbox"
}
]
} scripts/generate_font.py 0000664 00000012405 15243426175 0011442 0 ustar 00 # Font generation script from FontCustom
# https://github.com/FontCustom/fontcustom/
# http://fontcustom.com/
import fontforge
import os
import md5
import subprocess
import tempfile
import json
import copy
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', 'src')
OUTPUT_FONT_DIR = os.path.join(SCRIPT_PATH, '..', '..', 'fonts')
MANIFEST_PATH = os.path.join(SCRIPT_PATH, '..', 'manifest.json')
BUILD_DATA_PATH = os.path.join(SCRIPT_PATH, '..', 'build_data.json')
AUTO_WIDTH = True
KERNING = 15
cp = 0xf100
m = md5.new()
f = fontforge.font()
f.encoding = 'UnicodeFull'
f.design_size = 16
f.em = 512
f.ascent = 448
f.descent = 64
manifest_file = open(MANIFEST_PATH, 'r')
manifest_data = json.loads(manifest_file.read())
manifest_file.close()
print "Load Manifest, Icons: %s" % ( len(manifest_data['icons']) )
build_data = copy.deepcopy(manifest_data)
build_data['icons'] = []
font_name = manifest_data['name']
m.update(font_name + ';')
m.update(manifest_data['prefix'] + ';')
for dirname, dirnames, filenames in os.walk(INPUT_SVG_DIR):
for filename in filenames:
name, ext = os.path.splitext(filename)
filePath = os.path.join(dirname, filename)
size = os.path.getsize(filePath)
if ext in ['.svg', '.eps']:
# see if this file is already in the manifest
chr_code = None
for ionicon in manifest_data['icons']:
if ionicon['name'] == name:
chr_code = ionicon['code']
break
if chr_code is None:
# this is a new src icon
print 'New Icon: \n - %s' % (name)
while True:
chr_code = '0x%x' % (cp)
already_exists = False
for ionicon in manifest_data['icons']:
if ionicon.get('code') == chr_code:
already_exists = True
cp += 1
chr_code = '0x%x' % (cp)
continue
if not already_exists:
break
print ' - %s' % chr_code
manifest_data['icons'].append({
'name': name,
'code': chr_code
})
build_data['icons'].append({
'name': name,
'code': chr_code
})
if ext in ['.svg']:
# hack removal of <switch> </switch> tags
svgfile = open(filePath, 'r+')
tmpsvgfile = tempfile.NamedTemporaryFile(suffix=ext, delete=False)
svgtext = svgfile.read()
svgfile.seek(0)
# replace the <switch> </switch> tags with 'nothing'
svgtext = svgtext.replace('<switch>', '')
svgtext = svgtext.replace('</switch>', '')
tmpsvgfile.file.write(svgtext)
svgfile.close()
tmpsvgfile.file.close()
filePath = tmpsvgfile.name
# end hack
m.update(name + str(size) + ';')
glyph = f.createChar( int(chr_code, 16) )
glyph.importOutlines(filePath)
# if we created a temporary file, let's clean it up
if tmpsvgfile:
os.unlink(tmpsvgfile.name)
# set glyph size explicitly or automatically depending on autowidth
if AUTO_WIDTH:
glyph.left_side_bearing = glyph.right_side_bearing = 0
glyph.round()
# resize glyphs if autowidth is enabled
if AUTO_WIDTH:
f.autoWidth(0, 0, 512)
fontfile = '%s/ionicons' % (OUTPUT_FONT_DIR)
build_hash = m.hexdigest()
if build_hash == manifest_data.get('build_hash'):
print "Source files unchanged, did not rebuild fonts"
else:
manifest_data['build_hash'] = build_hash
f.fontname = font_name
f.familyname = font_name
f.fullname = font_name
f.generate(fontfile + '.ttf')
f.generate(fontfile + '.svg')
# Fix SVG header for webkit
# from: https://github.com/fontello/font-builder/blob/master/bin/fontconvert.py
svgfile = open(fontfile + '.svg', 'r+')
svgtext = svgfile.read()
svgfile.seek(0)
svgfile.write(svgtext.replace('''<svg>''', '''<svg xmlns="http://www.w3.org/2000/svg">'''))
svgfile.close()
scriptPath = os.path.dirname(os.path.realpath(__file__))
try:
subprocess.Popen([scriptPath + '/sfnt2woff', fontfile + '.ttf'], stdout=subprocess.PIPE)
except OSError:
# If the local version of sfnt2woff fails (i.e., on Linux), try to use the
# global version. This allows us to avoid forcing OS X users to compile
# sfnt2woff from source, simplifying install.
subprocess.call(['sfnt2woff', fontfile + '.ttf'])
# eotlitetool.py script to generate IE7-compatible .eot fonts
subprocess.call('python ' + scriptPath + '/eotlitetool.py ' + fontfile + '.ttf -o ' + fontfile + '.eot', shell=True)
subprocess.call('mv ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True)
# Hint the TTF file
subprocess.call('ttfautohint -s -f -n ' + fontfile + '.ttf ' + fontfile + '-hinted.ttf > /dev/null 2>&1 && mv ' + fontfile + '-hinted.ttf ' + fontfile + '.ttf', shell=True)
manifest_data['icons'] = sorted(manifest_data['icons'], key=lambda k: k['name'])
build_data['icons'] = sorted(build_data['icons'], key=lambda k: k['name'])
print "Save Manifest, Icons: %s" % ( len(manifest_data['icons']) )
f = open(MANIFEST_PATH, 'w')
f.write( json.dumps(manifest_data, indent=2, separators=(',', ': ')) )
f.close()
print "Save Build, Icons: %s" % ( len(build_data['icons']) )
f = open(BUILD_DATA_PATH, 'w')
f.write( json.dumps(build_data, indent=2, separators=(',', ': ')) )
f.close()
scripts/eotlitetool.py 0000664 00000042141 15243426175 0011165 0 ustar 00 #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is font utility code.
#
# The Initial Developer of the Original Code is Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# John Daggett <jdaggett@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** */
# eotlitetool.py - create EOT version of OpenType font for use with IE
#
# Usage: eotlitetool.py [-o output-filename] font1 [font2 ...]
#
# OpenType file structure
# http://www.microsoft.com/typography/otspec/otff.htm
#
# Types:
#
# BYTE 8-bit unsigned integer.
# CHAR 8-bit signed integer.
# USHORT 16-bit unsigned integer.
# SHORT 16-bit signed integer.
# ULONG 32-bit unsigned integer.
# Fixed 32-bit signed fixed-point number (16.16)
# LONGDATETIME Date represented in number of seconds since 12:00 midnight, January 1, 1904. The value is represented as a signed 64-bit integer.
#
# SFNT Header
#
# Fixed sfnt version // 0x00010000 for version 1.0.
# USHORT numTables // Number of tables.
# USHORT searchRange // (Maximum power of 2 <= numTables) x 16.
# USHORT entrySelector // Log2(maximum power of 2 <= numTables).
# USHORT rangeShift // NumTables x 16-searchRange.
#
# Table Directory
#
# ULONG tag // 4-byte identifier.
# ULONG checkSum // CheckSum for this table.
# ULONG offset // Offset from beginning of TrueType font file.
# ULONG length // Length of this table.
#
# OS/2 Table (Version 4)
#
# USHORT version // 0x0004
# SHORT xAvgCharWidth
# USHORT usWeightClass
# USHORT usWidthClass
# USHORT fsType
# SHORT ySubscriptXSize
# SHORT ySubscriptYSize
# SHORT ySubscriptXOffset
# SHORT ySubscriptYOffset
# SHORT ySuperscriptXSize
# SHORT ySuperscriptYSize
# SHORT ySuperscriptXOffset
# SHORT ySuperscriptYOffset
# SHORT yStrikeoutSize
# SHORT yStrikeoutPosition
# SHORT sFamilyClass
# BYTE panose[10]
# ULONG ulUnicodeRange1 // Bits 0-31
# ULONG ulUnicodeRange2 // Bits 32-63
# ULONG ulUnicodeRange3 // Bits 64-95
# ULONG ulUnicodeRange4 // Bits 96-127
# CHAR achVendID[4]
# USHORT fsSelection
# USHORT usFirstCharIndex
# USHORT usLastCharIndex
# SHORT sTypoAscender
# SHORT sTypoDescender
# SHORT sTypoLineGap
# USHORT usWinAscent
# USHORT usWinDescent
# ULONG ulCodePageRange1 // Bits 0-31
# ULONG ulCodePageRange2 // Bits 32-63
# SHORT sxHeight
# SHORT sCapHeight
# USHORT usDefaultChar
# USHORT usBreakChar
# USHORT usMaxContext
#
#
# The Naming Table is organized as follows:
#
# [name table header]
# [name records]
# [string data]
#
# Name Table Header
#
# USHORT format // Format selector (=0).
# USHORT count // Number of name records.
# USHORT stringOffset // Offset to start of string storage (from start of table).
#
# Name Record
#
# USHORT platformID // Platform ID.
# USHORT encodingID // Platform-specific encoding ID.
# USHORT languageID // Language ID.
# USHORT nameID // Name ID.
# USHORT length // String length (in bytes).
# USHORT offset // String offset from start of storage area (in bytes).
#
# head Table
#
# Fixed tableVersion // Table version number 0x00010000 for version 1.0.
# Fixed fontRevision // Set by font manufacturer.
# ULONG checkSumAdjustment // To compute: set it to 0, sum the entire font as ULONG, then store 0xB1B0AFBA - sum.
# ULONG magicNumber // Set to 0x5F0F3CF5.
# USHORT flags
# USHORT unitsPerEm // Valid range is from 16 to 16384. This value should be a power of 2 for fonts that have TrueType outlines.
# LONGDATETIME created // Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer
# LONGDATETIME modified // Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer
# SHORT xMin // For all glyph bounding boxes.
# SHORT yMin
# SHORT xMax
# SHORT yMax
# USHORT macStyle
# USHORT lowestRecPPEM // Smallest readable size in pixels.
# SHORT fontDirectionHint
# SHORT indexToLocFormat // 0 for short offsets, 1 for long.
# SHORT glyphDataFormat // 0 for current format.
#
#
#
# Embedded OpenType (EOT) file format
# http://www.w3.org/Submission/EOT/
#
# EOT version 0x00020001
#
# An EOT font consists of a header with the original OpenType font
# appended at the end. Most of the data in the EOT header is simply a
# copy of data from specific tables within the font data. The exceptions
# are the 'Flags' field and the root string name field. The root string
# is a set of names indicating domains for which the font data can be
# used. A null root string implies the font data can be used anywhere.
# The EOT header is in little-endian byte order but the font data remains
# in big-endian order as specified by the OpenType spec.
#
# Overall structure:
#
# [EOT header]
# [EOT name records]
# [font data]
#
# EOT header
#
# ULONG eotSize // Total structure length in bytes (including string and font data)
# ULONG fontDataSize // Length of the OpenType font (FontData) in bytes
# ULONG version // Version number of this format - 0x00020001
# ULONG flags // Processing Flags (0 == no special processing)
# BYTE fontPANOSE[10] // OS/2 Table panose
# BYTE charset // DEFAULT_CHARSET (0x01)
# BYTE italic // 0x01 if ITALIC in OS/2 Table fsSelection is set, 0 otherwise
# ULONG weight // OS/2 Table usWeightClass
# USHORT fsType // OS/2 Table fsType (specifies embedding permission flags)
# USHORT magicNumber // Magic number for EOT file - 0x504C.
# ULONG unicodeRange1 // OS/2 Table ulUnicodeRange1
# ULONG unicodeRange2 // OS/2 Table ulUnicodeRange2
# ULONG unicodeRange3 // OS/2 Table ulUnicodeRange3
# ULONG unicodeRange4 // OS/2 Table ulUnicodeRange4
# ULONG codePageRange1 // OS/2 Table ulCodePageRange1
# ULONG codePageRange2 // OS/2 Table ulCodePageRange2
# ULONG checkSumAdjustment // head Table CheckSumAdjustment
# ULONG reserved[4] // Reserved - must be 0
# USHORT padding1 // Padding - must be 0
#
# EOT name records
#
# USHORT FamilyNameSize // Font family name size in bytes
# BYTE FamilyName[FamilyNameSize] // Font family name (name ID = 1), little-endian UTF-16
# USHORT Padding2 // Padding - must be 0
#
# USHORT StyleNameSize // Style name size in bytes
# BYTE StyleName[StyleNameSize] // Style name (name ID = 2), little-endian UTF-16
# USHORT Padding3 // Padding - must be 0
#
# USHORT VersionNameSize // Version name size in bytes
# bytes VersionName[VersionNameSize] // Version name (name ID = 5), little-endian UTF-16
# USHORT Padding4 // Padding - must be 0
#
# USHORT FullNameSize // Full name size in bytes
# BYTE FullName[FullNameSize] // Full name (name ID = 4), little-endian UTF-16
# USHORT Padding5 // Padding - must be 0
#
# USHORT RootStringSize // Root string size in bytes
# BYTE RootString[RootStringSize] // Root string, little-endian UTF-16
import optparse
import struct
class FontError(Exception):
"""Error related to font handling"""
pass
def multichar(str):
vals = struct.unpack('4B', str[:4])
return (vals[0] << 24) + (vals[1] << 16) + (vals[2] << 8) + vals[3]
def multicharval(v):
return struct.pack('4B', (v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF)
class EOT:
EOT_VERSION = 0x00020001
EOT_MAGIC_NUMBER = 0x504c
EOT_DEFAULT_CHARSET = 0x01
EOT_FAMILY_NAME_INDEX = 0 # order of names in variable portion of EOT header
EOT_STYLE_NAME_INDEX = 1
EOT_VERSION_NAME_INDEX = 2
EOT_FULL_NAME_INDEX = 3
EOT_NUM_NAMES = 4
EOT_HEADER_PACK = '<4L10B2BL2H7L18x'
class OpenType:
SFNT_CFF = multichar('OTTO') # Postscript CFF SFNT version
SFNT_TRUE = 0x10000 # Standard TrueType version
SFNT_APPLE = multichar('true') # Apple TrueType version
SFNT_UNPACK = '>I4H'
TABLE_DIR_UNPACK = '>4I'
TABLE_HEAD = multichar('head') # TrueType table tags
TABLE_NAME = multichar('name')
TABLE_OS2 = multichar('OS/2')
TABLE_GLYF = multichar('glyf')
TABLE_CFF = multichar('CFF ')
OS2_FSSELECTION_ITALIC = 0x1
OS2_UNPACK = '>4xH2xH22x10B4L4xH14x2L'
HEAD_UNPACK = '>8xL'
NAME_RECORD_UNPACK = '>6H'
NAME_ID_FAMILY = 1
NAME_ID_STYLE = 2
NAME_ID_UNIQUE = 3
NAME_ID_FULL = 4
NAME_ID_VERSION = 5
NAME_ID_POSTSCRIPT = 6
PLATFORM_ID_UNICODE = 0 # Mac OS uses this typically
PLATFORM_ID_MICROSOFT = 3
ENCODING_ID_MICROSOFT_UNICODEBMP = 1 # with Microsoft platformID BMP-only Unicode encoding
LANG_ID_MICROSOFT_EN_US = 0x0409 # with Microsoft platformID EN US lang code
def eotname(ttf):
i = ttf.rfind('.')
if i != -1:
ttf = ttf[:i]
return ttf + '.eotlite'
def readfont(f):
data = open(f, 'rb').read()
return data
def get_table_directory(data):
"""read the SFNT header and table directory"""
datalen = len(data)
sfntsize = struct.calcsize(OpenType.SFNT_UNPACK)
if sfntsize > datalen:
raise FontError, 'truncated font data'
sfntvers, numTables = struct.unpack(OpenType.SFNT_UNPACK, data[:sfntsize])[:2]
if sfntvers != OpenType.SFNT_CFF and sfntvers != OpenType.SFNT_TRUE:
raise FontError, 'invalid font type';
font = {}
font['version'] = sfntvers
font['numTables'] = numTables
# create set of offsets, lengths for tables
table_dir_size = struct.calcsize(OpenType.TABLE_DIR_UNPACK)
if sfntsize + table_dir_size * numTables > datalen:
raise FontError, 'truncated font data, table directory extends past end of data'
table_dir = {}
for i in range(0, numTables):
start = sfntsize + i * table_dir_size
end = start + table_dir_size
tag, check, bongo, dirlen = struct.unpack(OpenType.TABLE_DIR_UNPACK, data[start:end])
table_dir[tag] = {'offset': bongo, 'length': dirlen, 'checksum': check}
font['tableDir'] = table_dir
return font
def get_name_records(nametable):
"""reads through the name records within name table"""
name = {}
# read the header
headersize = 6
count, strOffset = struct.unpack('>2H', nametable[2:6])
namerecsize = struct.calcsize(OpenType.NAME_RECORD_UNPACK)
if count * namerecsize + headersize > len(nametable):
raise FontError, 'names exceed size of name table'
name['count'] = count
name['strOffset'] = strOffset
# read through the name records
namerecs = {}
for i in range(0, count):
start = headersize + i * namerecsize
end = start + namerecsize
platformID, encodingID, languageID, nameID, namelen, offset = struct.unpack(OpenType.NAME_RECORD_UNPACK, nametable[start:end])
if platformID != OpenType.PLATFORM_ID_MICROSOFT or \
encodingID != OpenType.ENCODING_ID_MICROSOFT_UNICODEBMP or \
languageID != OpenType.LANG_ID_MICROSOFT_EN_US:
continue
namerecs[nameID] = {'offset': offset, 'length': namelen}
name['namerecords'] = namerecs
return name
def make_eot_name_headers(fontdata, nameTableDir):
"""extracts names from the name table and generates the names header portion of the EOT header"""
nameoffset = nameTableDir['offset']
namelen = nameTableDir['length']
name = get_name_records(fontdata[nameoffset : nameoffset + namelen])
namestroffset = name['strOffset']
namerecs = name['namerecords']
eotnames = (OpenType.NAME_ID_FAMILY, OpenType.NAME_ID_STYLE, OpenType.NAME_ID_VERSION, OpenType.NAME_ID_FULL)
nameheaders = []
for nameid in eotnames:
if nameid in namerecs:
namerecord = namerecs[nameid]
noffset = namerecord['offset']
nlen = namerecord['length']
nformat = '%dH' % (nlen / 2) # length is in number of bytes
start = nameoffset + namestroffset + noffset
end = start + nlen
nstr = struct.unpack('>' + nformat, fontdata[start:end])
nameheaders.append(struct.pack('<H' + nformat + '2x', nlen, *nstr))
else:
nameheaders.append(struct.pack('4x')) # len = 0, padding = 0
return ''.join(nameheaders)
# just return a null-string (len = 0)
def make_root_string():
return struct.pack('2x')
def make_eot_header(fontdata):
"""given ttf font data produce an EOT header"""
fontDataSize = len(fontdata)
font = get_table_directory(fontdata)
# toss out .otf fonts, t2embed library doesn't support these
tableDir = font['tableDir']
# check for required tables
required = (OpenType.TABLE_HEAD, OpenType.TABLE_NAME, OpenType.TABLE_OS2)
for table in required:
if not (table in tableDir):
raise FontError, 'missing required table ' + multicharval(table)
# read name strings
# pull out data from individual tables to construct fixed header portion
# need to calculate eotSize before packing
version = EOT.EOT_VERSION
flags = 0
charset = EOT.EOT_DEFAULT_CHARSET
magicNumber = EOT.EOT_MAGIC_NUMBER
# read values from OS/2 table
os2Dir = tableDir[OpenType.TABLE_OS2]
os2offset = os2Dir['offset']
os2size = struct.calcsize(OpenType.OS2_UNPACK)
if os2size > os2Dir['length']:
raise FontError, 'OS/2 table invalid length'
os2fields = struct.unpack(OpenType.OS2_UNPACK, fontdata[os2offset : os2offset + os2size])
panose = []
urange = []
codepage = []
weight, fsType = os2fields[:2]
panose[:10] = os2fields[2:12]
urange[:4] = os2fields[12:16]
fsSelection = os2fields[16]
codepage[:2] = os2fields[17:19]
italic = fsSelection & OpenType.OS2_FSSELECTION_ITALIC
# read in values from head table
headDir = tableDir[OpenType.TABLE_HEAD]
headoffset = headDir['offset']
headsize = struct.calcsize(OpenType.HEAD_UNPACK)
if headsize > headDir['length']:
raise FontError, 'head table invalid length'
headfields = struct.unpack(OpenType.HEAD_UNPACK, fontdata[headoffset : headoffset + headsize])
checkSumAdjustment = headfields[0]
# make name headers
nameheaders = make_eot_name_headers(fontdata, tableDir[OpenType.TABLE_NAME])
rootstring = make_root_string()
# calculate the total eot size
eotSize = struct.calcsize(EOT.EOT_HEADER_PACK) + len(nameheaders) + len(rootstring) + fontDataSize
fixed = struct.pack(EOT.EOT_HEADER_PACK,
*([eotSize, fontDataSize, version, flags] + panose + [charset, italic] +
[weight, fsType, magicNumber] + urange + codepage + [checkSumAdjustment]))
return ''.join((fixed, nameheaders, rootstring))
def write_eot_font(eot, header, data):
open(eot,'wb').write(''.join((header, data)))
return
def main():
# deal with options
p = optparse.OptionParser()
p.add_option('--output', '-o', default="world")
options, args = p.parse_args()
# iterate over font files
for f in args:
data = readfont(f)
if len(data) == 0:
print 'Error reading %s' % f
else:
eot = eotname(f)
header = make_eot_header(data)
write_eot_font(eot, header, data)
if __name__ == '__main__':
main()
scripts/sfnt2woff 0000664 00000213044 15243426175 0010113 0 ustar 00 ��� uP
� �$ �� � 8 __PAGEZERO � __TEXT P P __text __TEXT ! �: � __cstring __TEXT �[ ' �K � __DATA ` P __data __DATA ` P __dyld __DATA ` P � __IMPORT p ` __pointers __IMPORT p ` __jump_table __IMPORT @p i @` 8 __LINKEDIT � p P p 4 �r � P pr /usr/lib/dyld P ! 0 /usr/lib/libz.1.dylib 4 /usr/lib/libgcc_s.1.dylib 4 o /usr/lib/libSystem.B.dylib j ������]�\$ �M�L$����ˉ\$�����u��\$� �D$ �N �� X���>