Skip to content
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

Add JuliaMono webfonts to /assets/ ? #1272

Closed
cormullion opened this issue Apr 16, 2021 · 8 comments
Closed

Add JuliaMono webfonts to /assets/ ? #1272

cormullion opened this issue Apr 16, 2021 · 8 comments

Comments

@cormullion
Copy link
Contributor

We could add the JuliaMono webfonts to the julialang.org website. They could live in, say, www.julialang.org/assets/fonts/JuliaMono/webfonts/ as the files:

JuliaMono-Black.woff2
JuliaMono-Bold.woff2
JuliaMono-BoldLatin.woff2
JuliaMono-ExtraBold.woff2
JuliaMono-Light.woff2
JuliaMono-Medium.woff2
JuliaMono-Regular.woff2
JuliaMono-RegularLatin.woff2
JuliaMono-SemiBold.woff2

The total size of this new directory would be about 5MB. People would then be able to use the fonts for package documentation, blog posts, etc.. To do this, they would add something like this to a CSS file:

@font-face {
	font-family: JuliaMono;
	src:
		local('JuliaMono-Regular'),
		url("https://www.julialang.org/assets/fonts/JuliaMono/webfonts/JuliaMono-Regular.woff2");
}

I've no idea what the bandwidth would be, or whether that would be a cost/pricing issue? At present, the actual OpenType fonts are stored on github, but the webfonts (WOFF) are served from there via the NPM/JavaScript-focussed https://www.jsdelivr.com CDN. It works fine (but I have no more information than that).

There would be no visible changes to this website. (And I'm not saying that people should start using the fonts anywhere, unless they want to. 😄)

I don't know whether you would want a disclaimer in the directory somewhere to the effect that the fonts aren't "official"? Although it does promote Julia, in a way...

@fredrikekre
Copy link
Member

There would be no visible changes to this website.

Obviously code on the website should use it!

@staticfloat
Copy link
Member

So is the benefit here that users don't have to use jsdelivr but can instead use julialang.org? It's not that I am afraid of the extra traffic, (Fastly is quite generous with us so it should be fine) but more that I'm not sure if it's much benefit so I'd prefer to keep it being served on other people's bills than ours as long as makes sense. :P

@cormullion
Copy link
Contributor Author

Well I don't know anything about these CDNs - which ones are good, which aren't, whether two are better than one, how much downloads cost, etc - so I can't put any numbers on the benefits of using "julialang.org" or another. Might as well leave everything as it is for now... 😀

@mortenpi
Copy link
Contributor

I thought I'd just chime in from the Documenter perspective: Documenter sites currently use two CDNs: Google Fonts and CDNJS, for fonts and JS deps, respectively. I am quite hesitant to add another CDN to that list (whether that is jsDelivr or julialang.org/Fastly). The reason is that once any CDN fails, the Documenter sites will fail to load.

That is because the browsers will block the site load until they are able to fetch the dependencies or they get some sort of an error response. However, if the there is e.g. a true network issue, the CDN will never respond and the browsers will wait at least until the TCP 300s timeout expires (IIRC). We had an incident a few years ago when the various docs across the ecosystem were not loading properly for about 12 or so hours just because of this.

So, to switch Documenter over to Julia Mono (which we should totally do), the easiest option from my perspective is to get Julia Mono onto Google Fonts. That said, we could also possibly look into switching everything over the jsDelivr, but that would mean making sure that we can fetch the other deps from there as well.

@cormullion
Copy link
Contributor Author

We had an incident a few years ago when the various docs across the ecosystem were not loading properly

Ha, yes, I remember that. I now wonder why the docs didn't all just load with Times and Courier fallback fonts instead...

JuliaMono won't be joining Google Fonts any time soon - there's a lot of work involved adapting to their processes, and there's no guarantee of being accepted anyway.

Looks like people are happy using jsdelivr to serve fonts for their Documenter-made documents, so let's leave things as they are.

@mortenpi
Copy link
Contributor

What about CDNJS though? I discovered we could get Lato from there. It looks like it's a matter of dropping a JSON file into a repo?

@cormullion
Copy link
Contributor Author

What about CDNJS though?

I'll give it a go.

@cormullion
Copy link
Contributor Author

Wasn't too difficult:

Screenshot 2021-04-21 at 14 04 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants