hanikesn / woff2otf Goto Github PK
View Code? Open in Web Editor NEWConverts woff files to otf files
Converts woff files to otf files
If I convert a WOFF file with this, the resulting OTF can't be opened with the font preview application of Windows 7 nor can it be installed (not a valid font file).
WOFF2 is growing in popularity. Are there any plans to add support for this file format?
I keep receiving the following traceback:
[user@machine] $ python3 woff2otf.py font1.woff font1.otf
Traceback (most recent call last):
File "woff2otf.py", line 111, in <module>
sys.exit(main(sys.argv))
File "woff2otf.py", line 106, in main
convert(source_file_name, target_file_name)
File "woff2otf.py", line 90, in convert
convert_streams(infile, outfile)
File "woff2otf.py", line 44, in convert_streams
outfile.write(struct.pack(">H", searchRange));
struct.error: 'H' format requires 0 <= number <= 65535
I can upload the file I try to convert to a suitable location if you wish to test this.
I tried to run the command, but I get this error, idk what the problem could be...
bred@BredBook woff2otf-master % python3 woff2otf.py Beausite-Classic_BoldItalic.woff Beausite-Classic_BoldItalic.ttf
Traceback (most recent call last):
File "/Users/bred/Desktop/woff2otf-master/woff2otf.py", line 110, in <module>
sys.exit(main(sys.argv))
File "/Users/bred/Desktop/woff2otf-master/woff2otf.py", line 105, in main
convert(source_file_name, target_file_name)
File "/Users/bred/Desktop/woff2otf-master/woff2otf.py", line 89, in convert
convert_streams(infile, outfile)
File "/Users/bred/Desktop/woff2otf-master/woff2otf.py", line 43, in convert_streams
outfile.write(struct.pack(">H", searchRange));
struct.error: 'H' format requires 0 <= number <= 65535
@hanikesn message_content
sorry this is not the right place to message someone, but as github has eliminated the contact user feature, I didn't know where else to ask:
i was hoping you or another user could give me a tip on how to use this python script as a basis for another script, or a simple app, or automated workflow—that could handle batch conversions.
As a mac user, I usually drag and drop the script into Terminal and then drag and drop the woff file and press return. This fills in file name and directory automatically, so theoretically, couldn't the script be modified to processes all woffs in a specified directory? My programming skills are limited to basic html, css, javascript, etc... otherwise I would probably know how to do it myself.
Cheers,
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.