simoncozens / counterspace Goto Github PK
View Code? Open in Web Editor NEWCountershape-based spacing and kerning library and plugin
License: Other
Countershape-based spacing and kerning library and plugin
License: Other
Just played around with the Jupyter notebook this afternoon, and the first cell dies reporting an error from FreeType when it hits the init for the FT_Face:
FT_Exception: FT_Exception: (unknown file format)
Same thing happens in a terminal repl (initially I wondered if it was a problem caused by my browser being run in a snap package, thus downloading the test font to a sandboxed location, but that doesn't seem to be it).
I realize this is rather old code at this point; is it possible that something has changed in the FT wrappers since last year?
FWIW, the CounterSpace func has no problem downloading the fonts. I did, however, notice that FontTools is not listed in the requirements.txt package list, and that also raised an error ... so perhaps the dependencies are still incomplete on my machine....
from CounterSpace import CounterSpace
c = CounterSpace("CrimsonRoman.otf",serif_smoothing=5)
c.bare_minimum = 5
c.determine_parameters()
# {'w_top': 16.908982103066425, 'w_bottom': 8.594197614184417, 'h_top': 10.0, 'h_bottom': 10.0, 'h_center': 21.062323710551453, 'w_center': 5.0, 'top_strength': 0.05, 'bottom_strength': 0.7939496853592103, 'center_strength': 3.4482610329952443}
print(c.space("n","n"))
# 38
print(c.space("n","o"))
# 490
Should be easy enough to just create a kern
table if it doesn't exist.
But the font I threw at it (Noto Serif Regular) uses (and has) GPOS
instead of kern
; I'm not sure what the best practice is for that situation. E.g., for experimentation, it might be fun to include both tables and fiddle with the results of toggling between them....
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.