Code-server: editor.fontFamily Support

Created on 10 Jun 2019  路  8Comments  路  Source: cdr/code-server

At present it doesn't appear that you can install a local font (Fira Code) and have it presented as an editor font in the browser.

"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true

only converts the fonts to serifs (unknown font)

enhancement

Most helpful comment

There is an alternative way to let your browser use fira code fonts, as long as you can use user style.

  • add this user style to the domain/URLs of code-server:
    @import url(https://cdn.jsdelivr.net/gh/tonsky/[email protected]/distr/fira_code.css);

Maybe this can be done directly by code-server, so that there is no need for extra efforts on client/browser side.

All 8 comments

Try:

{
    "editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
    "editor.fontLigatures": true
}

Make sure that Fira Code is installed to the machine accessing code-server in the browser, not the server (as it's the client browser that renders the fonts). I don't have any issues using Fira Code with code-server.

There is an alternative way to let your browser use fira code fonts, as long as you can use user style.

  • add this user style to the domain/URLs of code-server:
    @import url(https://cdn.jsdelivr.net/gh/tonsky/[email protected]/distr/fira_code.css);

Maybe this can be done directly by code-server, so that there is no need for extra efforts on client/browser side.

@yw662 where would I make this change ?

@GJRTimmer Install the stylus extension in chrome and add a "style" for the url where you access code-server. In my case it is http://penguin.linux.test:8080 (I am running code-server in crostini on a chromebook). Add the line @yw662 suggests to the style.

Thank yo @HenrikSolver and @yw662 for answering

If anyone is here for JetBrains Mono
"editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace", "editor.fontLigatures": true,

It seems that this trick doesn't work with 3.0.2. Maybe it is caused by #1470 .

We have an open issue re this at https://github.com/cdr/code-server/issues/1374

Was this page helpful?
0 / 5 - 0 ratings

Related issues

balazssoltesz picture balazssoltesz  路  3Comments

pchecinski picture pchecinski  路  3Comments

sa7mon picture sa7mon  路  3Comments

grant picture grant  路  3Comments

Arsaev picture Arsaev  路  3Comments