Comments (5)
Putting all the metadata files into a single JSON array is the easy bit:
cat ofl/*/METADATA.json | awk 'BEGIN {print "["} {if (p=="}" && $0=="{") {print ",{"; next;}} {p=$0} {print} END {print "]"}'
That produces a single JSON file containing all the metadata records.
from googlefontdirectory.
Passsing that combined metadata through a few lines of PHP to extract just the font names and categories, we end up with this, which is not currently available through any Google API:
[excessively long text snipped out - see below]
from googlefontdirectory.
@judgej gists are useful for chucking a document like that json file into without making a long comment.
from googlefontdirectory.
Good point. gists are one of the many things on my list of "more stuff I need to know how to use".
Here is the file (not in a gist) in a WP plugin:
My aim there will be to allow fonts to be filtered by category within the plugin, so a way to keep up-to-date with the font/category lists would be required for that. I'm sure Google will add it to their APIs one day, but it's no there yet.
For now I'm updating a local copy of the massive hg repo, using awk to combine all the metadata files, then PHP to pull out the font names and categories. Will probably put that all up on a website at some point.
But anyway - I can see many other uses for the meatadata, and it does all squeeze into a single 500kbyte JSON file, and I think it would be very useful here without getting in the way. If you don't want to add it, then I do have my own scripts running, so I'll leave it with you :-)
from googlefontdirectory.
Retaining original directory structure as the hg repo from now on, so metadata files and licenses are together with their fonts.
from googlefontdirectory.
Related Issues (11)
- Lacking JSON metadata for some fonts HOT 2
- Renamed/deleted files are not synchronised HOT 1
- Update Share Tech Mono with a fixed version (ligature issue) HOT 1
- Difference between this and google/fonts? HOT 7
- Rebranded to Google Fonts
- Sort fonts by license HOT 2
- Include Fallback font to cover CJK HOT 1
- CANT DOWNLOAD THE FONTS FROM HERE HOT 1
- Fonts are crashing Photoshop CS6 ? HOT 8
- Include license files
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 googlefontdirectory.