FiraCode font not shown in Rstudio's Editor font menu...

Hi all-

my PC:
Ubuntu 20.04.4,
R 4.0
and Rstudio 1.3.1056 (latest).

Installed FiraCode font ok:
$ sudo apt install fonts-firacode

It shows up as a font in other progs
(ie: Libre Writer),
but not in Rstudio...

The Ubuntu "Font Mgr" prog
also shows FiraCode font ok.

Problem:
FiraCode font
does not show up as an option
in Rstudio
Global Options / Appearance / Editor font dropdown menu...

The FiraCode *.otf files are in folder:
/usr/share/fonts/opentype/firacode/

Can somebody please help!.
sfdude

I was facing the same issue - Focal Fossa, latest everything - recently. I found out that:

  1. this has been reported back in May as an issue with RStudio -https://github.com/rstudio/rstudio/issues/6894
  2. there is a workaround of sorts via creating a custom fontconfig .conf file
    https://github.com/tonsky/FiraCode/issues/840#issuecomment-531471498

Apart from the googling requried it took me about 15 minutes and the problem was resolved (my beautiful ligatures are back!).

It is a sort of hackish solution, but it does work (which makes me think that the root cause with RStudio is unlikely to be resolved soon, since there is a known workaround).

1 Like

Thanks Jindra for your answer!.

I'm sure
that the hackish solution works ok.

But (in my experience),
hackish solutions
could break something else,
now or in the future.
Things change...
I'd rather be cautious :slightly_smiling_face:

FiraCode is a super-nice font,
but I think I'll skip it for the time being,
until the Rstudio people fix the problem natively.

Hope they read this thread
and do something about it.

btw:
FiraCode used to work perfectly
under Ubuntu 18.04, latest Rstudio and R 3.6.3!...

Again, thanks for your suggestion!.
Really appreciated.

SFdude
Ubuntu 20.04.4,
R 4.0
and Rstudio 1.3.1056 (latest).

The choice is of course yours. Just to let you know that should a problem occur all you would have to do is remove the .conf file.
I am using the workaround for about two months and so far no issue.

1 Like

Ok, Jindra.
Yes, will try it then.
Thanks for your concern
and good, practical advice.

Best,
Sfdude

1 Like

Jindra,

Tried to save the new file:
80-firacode-spacing.conf
in:
/etc/fonts/conf.d/
but, the Ubuntu Text Editor
says:
"could not save the file...you do not have the permissions to save this file".

How should I proceed?
thanks!

Run consider running it via sudo gedit in a terminal window. You should be able to save it then.

did sudo gedit,
gedit opened,
but when tried to save got this gedit message:
"(gedit:40209): Tepl-WARNING **: 14:49:49.720: GVfs metadata is not supported. Fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadata are not supported on this platform. In the latter case, you should configure Tepl with --disable-gvfs-metadata.".

Don't know what it means...
how can i use "nano" editor
to save the .conf file?.
(maybe easier?).

Update to my previous mssg.:

After:
sudo gedit
and despite the ugly saving warning message
(see above),
FiraCode font DID install ok
in the prescribed folder,
and IS showing in the Rstudio Editor fonts.
**Whew!...

OK!!
After selecting FiraCode font
and clicking [Apply] in Rstudio,
font "ligatures" are now active,
ie: so that
"<- "
shows as a nice left pointing arrow in Rstudio.
YAY!

Thanks Jindra for your great support!!
SFdude

Good that you worked that out - the message is not relevant in context of /etc directory, but I probably should have told you to run sudo -H gedit (it would have sidestepped the error). My bad.

Anyway, I am glad you worked that out, the FiraCode ligatures are highly addictive :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.