Skip to content

[Feat]: Allow Custom Fonts Throught Env Vars #5246

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

Closed
Sharpz7 opened this issue Jun 7, 2022 · 2 comments
Closed

[Feat]: Allow Custom Fonts Throught Env Vars #5246

Sharpz7 opened this issue Jun 7, 2022 · 2 comments
Labels
duplicate enhancement Some improvement that isn't a feature

Comments

@Sharpz7
Copy link

Sharpz7 commented Jun 7, 2022

What is your suggestion?

Allow web-fonts to be added through a Enviromental Variable, or multiple by using commas

Why do you want this feature?

I-Pads, Chromebook and Phone users would greatly benifit from this feature, as adding fonts on these devices is tricky. Also using code-server on public/school computers means that custom fonts cannot be installed, so web fonts would solve this to.

Are there any workarounds to get this functionality today?

Yes, see https://github.com/tuanpham-dev/code-server-font-patch (#5238, #1374)

Are you interested in submitting a PR for this?

I would need a bit of help on implementing it most optimally, but the way I see it is that you would use Googles Web Font Loader to install fonts. Maybe a more custom model could be used but at a bare minimum this would work.

WebFontConfig = {
    google: { families: [ 'Work+Sans:semibold', 'Roboto' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
  })();
@Sharpz7 Sharpz7 added the enhancement Some improvement that isn't a feature label Jun 7, 2022
@jsjoeio jsjoeio added this to the Backlog Candidates milestone Jun 9, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 9, 2022

Thanks for opening this! Let's let the code-server community vote on this and then we can discuss whether or not we should implement it.

@code-asher
Copy link
Member

Duplicate of #1374

@code-asher code-asher marked this as a duplicate of #1374 Jul 13, 2024
@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

3 participants