acelewis / fontcrusher Goto Github PK
View Code? Open in Web Editor NEWA python module for reducing the size of fonts by removing unnecessary glyphs.
A python module for reducing the size of fonts by removing unnecessary glyphs.
This is really not easy to use for people who don't do python all day
It seems like it's made for windows at first sight so I tried to make it work but:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.local/lib/python3.4/site-packages/fontcrusher/find_used_glyphs.py", line 43, in find_used_glyphs
for file in glob.iglob(include_arg[0], **include_arg[1]):
TypeError: iglob() got an unexpected keyword argument 'recursive'
Now i'm trying to make the example.py work but the path is wrong ofc
I try to edit this but no idea what it means: include_argument = [[r'./website_folder/**\*', {'recursive': True}]]
Then:
Traceback (most recent call last):
File "example.py", line 17, in <module>
used_glyphs = find_used_glyphs.find_used_glyphs(include_argument, regex_for_find, exclude_args=exclude_arg)
File "/home/user/.local/lib/python3.4/site-packages/fontcrusher/find_used_glyphs.py", line 43, in find_used_glyphs
for file in glob.iglob(include_arg[0], **include_arg[1]):
TypeError: iglob() got an unexpected keyword argument 'recursive'
So I removed , {'recursive': True}
and got:
FFTM NOT subset; don't know how to subset; dropped
I'm trying to crush a font using your library with the following code:
glyphs_to_keep = fontcrusher.get_glyphs_from_file(GLYPH_WHITE_LIST_FILE)
crushed_font = fontcrusher.load_and_crush_font(FONT_FILE, glyphs_to_keep)
but I'm getting this error:
File "/usr/local/lib/python2.7/site-packages/fontcrusher/fontcrusher.py", line 19, in load_and_crush_font
return keep_these_glyphs(original_font, glyphs)
Looking at the source code for fontcrusher
, I can't find where keep_these_glyphs()
is defined. It doesn't seem to be provided by fonttools
either. Where should I get that function?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.