-
Notifications
You must be signed in to change notification settings - Fork 18
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
More explicit message when caching a google font #141
Conversation
R/fonts.R
Outdated
@@ -441,7 +443,12 @@ font_dep_google_local <- function(x) { | |||
x$cache$remove(css_key) | |||
return(font_dep_google_local(x)) | |||
} | |||
download_file(url, f) | |||
if (!informed) { | |||
rlang::inform(paste0("Downloading google font ", x$family, " to local cache")) |
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.
Unfortunately, the to local cache
part isn't always true.
x$cache
can be a "mock" cache that never actually caches. I think, to workaround this, it could make sense for resolve_cache()
to return something like a mock_cache = TRUE
field here which we'd then use for check when constructing the message.
Also, when a cache isn't a mock cache, I suppose it could also make sense to include x$cache$dir()
in the message (so the user knows where those files are going)?
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.
Let me know if these changes are what you are thinking.
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 went ahead and made the change I was thinking of in cbfd605. Once I have your 👍 , I'll merge.
I'm pretty sure the build failure is unrelated to this PR. |
Opened mostly to start discussion about what the preferred interface is — I assumed that you'll usually be downloading multiple files for a single font but you'll only want to be informed once. Let me know if there's something different that you'd prefer.