预期
R语言绘图中的中文默认字体宋体,希望用其他字体绘图,保存成PDF格式不能识别中文。
实际
使用“雅黑字体”出现乱码
重现问题的步骤
Windows7系统,R ×64 3.2.0
- windowsFonts(
- + A=windowsFont("华文彩云"),
- + B=windowsFont("华文仿宋"),
- + C=windowsFont("华文行楷"),
- + D=windowsFont("华文楷体"),
- + E=windowsFont("华文隶书"),
- + F=windowsFont("华文中宋"),
- + G=windowsFont("华文细黑"),
- + H=windowsFont("微软雅黑"),
- + J=windowsFont("华文新魏"),
- + K=windowsFont("幼圆")
- + )
- plot(1:10,1:10,type="n")
- text(2,10,"华文彩云",family="A");
- text(2,8,"华文仿宋",family="B");
- text(2,6,"华文行楷",family="C");
- text(2,4,"华文楷体",family="D");
- text(2,2,"幼圆",family="K");
- text(6,10,"华文隶书",family="E")
- text(6,8,"华文中宋",family="F")
- text(6,6,"华文细黑",family="G")
- text(6,4,"微软雅黑",family="H")
- text(6,2,"华文新魏",family="J")