Comments (1)
Might've found some solution for now:
So I'll .List()
all the fonts to get the paths,
parse those without a .Name
by .Filename
with the truetype
package,
and modify the .Name
and .Family
accordingly.
Update:
This works fine, but not always -- I have some hackily-made TTFs I downloaded online that, I guess, don't even have proper metadata.
Also, the fontnames can still be off with their whitespace -- the truetype font family is not always the same as the CSS wants -- but it's all about missing spaces (InputSerifMono -> Input Serif Mono, always when it's some [serif|mono] variant-word involved).
Now, my guess when I get pointers to Font
from .List()
is that I can modify the data under the pointer, it'll get changed for the sysfont
lib and the .Match()
will now take the parsed TTF name and family into account...
Update:
That doesn't do it -- I have no way to "enhance" the internal "registry" that takes care of the matching with adjusted data. Gotta do my own fuzzy-search, but wanted to do that on the frontend if I could anyway -- I don't like the sysfont API of always returning "closest" font without any signaling that it's not exact anyway -- ideally it would be a short list sorted by score.
from sysfont.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sysfont.