Comments (1)
I ran across this issue as well. If you install any Google Font, for example, it typically ends up in ${HOME}/.local/sharefonts
.
If I List()
the fonts, they show up. However, if I try to use one of them, it always provides a substitute because the Family
and Name
fields are empty.
For example:
$ go run main.go
2022/08/04 20:09:01 Found 108 fonts:
2022/08/04 20:09:01 font #1: Family "", Name "", Filename "/home/glenn/.local/share/fonts/Baloo-Regular.ttf"
2022/08/04 20:09:01 font #2: Family "", Name "", Filename "/home/glenn/.local/share/fonts/BalsamiqSans-Bold.ttf"
2022/08/04 20:09:01 font #3: Family "", Name "", Filename "/home/glenn/.local/share/fonts/BalsamiqSans-BoldItalic.ttf"
2022/08/04 20:09:01 font #4: Family "", Name "", Filename "/home/glenn/.local/share/fonts/BalsamiqSans-Italic.ttf"
2022/08/04 20:09:01 font #5: Family "", Name "", Filename "/home/glenn/.local/share/fonts/BalsamiqSans-Regular.ttf"
2022/08/04 20:09:01 font #6: Family "", Name "", Filename "/home/glenn/.local/share/fonts/BungeeShade-Regular.ttf"
2022/08/04 20:09:01 font #7: Family "", Name "", Filename "/home/glenn/.local/share/fonts/Modak.ttf"
2022/08/04 20:09:01 font #8: Family "", Name "", Filename "/home/glenn/.local/share/fonts/Monoton-Regular.ttf"
2022/08/04 20:09:01 font #9: Family "DejaVu Sans", Name "DejaVu Sans Bold", Filename "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
...
However, stepping through the code, it makes up a family name based on the filename when doing a search, and therefore compares `"bungeeshade"` (for example) to `""` and doesn't find a match.
I think it is a simple fix of making up a family name for these files (based on their filename) so that when it comes time to make a match, it doesn't ignore fonts that have no family name.
I'll see if I can put together a PR.
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.