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

Host fonts locally #63

Merged
merged 1 commit into from
Sep 7, 2019
Merged

Conversation

koraa
Copy link
Contributor

@koraa koraa commented Jun 20, 2019

This makes sure the Montserrat font is delivered along with the
html & styles of the generated documentation.

The practical upshots of this are that no more requests have to be
made to google which is a privacy improvement and the proper fonts
are now delivered even if the computer viewing the documentation is
offline.

This makes sure the Montserrat font is delivered along with the
html & styles of the generated documentation.

The practical upshots of this are that no more requests have to be
made to google which is a privacy improvement and the proper fonts
are now delivered even if the computer viewing the documentation is
offline.
@ar2rsawseen
Copy link
Collaborator

My only concern is that it includes only TTF font types, for better crossbrowser support, there should be full font-face package, that would also include eot, woff, woff2, svg, etc
like this:
https://css-tricks.com/snippets/css/using-font-face/

@koraa
Copy link
Contributor Author

koraa commented Jul 30, 2019

Hi @ar2rsawseen,

TTF support has been pretty good for the last couple of years https://caniuse.com/#search=ttf

Also this really just embedds the google fonts style sheets & the fonts and AFAICS google fonts does not offer woff, eot and the other formats; just ttf and otf.

I think it still might be a good idea to add the other formats, but since this PR does not remove such support this might be better addressed in a separate issue.

@ar2rsawseen
Copy link
Collaborator

Sorry, what do you mean PR does not remove such support? It removes google fonts support, which actually provides loading other formats too and PR provides only ttf font loading (which is kind of a downgrade in a way)
https://fonts.googleapis.com/css?family=Montserrat:400,700

I know in overall, it probably would not mean much, and if it would have been a personal project, I would probably use ttf only too. But since it is "theme" used by many, I would rather not take any chances and use full font webpack :)

And it is possible to get one from author herself directly:
https://github.com/JulietaUla/Montserrat/tree/master/fonts/webfonts

@ar2rsawseen
Copy link
Collaborator

Ok let me merge this and will add the rest cases, myself, no worries :)

@ar2rsawseen ar2rsawseen merged commit 9caaa9d into clenemt:master Sep 7, 2019
@koraa
Copy link
Contributor Author

koraa commented Sep 7, 2019

Ah now I see what you mean :)

@koraa
Copy link
Contributor Author

koraa commented Sep 7, 2019

Wait, this is a bit curious:

curl 'https://fonts.googleapis.com/css?family=Montserrat:400,700' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0'

and

curl 'https://fonts.googleapis.com/css?family=Montserrat:400,700'

get me different results…seems to come from the user agent…
Actiually the output differs quite a bit with different user agents…might be worth actually trying with a list of common user agents just to see which versions this returns…

@ar2rsawseen
Copy link
Collaborator

Yeah, I think google fonts tries to determine your browser and its capabilities and delivered only files needed to that specific browser type :)

@ar2rsawseen
Copy link
Collaborator

Added rest of the font types here:
5476db4

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

Successfully merging this pull request may close these issues.

None yet

2 participants