You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't used sysfonts directly, but I'm playing around with showtext -- I think it's a very helpful tool, and I'll likely work it into some of my projects. Thanks!
This issue was "triggered" by showtext but traces down to this package. When I was testing showtext with a font I have in a project directory, I tried to load a font using a tilde-path, and it failed:
library(showtext)
font.add('xkcd', '~/Documents/Projects/GRUMPs/Logo/xkcd.ttf')
## Error in font.add("xkcd", "~/Documents/Projects/GRUMPs/Logo/xkcd.ttf") : ## freetype: cannot open resource, error code 1
It works fine if I use the full path myself or use normalizePath() (or even path.expand()) manually. (The problem appears to arise from sysfonts:::.check.font.dir() taking the path literally.)
Even though it's mostly cosmetic, any issues with including normalizePath() in .check.font.path()? Alternatively, would including it in showtext::font.add() be better?
sessionInfo()
## R version 3.2.0 (2015-04-16)## Platform: x86_64-w64-mingw32/x64 (64-bit)## Running under: Windows 8 x64 (build 9200)#### locale:## [1] LC_COLLATE=English_United States.1252 ## [2] LC_CTYPE=English_United States.1252 ## [3] LC_MONETARY=English_United States.1252## [4] LC_NUMERIC=C ## [5] LC_TIME=English_United States.1252 #### attached base packages:## [1] stats graphics grDevices utils datasets methods base #### other attached packages:## [1] showtext_0.4-2 sysfonts_0.5 r2_0.4.15 #### loaded via a namespace (and not attached):## [1] compiler_3.2.0 tools_3.2.0 htmltools_0.2.6 showtextdb_1.0 ## [5] rmarkdown_0.6.1 digest_0.6.8
The text was updated successfully, but these errors were encountered:
I wasn't certain if this fits better in .check.font.path or if that function should assume that all paths are already normalized. If that is the case, perhaps the change should go in showtext.
Actually font.add() is also a function contained in sysfonts, not showtext.
I would prefer adding normalizePath() inside .check.font.path, since it provides more convenience to the user.
Thanks for the catch!
I haven't used
sysfonts
directly, but I'm playing around withshowtext
-- I think it's a very helpful tool, and I'll likely work it into some of my projects. Thanks!This issue was "triggered" by
showtext
but traces down to this package. When I was testingshowtext
with a font I have in a project directory, I tried to load a font using a tilde-path, and it failed:It works fine if I use the full path myself or use
normalizePath()
(or evenpath.expand()
) manually. (The problem appears to arise fromsysfonts:::.check.font.dir()
taking the path literally.)Even though it's mostly cosmetic, any issues with including
normalizePath()
in.check.font.path()
? Alternatively, would including it inshowtext::font.add()
be better?The text was updated successfully, but these errors were encountered: