-
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
Fonts in user library not detected in MacOS build on Github Actions #58
Comments
Hi - I just tried installing IBM Plex via brew locally and everything works as it should, so the issue is certainly related to running this in GHA. Maybe the issue is that your R session is not running under the same user as the font installation was? Do you know if it is possible through brew to specify that the font should be installed globally? |
Hi, many thanks for investigating. System-wide font install is possible but fails on GHA because of permissions. I ran ## sysname
## "Darwin"
## release
## "19.6.0"
## version
## "Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64"
## nodename
## "Mac-1605518904509.local"
## machine
## "x86_64"
## login
## "root"
## user
## "runner"
## effective_user
## "runner" What is odd is that {systemfonts} can access the font files in /Users/runner/Library/Fonts via Also, in case this is helpful, this works: systemfonts::register_font("IBM Plex Sans Condensed 2",
plain = '/Users/runner/Library/Fonts/IBMPlexSansCondensed-Regular.otf') while this does not systemfonts::register_font("IBM Plex Sans Condensed 2",
plain = '~/Library/Fonts/IBMPlexSansCondensed-Regular.otf') (It runs without error but the device cannot find the font later.) I understand this might not be solvable inside systemfonts but might merit a bit of documentation somewhere, perhaps in a future vignette or in the ragg vignettes. |
Dang - I had hoped this was a matter of switching user between font install and running R... systemfonts is using CoreText from the macOS API to figure out font locations and really don't care where they are located... Since this works locally it is not a matter of CoreText not being able to find user fonts, but must be some interaction between that API and the GHA setup. In any regards this is unsolvable from systemfonts... registration should always work as long as there is sufficient permissions on the system Sorry, this was not the answer you were hoping for |
Thanks - frankly that was my assumption from the beginning: that there is something opaque around the GHA setup. Happy to use the solution based on |
Let me know if you uncover anything |
Can I get you to run |
Sure - here it is, under the "install fonts and font system deps" step: |
Also, can you install globally with |
I did try that but brew throws an error (saying brew disables itself being run as sudo.) |
yeah |
anyway, the |
You may want to open up an issue in brew? 🤷♂️ |
Also, maybe try out with another brew font and see if it is a general issue with brew fonts on GHA, or specific to the Plex formula |
Thanks!
Thanks for checking - that was my guess from glancing at the log too.
Yes, same result with other fonts too.
I wonder if I can narrow this down between brew, the cask formula, and the GHA runner. When you say that the font is not being installed properly, do you have an idea about what else needs to happen for the font to be installed besides the file landing in the right directory? |
Have you had any luck with figuring out how to get brew fonts installed correctly on GHA? |
This seems to have been resolved - fonts installed using brew now appear in the font listing and are used correctly in plot output. |
The problem: on a MacOS build on Github Actions, {systemfonts} does not see fonts installed in user library, reports matching IBM Plex Sans to Helvetica but some other font shows up in the ggplot2 PNG ragg output.
This may well be a limitation of Github Actions (or me doing something wrong in the workflow spec), but logging here in case (a) it can be remedied in {systemfonts} or (b) you have any intuitions as to whether/how it can be handled on the GHA side.
HTML output at https://petrbouchal.xyz/pagetest/ (ignore text...)
Worflow file at https://github.com/petrbouchal/pagetest/blob/master/.github/workflows/website.yml
Workflow output at https://github.com/petrbouchal/pagetest/runs/1400625372?check_suite_focus=true
Rmd code at https://github.com/petrbouchal/pagetest/blob/master/index.Rmd
What I try to do:
rmarkdown::render_site()
, containing {ggplot2} graphics using the fontdev = "ragg_png"
.What I expect:
What I see:
systemfonts::system_fonts()
contains only entries with paths starting in /System/Library/Fontssystemfonts::match_font("IBM Plex Sans")
returns Helvetica.Feeding the font in manually via
systemfonts::register_font()
works but that is a bit of a convoluted and long-winded solution - but it confirms that the user font library exists and is accessible to R.The text was updated successfully, but these errors were encountered: