-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.1.0 inital port from 'features/1-script-patch-fonts' branch on vim…
…-webdevicons repo
- Loading branch information
0 parents
commit 199e1b1
Showing
20 changed files
with
42,957 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 Ryan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- v0.1.0 | ||
-- release | ||
-- inital port from 'features/1-script-patch-fonts' branch on vim-webdevicons repo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/env python2 | ||
|
||
import sys | ||
import psMat | ||
import re | ||
import os.path | ||
|
||
try: | ||
#Load the module | ||
import fontforge | ||
|
||
except ImportError: | ||
sys.stderr.write("FontForge module could not be loaded. Try installing fontforge python bindings\n") | ||
sys.exit(1) | ||
|
||
print "using fontforge package version: " + str(fontforge.__version__) | ||
|
||
sourceFont = fontforge.open(sys.argv[1]) | ||
|
||
# rename font | ||
fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups() | ||
sourceFont.familyname = sourceFont.familyname + " Plus Nerd File Types" | ||
sourceFont.fullname = sourceFont.fullname + " Plus Nerd File Types" | ||
sourceFont.fontname = fontname + 'PlusNerdFileTypes' | ||
sourceFont.appendSFNTName('English (US)', 'Preferred Family', sourceFont.familyname) | ||
sourceFont.appendSFNTName('English (US)', 'Compatible Full', sourceFont.fullname) | ||
|
||
# glyph font | ||
|
||
sourceFont_em_original = sourceFont.em | ||
|
||
# glyph fonts | ||
|
||
#Open a font | ||
glyphFont1=fontforge.open("glyph-source-fonts/original-source.otf") | ||
|
||
#select unicodes: | ||
glyphFont1.selection.select(("ranges","unicode"),0xE500,0xE51D) | ||
#Copy those glyphs into the clipboard: | ||
glyphFont1.copy() | ||
|
||
#select unicodes: | ||
sourceFont.selection.select(("ranges","unicode"),0xE600,0xE61D) | ||
#paste the glyphs above in: | ||
sourceFont.paste() | ||
|
||
### even more glyphs | ||
|
||
##Open a font | ||
glyphFont2=fontforge.open("glyph-source-fonts/devicons.ttf") | ||
## @todo improve/fix | ||
sourceFont.em = glyphFont2.em | ||
##select unicodes: | ||
glyphFont2.selection.select(("ranges","unicode"),0xE600,0xE6A4) | ||
##Copy those glyphs into the clipboard | ||
glyphFont2.copy() | ||
# | ||
# | ||
## #select unicodes | ||
sourceFont.selection.select(("ranges","unicode"),0xE700,0xE7A4) | ||
##paste the glyphs above in: | ||
sourceFont.paste() | ||
|
||
# fix scaling of glyphs | ||
sourceFont.em = sourceFont_em_original | ||
|
||
extension = os.path.splitext(sourceFont.path)[1] | ||
|
||
# @todo later add option to generate the sfd? | ||
#sourceFont.save(sourceFont.fullname + ".sfd") | ||
|
||
sourceFont.generate(sourceFont.fullname + extension) | ||
|
||
print "Generated" | ||
print sourceFont.fullname | ||
print sourceFont.fontname | ||
|
Binary file not shown.
Oops, something went wrong.