andrewsomething/typecatcher

View fonts by category (monospace)?

Opened this issue · 7 comments

Is it possible to sort fonts by category? The Google Fonts website supports categories (serif, sans-serif, display, handwriting, monospace), thickness, slant, width, script...

To me, the category is most important. It's really difficult to look for monospace fonts using title search, when half of them don't have the word "mono" in the title.

It looks like it would be super easy to modify this application to do so. This file looks for the fonts from Google's JSON API which provides information like so:

{
   "kind": "webfonts#webfont",
   "family": "Abel",
   "category": "sans-serif",
   "variants": [
    "regular"
   ],
   "subsets": [
    "latin"
   ],
   "version": "v6",
   "lastModified": "2016-05-31",
   "files": {
    "regular": "http://fonts.gstatic.com/s/abel/v6/RpUKfqNxoyNe_ka23bzQ2A.ttf"
   }
  },

All that need be done is to update the GTK interface to support filtering by category and updating the list accordingly.

I'm creating an alternative to this application in Rust that will support this feature out of the box with it's first release. It shouldn't take too long. Have spent a few hours on the project and the backend & much of the GTK frontend is currently in place. May have something published within the next day or so.

The main window is a Paned, whose left pane is a ScrolledWindow-wrapped ListBox. Should just be a matter of toggling visibility of ListBoxRows depending on which category is currently selected in the HeaderBar's PopoverMenu, and the current contents of the SearchBar next to that menu.

I've a very early WIP screenshot of what I have so far -- the backend is using serde to automatically deserialize the JSON response into a native Rust data structure. That structure is generated at the beginning of the application, and used to populate the elements in the GTK interface, as well as serving an interface for downloading & installing the fonts into the correct directory via the app-dirs crate.

screenshot from 2017-11-08 14-34-20

Alright, this is what I have after day 1. Almost everything is complete, including category-based filters. Only need to wire up the Install / Uninstall buttons, add a search bar for search-based filters, and fancy up the UI.

screenshot from 2017-11-08 22-52-23

Rust release is imminent. Here's the latest screenshot. I only have two main issues to address and it will be cargo install-able.

screenshot from 2017-11-09 14-15-31

@mmstick I'm glad you've found a fun project to work on, but this verging on spam now. If this is open source feel free to drop a link to the repo so that interested people can follow you over there, but this is getting well off topic.

@andrewsomething It is open source, but the repository is not initialized yet.

And it's finished[1]. With a recent stable version of Rust installed[2], it is possible to install it with a single command. Rust generates efficient machine code that parallels / exceeds the performance of C, so it should be pretty fast.

cargo install --git https://github.com/mmstick/fontfinder

[1] https://github.com/mmstick/fontfinder
[2] https://rustup.rs