Closed as not planned
Description
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);
})();