-
Notifications
You must be signed in to change notification settings - Fork 481
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
Use JuliaMono, drop Google Fonts CDN #1569
Conversation
Cool! You mean add a .CSS file to https://github.com/cormullion/juliamono? no problem, I think. I think the 'local' might be to avoid downloading a file that's already present? I don't think that works that well anyway, since browsers increasingly don't allow access to local fonts.... Probably safe to leave it out.... |
assets/html/scss/juliamono.scss
Outdated
font-family: JuliaMono; | ||
font-weight: 300; | ||
font-style: normal; | ||
src: local('JuliaMono'), url("#{$juliamono-base-url}/JuliaMono-Light.woff2") format("woff2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly do these different versions do? For my own website I used the one called Regular
but that one is not even included here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not yet found out how CSS font weights works. :)
In the font file I have these definitions:
Light 300
Regular 400
Medium 500
Semibold 600
Bold 700
Extrabold 800
Black 900
- Regular is the one I'd use by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. What determines which one is used? Will all those file be loaded by the browser? And for the case of Documenter, are all of them used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my Documenter docs CSS I use just this one:
@font-face {
font-family: JuliaMono-Regular;
font-display: fallback; /* allow 100 milliseconds then display fallback */
src: url("https://cdn.jsdelivr.net/gh/cormullion/juliamono/webfonts/JuliaMono-Regular.woff2");
}
Probably not a good idea to ask for them all :) (especially on mobile)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, it looks like Chrome at least is smart enough not to download the .woff2
if you're not actually using it. Currently, with this setup, on the -Medium
is actually loaded, because the code blocks have the (default) weight of 400
.
That said, I agree that, if we're gonna have the CSS file here, we should only have -Regular
there. However, @cormullion, what is the actual difference between the .woff2
files of the different weights? Why are you generating different ones in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each woff2
file contains the glyph shapes and data for one specific weight, so you need a separate file for each weight. (I think variable fonts might come in one big file, but this isn’t one of those.)
The CDNJS has finally completed the maintenance/update backlog, so JuliaMono v0.39 is now available at https://cdnjs.com/libraries/juliamono. |
Let's get this into 0.27.1 as well. |
That's awesome, thanks! Do you think anyone will notice/complain/pine for Roboto? Presumably it's not hard to revert (for some strange reason), given that it wasn't difficult to switch fonts before... If there's an update to the font (eg from version , does this require an update here as well? I know the Pluto folks prefer to update font versions manually - I'm not sure whether there are notifications from cdn.jsdelivr or from cdnjs... |
JuliaMono fixes our Unicode woes, so it is the superior choice for the default on technical grounds in my opinion. And, as you said, it is customizable with a little bit of effort.
Yep, the version is hard-coded, so an update to the font version would require a change here and a new release. It literally just requires a tiny change here though: Documenter.jl/src/Writers/HTMLWriter.jl Line 449 in bfdb3f2
|
@cormullion Do you think we could maintain the CSS file with the
@font-face
s on the JuliaMono side? I created one here at the moment, based on the Lato one, that tries to incorporate all the woff2 files you have available via CDNJS.One thing in that CSS file I am not entirely certain about is the use of the local version of the font (via
local('JuliaMono')
) -- fonts on CDNs usually don't appear to use it. I am entirely not sure about the pros and cons here, but it's probably in order to make sure that it doesn't conflict with an old version of the font, or even with a different font that happens to have the same name.Close #1568. Should also fix our Unicode woes, so also closes #618.