Package `extrafont`

Bom dia!

Pessoal, eu estou tentando instalar os extrafont no R version 4.2.0 (2022-04-22 ucrt) , usando o sistema Windows 10. Uso o seguinte código:

install.packages(‘extrafont’)

library(extrafont)
extrafont::font_import()
loadfonts(device = “win”)
fonts()

No entanto, quando uso o fonts( ), ele me retorna uma lista NULL.

install.packages(‘extrafont’)

library(extrafont)
extrafont::font_import()
Importing fonts may take a few minutes, depending on the number of fonts and the speed of the system.
Continue? [y/n]
Exiting.
loadfonts(device = “win”)
fonts()
NULL

Aceito uma ajuda para resolver esse problema.

Agradeço desde já!

Oi Gerrio,

Trabalhar com fontes no Windows é um tanto complicado, por isso eu recomendo muito você a testar o pacote {ragg}. Ele foi feito pelo pessoal da Rstudio Posit justamente com o objetivo de resolver esse problema para o Windows.
Instale o pacote, e faça: Tools > Global options > General > Graphics > Backend: AGG > Apply. Reinicie o RStudio e teste novamente colocando a familia da fonte normalmente.

Assim não é preciso carregar pacotes ou fontes previamente, é só usar!

1 curtida

Obrigado, vou testar!