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

Different repo for Google fonts #23

Closed
dmklotz opened this issue Sep 7, 2018 · 4 comments
Closed

Different repo for Google fonts #23

dmklotz opened this issue Sep 7, 2018 · 4 comments

Comments

@dmklotz
Copy link

@dmklotz dmklotz commented Sep 7, 2018

I just tried to use this package today to install Google fonts, but I'm getting this error:

Error: lexical error: invalid char in json text.
NA
(right here) ------^

I checked the documentation for font_add_google(), but the default repo is no longer an active site. Instead of 'http://fonts.gstatic.com', one now has to go to 'http://fonts.google.com', and manually download a font or import it through their API.

@yixuan
Copy link
Owner

@yixuan yixuan commented Sep 7, 2018

I think the issue is unrelated to the web address, since the real font file is still using fonts.gstatic.com, for example http://fonts.gstatic.com/s/abeezee/v11/esDR31xSG-6AGleN6tI.ttf. If you change it to fonts.google.com then there is a 404.

The problem is more like a network issue. I suggest you trying it again.

@dmklotz
Copy link
Author

@dmklotz dmklotz commented Sep 10, 2018

I think you're right about it being a network issue. However, while I can connect to the Google API, the function sysfonts:::google_font_db as currently written obtains the Google font library from your personal website: https://github.com/yixuan/sysfonts/blob/03380c8e0e92a13789098fdc6c9db55709bc55ee/R/google.R#L30

My work account blocks me from accessing that website, hence the error. Anyway to restore the direct Google API method, currently commented out in the code?

@yixuan
Copy link
Owner

@yixuan yixuan commented Sep 10, 2018

That file was a cache since fetching from Google API is usually slow. I'll add an option to force using the Google API.

@yixuan
Copy link
Owner

@yixuan yixuan commented Oct 11, 2018

Fixed in the new release. You can now use the db_cache = FALSE option in font_add_google().

@yixuan yixuan closed this Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.