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

Pull fonts from custom directory #18

Open
swampthang opened this issue Feb 1, 2017 · 5 comments
Open

Pull fonts from custom directory #18

swampthang opened this issue Feb 1, 2017 · 5 comments

Comments

@swampthang
Copy link

Great library!

I'm wondering if there is a way to pull fonts from a custom directory. I'm working in an Electron app and have some fonts built in to the app. I like being able to get the metadata and the search feature in your library.

@devongovett
Copy link
Member

Currently this module is just for looking up system fonts. I'd like to eventually add support for registering your own fonts.

@swampthang
Copy link
Author

Thanks for the reply. That would really be awesome. What's the best way to get metadata from a font file? Like a .ttf or .otf, etc

I'd love to be able to create some nice objects like you have:

{
  family: "Cambria"
  italic: true
  monospace: false
  path: "/Library/Fonts/Microsoft/Cambria Bold Italic.ttf"
  postscriptName: "Cambria-BoldItalic"
  style: "Bold Italic"
  weight: 700
  width: 5
}

Surely there's a way to do that in the meantime, huh?

@devongovett
Copy link
Member

That info can be extracted using fontkit.

@swampthang
Copy link
Author

Ahh, ok. The README didn't list all the items you include in your font object. I guess they're buried in there somewhere. Will check that out. Thanks!

@swampthang
Copy link
Author

Is there any way to only get fonts from the user's font directory? Getting all available fonts is way too much for this app. I didn't realize I had a few thousand.

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

No branches or pull requests

2 participants