# NOT RUN {
## Install Source Han Serif Simplified Chinese
font_install(source_han_serif())
## List available font families
sysfonts::font_families()
## Use the font with the "showtext" package
if(require(showtext)) {
wd = setwd(tempdir())
showtext.auto()
pdf("source-han-serif.pdf")
par(family = "source-han-serif-cn")
plot.new()
box()
text(0.5, 0.9, "\u601d\u6e90\u5b8b\u4f53", cex = 3, font = 2)
text(0.5, 0.4, "\u843d\u5176\u5b9e\u8005\u601d\u5176\u6811", cex = 3)
text(0.5, 0.2, "\u996e\u5176\u6d41\u8005\u6000\u5176\u6e90", cex = 3)
dev.off()
setwd(wd)
}
# }
Run the code above in your browser using DataLab