Closed cpsievert closed 2 years ago
How did you compile Cairo? This looks like problem in your fontconfig installation missing font configuration files. Can you, please, provide more complete details on how you compiled fonconfig, what are your font locations etc.?
Preliminary investigation suggests that Windows doesn't support fontconfig, so it shouldn't be linked, but the suggested UCRT configuration included it. R's internal cairo does not use it so if it has desired effect, we could remote it.
The Windows UCRT toolchain includes cairo-ft
, but it cannot be actually used, because the FontConfig configuration is not included. Cairo uses cairo-ft
if available, so that causes the problem as the user doesn't have valid FontConfig configuration. The non-UCRT toolchain did not have cairo-ft
, so Cairo fell back to the native functions. R explicitly disables cairo-ft
on Windows cairoFns.c#L1645 so we should probably do the same.
Thanks to Tomáš Kalibera for debugging!
@cpsievert can you, please, check if the latest version fixed the problem? Use
install.packages("Cairo",,"https://rforge.net",type='source')
with full Rtools42 installed.
That appears to have fixed, thanks!
Excellent, thanks! I'll post the new version to CRAN.
It appears that, from a fresh R 4.2.0 (or higher) session on Windows, the first call to
Cairo::CairoPNG()
always generates:Plots are still generated, but the fonts appear thinner and poorer quality then they should be. See https://github.com/rstudio/shiny/issues/3626 for some examples