Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Can I choose a font 'typeface' ? #1059

Closed
stroiman opened this issue Dec 2, 2017 · 7 comments
Closed

Can I choose a font 'typeface' ? #1059

stroiman opened this issue Dec 2, 2017 · 7 comments
Labels

Comments

@stroiman
Copy link

stroiman commented Dec 2, 2017

Hi.

I am using the font "Fire Code", which comes with a few variants (typefaces), "Light", "Regular", "Retina", etc. I can only get the regular version to work with this config setting

  "editor.fontFamily": "Fira Code"

But I would like to use the "Light" version. If I try and change it to

  "editor.fontFamily": "Fira Code Light"

The some default non-monospace font is used. Is there a way to choose the font typeface?

For oldschool gui vim, the following font selection works in my .vimrc file

set guifont=Fira\ Code\ Light:h15
@bryphe
Copy link
Member

bryphe commented Dec 3, 2017

Hi @PeteProgrammer ,

Thanks for the issue. Which platform are you on? And just to confirm - are you using this version of Fira code? https://github.com/tonsky/FiraCode

I'm testing it out on Windows and it seems like the font is switching for me:
font-fira-code

But there may be cases where we need to specify the font-weight CSS property for it to be picked up. We could potentially add an editor.fontWeight which would allow setting this. I noticed that for me, if I set editor.fontFamily to "Fira Code Bold", it didn't work - but if I set editor.fontFamily to "Fira Code" and font-weight directly in CSS as bold, it rendered correctly.

@bryphe bryphe added the bug label Dec 3, 2017
@stroiman
Copy link
Author

stroiman commented Dec 3, 2017

Hi @bryphe

I'm running on OS-X - and yes, that is the version of Fira Code I have installed.

However, I managed to find a workaround. I used the filename for the specific typeface, so, e.g. "Fira Code Light" is in the file "FiraCode-Light.ttf". So I got it to work by changing the setting to:

"editor.fontFamily": "FiraCode-Light"

@bryphe
Copy link
Member

bryphe commented Dec 12, 2017

Glad you got it working, @PeteProgrammer ! Thank you for the follow-up.

I'll close this out, but feel free to update our wiki if you have ideas on making that option clearer: https://github.com/onivim/oni/wiki/Configuration#editor

@bryphe bryphe closed this as completed Dec 12, 2017
@stroiman
Copy link
Author

I tried updating the wiki, don't know if it is clearer :)

@stroiman
Copy link
Author

stroiman commented Feb 6, 2018

Hi there. I just noticed that this is also an issue in VS Code, AFAIK, both oni and VS Code are based on Electron?

So this must be an issue with electron itself, and not oni.

p.s. I changed my github account name, I used to be peteprogrammer ;)

@bryphe
Copy link
Member

bryphe commented Feb 6, 2018

Thanks for the follow-up, @stroiman ! Yes, both Oni and VS Code are based on Electron - so it makes sense that we'd potentially both have the issue.

@parkerault
Copy link
Contributor

parkerault commented Mar 23, 2018

Hey y'all, if you want to find the PostScript font name for a font on OSX, you can open up the Font Book app, select the font you want to use, and type command-i. You should see something like this:

image

The entry for "PostScript name" is the one you want in your config.tsx! Fancy fonts ahoy!

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

No branches or pull requests

3 participants