Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View fonts by category (monospace)? #3

Open
nyanpasu64 opened this issue Jun 8, 2016 · 7 comments
Open

View fonts by category (monospace)? #3

nyanpasu64 opened this issue Jun 8, 2016 · 7 comments

Comments

@nyanpasu64
Copy link

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.

@mmstick
Copy link

mmstick commented Aug 15, 2016

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.

@mmstick
Copy link

mmstick commented Nov 8, 2017

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

@mmstick
Copy link

mmstick commented Nov 9, 2017

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

@mmstick
Copy link

mmstick commented Nov 9, 2017

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

@andrewsomething
Copy link
Owner

@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.

@mmstick
Copy link

mmstick commented Nov 9, 2017

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

@mmstick
Copy link

mmstick commented Nov 9, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants