build script for fonts

This commit is contained in:
Julien Deswaef 2018-02-17 18:57:16 -05:00
parent aa63f72cbc
commit 4469d13ec9
23 changed files with 5047 additions and 5377 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ stunnel.log
.ruby-version .ruby-version
.bundle .bundle
src/icons/forkawesome/

View File

@ -6,3 +6,4 @@ gem 'sass', '~> 3.0'
gem 'less', '~> 2.5.0' gem 'less', '~> 2.5.0'
gem 'libv8', '~> 3.16.14.0' gem 'libv8', '~> 3.16.14.0'
gem 'therubyracer' gem 'therubyracer'
gem 'fontcustom'

View File

@ -10,6 +10,10 @@ GEM
commonjs (0.2.7) commonjs (0.2.7)
fast-stemmer (1.0.2) fast-stemmer (1.0.2)
ffi (1.9.18) ffi (1.9.18)
fontcustom (2.0.0)
json (~> 1.4)
listen (>= 1.0, < 4.0)
thor (~> 0.14)
highline (1.6.21) highline (1.6.21)
jekyll (1.5.1) jekyll (1.5.1)
classifier (~> 1.3) classifier (~> 1.3)
@ -22,6 +26,7 @@ GEM
redcarpet (~> 2.3.0) redcarpet (~> 2.3.0)
safe_yaml (~> 1.0) safe_yaml (~> 1.0)
toml (~> 0.1.0) toml (~> 0.1.0)
json (1.8.3)
less (2.5.1) less (2.5.1)
commonjs (~> 0.2.7) commonjs (~> 0.2.7)
libv8 (3.16.14.19) libv8 (3.16.14.19)
@ -53,6 +58,7 @@ GEM
therubyracer (0.12.3) therubyracer (0.12.3)
libv8 (~> 3.16.14.15) libv8 (~> 3.16.14.15)
ref ref
thor (0.20.0)
toml (0.1.2) toml (0.1.2)
parslet (~> 1.5.0) parslet (~> 1.5.0)
yajl-ruby (1.1.0) yajl-ruby (1.1.0)
@ -61,6 +67,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
fontcustom
jekyll (~> 1.0) jekyll (~> 1.0)
less (~> 2.5.0) less (~> 2.5.0)
libv8 (~> 3.16.14.0) libv8 (~> 3.16.14.0)

View File

@ -10,11 +10,11 @@ A tremendous gratitude is given to the whole team behind [Font Awesome](https://
This fork is still in its very early stage of development. Though If you wish to be part of the adventure, please start submitting patches. This fork is still in its very early stage of development. Though If you wish to be part of the adventure, please start submitting patches.
## License ## License
- The Font Awesome font is licensed under the SIL OFL 1.1: - The Fork Awesome font is licensed under the SIL OFL 1.1:
- http://scripts.sil.org/OFL - http://scripts.sil.org/OFL
- Font Awesome CSS, LESS, and Sass files are licensed under the MIT License: - Fork Awesome CSS, LESS, and Sass files are licensed under the MIT License:
- https://opensource.org/licenses/mit-license.html - https://opensource.org/licenses/mit-license.html
- The Font Awesome documentation is licensed under the CC BY 3.0 License: - The Fork Awesome documentation is licensed under the CC BY 3.0 License:
- https://creativecommons.org/licenses/by/3.0/ - https://creativecommons.org/licenses/by/3.0/
## Contributing ## Contributing

View File

@ -14,7 +14,7 @@ permalink: pretty
include: [_*.scss] include: [_*.scss]
# used in building icon pages # used in building icon pages
icon_meta: src/icons.yml icon_meta: src/icons/icons.yml
icon_layout: icon.html # Relative to _layouts directory icon_layout: icon.html # Relative to _layouts directory
icon_destination: icon # Relative to destination icon_destination: icon # Relative to destination

View File

@ -1383,12 +1383,6 @@
.fa-digg:before { .fa-digg:before {
content: "\f1a6"; content: "\f1a6";
} }
.fa-pied-piper-pp:before {
content: "\f1a7";
}
.fa-pied-piper-alt:before {
content: "\f1a8";
}
.fa-drupal:before { .fa-drupal:before {
content: "\f1a9"; content: "\f1a9";
} }
@ -2159,9 +2153,6 @@
.fa-snapchat-square:before { .fa-snapchat-square:before {
content: "\f2ad"; content: "\f2ad";
} }
.fa-pied-piper:before {
content: "\f2ae";
}
.fa-first-order:before { .fa-first-order:before {
content: "\f2b0"; content: "\f2b0";
} }

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 435 KiB

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -438,8 +438,6 @@
.@{fa-css-prefix}-stumbleupon:before { content: @fa-var-stumbleupon; } .@{fa-css-prefix}-stumbleupon:before { content: @fa-var-stumbleupon; }
.@{fa-css-prefix}-delicious:before { content: @fa-var-delicious; } .@{fa-css-prefix}-delicious:before { content: @fa-var-delicious; }
.@{fa-css-prefix}-digg:before { content: @fa-var-digg; } .@{fa-css-prefix}-digg:before { content: @fa-var-digg; }
.@{fa-css-prefix}-pied-piper-pp:before { content: @fa-var-pied-piper-pp; }
.@{fa-css-prefix}-pied-piper-alt:before { content: @fa-var-pied-piper-alt; }
.@{fa-css-prefix}-drupal:before { content: @fa-var-drupal; } .@{fa-css-prefix}-drupal:before { content: @fa-var-drupal; }
.@{fa-css-prefix}-joomla:before { content: @fa-var-joomla; } .@{fa-css-prefix}-joomla:before { content: @fa-var-joomla; }
.@{fa-css-prefix}-language:before { content: @fa-var-language; } .@{fa-css-prefix}-language:before { content: @fa-var-language; }
@ -724,7 +722,6 @@
.@{fa-css-prefix}-snapchat:before { content: @fa-var-snapchat; } .@{fa-css-prefix}-snapchat:before { content: @fa-var-snapchat; }
.@{fa-css-prefix}-snapchat-ghost:before { content: @fa-var-snapchat-ghost; } .@{fa-css-prefix}-snapchat-ghost:before { content: @fa-var-snapchat-ghost; }
.@{fa-css-prefix}-snapchat-square:before { content: @fa-var-snapchat-square; } .@{fa-css-prefix}-snapchat-square:before { content: @fa-var-snapchat-square; }
.@{fa-css-prefix}-pied-piper:before { content: @fa-var-pied-piper; }
.@{fa-css-prefix}-first-order:before { content: @fa-var-first-order; } .@{fa-css-prefix}-first-order:before { content: @fa-var-first-order; }
.@{fa-css-prefix}-yoast:before { content: @fa-var-yoast; } .@{fa-css-prefix}-yoast:before { content: @fa-var-yoast; }
.@{fa-css-prefix}-themeisle:before { content: @fa-var-themeisle; } .@{fa-css-prefix}-themeisle:before { content: @fa-var-themeisle; }

View File

@ -513,9 +513,6 @@
@fa-var-photo: "\f03e"; @fa-var-photo: "\f03e";
@fa-var-picture-o: "\f03e"; @fa-var-picture-o: "\f03e";
@fa-var-pie-chart: "\f200"; @fa-var-pie-chart: "\f200";
@fa-var-pied-piper: "\f2ae";
@fa-var-pied-piper-alt: "\f1a8";
@fa-var-pied-piper-pp: "\f1a7";
@fa-var-pinterest: "\f0d2"; @fa-var-pinterest: "\f0d2";
@fa-var-pinterest-p: "\f231"; @fa-var-pinterest-p: "\f231";
@fa-var-pinterest-square: "\f0d3"; @fa-var-pinterest-square: "\f0d3";

View File

@ -438,8 +438,6 @@
.#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; } .#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; }
.#{$fa-css-prefix}-delicious:before { content: $fa-var-delicious; } .#{$fa-css-prefix}-delicious:before { content: $fa-var-delicious; }
.#{$fa-css-prefix}-digg:before { content: $fa-var-digg; } .#{$fa-css-prefix}-digg:before { content: $fa-var-digg; }
.#{$fa-css-prefix}-pied-piper-pp:before { content: $fa-var-pied-piper-pp; }
.#{$fa-css-prefix}-pied-piper-alt:before { content: $fa-var-pied-piper-alt; }
.#{$fa-css-prefix}-drupal:before { content: $fa-var-drupal; } .#{$fa-css-prefix}-drupal:before { content: $fa-var-drupal; }
.#{$fa-css-prefix}-joomla:before { content: $fa-var-joomla; } .#{$fa-css-prefix}-joomla:before { content: $fa-var-joomla; }
.#{$fa-css-prefix}-language:before { content: $fa-var-language; } .#{$fa-css-prefix}-language:before { content: $fa-var-language; }
@ -724,7 +722,6 @@
.#{$fa-css-prefix}-snapchat:before { content: $fa-var-snapchat; } .#{$fa-css-prefix}-snapchat:before { content: $fa-var-snapchat; }
.#{$fa-css-prefix}-snapchat-ghost:before { content: $fa-var-snapchat-ghost; } .#{$fa-css-prefix}-snapchat-ghost:before { content: $fa-var-snapchat-ghost; }
.#{$fa-css-prefix}-snapchat-square:before { content: $fa-var-snapchat-square; } .#{$fa-css-prefix}-snapchat-square:before { content: $fa-var-snapchat-square; }
.#{$fa-css-prefix}-pied-piper:before { content: $fa-var-pied-piper; }
.#{$fa-css-prefix}-first-order:before { content: $fa-var-first-order; } .#{$fa-css-prefix}-first-order:before { content: $fa-var-first-order; }
.#{$fa-css-prefix}-yoast:before { content: $fa-var-yoast; } .#{$fa-css-prefix}-yoast:before { content: $fa-var-yoast; }
.#{$fa-css-prefix}-themeisle:before { content: $fa-var-themeisle; } .#{$fa-css-prefix}-themeisle:before { content: $fa-var-themeisle; }

View File

@ -514,9 +514,6 @@ $fa-var-phone-square: "\f098";
$fa-var-photo: "\f03e"; $fa-var-photo: "\f03e";
$fa-var-picture-o: "\f03e"; $fa-var-picture-o: "\f03e";
$fa-var-pie-chart: "\f200"; $fa-var-pie-chart: "\f200";
$fa-var-pied-piper: "\f2ae";
$fa-var-pied-piper-alt: "\f1a8";
$fa-var-pied-piper-pp: "\f1a7";
$fa-var-pinterest: "\f0d2"; $fa-var-pinterest: "\f0d2";
$fa-var-pinterest-p: "\f231"; $fa-var-pinterest-p: "\f231";
$fa-var-pinterest-square: "\f0d3"; $fa-var-pinterest-square: "\f0d3";

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 435 KiB

After

Width:  |  Height:  |  Size: 414 KiB

18
src/icons/Makefile Normal file
View File

@ -0,0 +1,18 @@
FA_DOC_ASSETS_DIR = ../doc/assets/fork-awesome/fonts
FA_FONTCUSTOM_OUTPUT_DIR = ./forkawesome
build:
@echo "Compiling Icons into a ForkAwesome fonts"
bundle exec fontcustom compile
cp ${FA_FONTCUSTOM_OUTPUT_DIR}/forkawesome.eot ${FA_DOC_ASSETS_DIR}/forkawesome-webfont.eot
cp ${FA_FONTCUSTOM_OUTPUT_DIR}/forkawesome.svg ${FA_DOC_ASSETS_DIR}/forkawesome-webfont.svg
cp ${FA_FONTCUSTOM_OUTPUT_DIR}/forkawesome.ttf ${FA_DOC_ASSETS_DIR}/forkawesome-webfont.ttf
cp ${FA_FONTCUSTOM_OUTPUT_DIR}/forkawesome.woff ${FA_DOC_ASSETS_DIR}/forkawesome-webfont.woff
cp ${FA_FONTCUSTOM_OUTPUT_DIR}/forkawesome.woff2 ${FA_DOC_ASSETS_DIR}/forkawesome-webfont.woff2
default:
build
.PHONY: build

View File

@ -1,53 +0,0 @@
# Turn a SVG webfont to a series of font files
# Inspired by http://helpfulsheep.com/2015-03-25-converting-svg-fonts-to-svg/
import sys
def get_glyph_value(line, start_text):
end_text ='"'
start_index = line.find(start_text)
end_index = line.find(end_text, start_index + len(start_text))
if start_index < 0 or end_index < 0:
return
return line[start_index + len(start_text):end_index]
def get_glyph_name(line):
name = get_glyph_value(line, start_text = 'glyph-name="')
name = name.replace('_', '-')
return name
def get_glyph_unicode(line):
unicode_char = get_glyph_value(line, start_text = 'unicode="&#x')
if unicode_char:
return '0x' + unicode_char[:-1].zfill(4).upper()
if len(sys.argv) < 2:
print 'Usage: python {} webfont-file.svg destination-folder'.format(sys.argv[0])
sys.exit()
file = open(sys.argv[1], 'r')
folder = sys.argv[2]
line = file.readline()
while line:
if '<glyph' in line:
name = get_glyph_name(line)
unicode_char = get_glyph_unicode(line)
if unicode_char:
filename = './' + folder + '/' + name + '.svg'
with open(filename, 'w') as w:
w.write('<?xml version="1.0" standalone="no"?>\n')
w.write('<svg width="1536px" height="1536px" version="1.1" xmlns="http://www.w3.org/2000/svg">\n')
w.write(line.replace('<glyph', '<path transform="scale(1, -1) translate(0, -1536)"') + '\n')
nextLine = file.readline()
while '/>' not in nextLine:
w.write(nextLine)
nextLine = file.readline()
w.write(nextLine)
w.write('</svg>')
line = file.readline()
file.close()