minacle / subfont Goto Github PK
View Code? Open in Web Editor NEWgenerate subsetted woff/woff2 font.
License: MIT License
generate subsetted woff/woff2 font.
License: MIT License
Trying to use the script against a SVG(intentionally), it crashes with this error:
python3.6 subfont.py -f ~/.local/share/fonts/Adobe\ -\ Source\ Han\ Serif\ 思源宋體\ -\ 開放來源碼的泛\ CJK\ 字體/SourceHanSerif.ttc --output-directory . -- ~/工作空間/社群/台灣在地化社群/臺灣在地化社群的標誌/來源碼/l10n-tw-logo.svg
found 0 characters.
Traceback (most recent call last):
File "/usr/local/bin/pyftsubset", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/usr/local/lib/python3.6/dist-packages/fontTools/subset/__init__.py", line 2954, in main
font = load_font(fontfile, options, dontLoadGlyphNames=dontLoadGlyphNames)
File "/usr/local/lib/python3.6/dist-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/usr/local/lib/python3.6/dist-packages/fontTools/subset/__init__.py", line 2801, in load_font
lazy=lazy)
File "/usr/local/lib/python3.6/dist-packages/fontTools/ttLib/__init__.py", line 180, in __init__
self.reader = sfnt.SFNTReader(file, checkChecksums, fontNumber=fontNumber)
File "/usr/local/lib/python3.6/dist-packages/fontTools/ttLib/sfnt.py", line 62, in __init__
raise ttLib.TTLibError("specify a font number between 0 and %d (inclusive)" % (self.numFonts - 1))
fontTools.ttLib.TTLibError: specify a font number between 0 and 27 (inclusive)
generation failed ~/.local/share/fonts/Adobe - Source Han Serif 思源宋體 - 開放來源碼的泛 CJK 字體/SourceHanSerif.ttc
Is it possible to make this argument optional?
It would be nice to use all characters if FILE is not provided.
Another improvement could be to support also chars instead of argument:
python subfont.py -f MyFont.ttf -- "abcdefghijklmnopqrstuvwxyz0123456789"
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.