Oni: Can I choose a font 'typeface' ?

Created on 2 Dec 2017  路  7Comments  路  Source: onivim/oni

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
bug

Most helpful comment

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!

All 7 comments

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.

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"

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

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

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 ;)

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.

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

badosu picture badosu  路  24Comments

bryphe picture bryphe  路  29Comments

hboon picture hboon  路  21Comments

jordan-arenstein picture jordan-arenstein  路  22Comments

rococode picture rococode  路  20Comments