-
Notifications
You must be signed in to change notification settings - Fork 17
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
system_fonts()
returning empty tibble on devtools::check_win_devel()
build
#87
Comments
Ah, I've just seen the updated systemfonts CRAN checks that were run today, and see that they are getting the same error on the Windows build... |
Thanks for the info. I'm aware of the issue and looking into it. There is something wonky going on with the new CRAN machine and I haven't been able to replicate it. I'm waiting on CRAN to get back to me on the matter |
Yes, I can't replicate the problem anywhere else and have no way of doing so except submitting it for scrutiny on their idiosyncratic machine. I thought I might get a more useful reply from CRAN than "your problem, not ours" |
In case anyone else has a similar issue, I thought I'd post my workaround to get through the CRAN checks when there is a problem with I created a .onLoad <- function(libname, pkgname) {
sans <- system.file("font", "Open_Sans_Regular.ttf", package = "geomtextpath")
# Provide fallback fonts in case unable to detect system fonts
if (nrow(systemfonts::system_fonts()) == 0) {
systemfonts::register_font("fallback", sans)
} else {
systemfonts::register_font("fallback", systemfonts::font_info("")$path[1])
}
} However, # replace non-zero characters with alternatives
`%nz%` <- function(a, b) {
a[!nzchar(a)] <- b[1]
a
} So that in calls to functions needing a package_function <- function(family)
{
info <- systemfonts::font_info(family %nz% "fallback")
# do stuff with info....
} @thomasp85 sorry this doesn't help the broader issue of the wonky Win Dev machine on CRAN. |
I have located the issue (not in systemfonts but on the CRAN machine), and will soon push an update special casing the CRAN machines behaviour |
Great - that should stop us from having to special-case it and hopefully ditch our manual fallbacks. I'll keep an eye on the systemfonts CRAN checks myself, so please feel free to close this issue. |
We have been using
systemfonts
successfully in the development of a ggplot2 extension package which has got to the point of CRAN submission. Unforunately, all though all the tests and CMD checks are working on local machines and GH actions, the package fails on incoming tests to CRAN becausesystemfonts
doesn't seem to find any fonts on the test machine.After examining the logs, I traced the problem via a warning that was emitted by
systemfonts::get_fallback()
, and included in the logs, which says#> warning: No fonts detected on your system. Using an empty font.`
I thought this was a bit odd, so added the following test to ensure that
systemfonts
was detecting the fonts on the Windows system on CRAN:This test passes locally and on GH actions, but fails on the CRAN machine. I asked CRAN to check whether there was a problem, but got a fairly curt reply saying that there must be a problem with the dependency we are using to detect fonts - that we should fix and re-submit. The Linux machines on CRAN seem to be fine, and as I say, the local and GH Windows tests are passing.
On the off chance, I thought I would open this issue here in case there was an obvious fix. The package relies on text metric measurements and there isn't a great alternative out there.
Any ideas?
The text was updated successfully, but these errors were encountered: