Closed jszhao closed 6 years ago
After set DEBUG to TRUE, the following code demonstrated the bug.
library(tikzDevice) options(tikzDefaultEngine = "xetex") options(tikzXelatexPackages = c(getOption("tikzXelatexPackages"), "\\setmainfont{Times New Roman}\n", "\\usepackage[math-style=TeX]{unicode-math}\n", "\\setmathfont{Times New Roman}\n", "\\usepackage{xeCJK}\n", "\\setCJKmainfont{SimHei}\n\n" )) tikz(console=TRUE, standAlone = TRUE, width=4, height=4) plot(1:10, type = "n", xlab = "", ylab = "模式") text(5,2, "江") dev.off()
it will print endlessly: % Calculated character metrics. ascent: 7.851560, descent: 0.976530, width: 10.000000
If I replaced text(5,2, "江") to text(5,2, "a"), It will end normally.
text(5,2, "江")
text(5,2, "a")
However, I don't know how to debug C code.
This issue is the root of https://github.com/yihui/tikzDevice/issues/155.
By the way, it may not be the bug of tikzDevice, maybe the bug of R itself. I don't know.
Thanks for your analysis. This is likely a bug in base R.
This now works for me in the development version of tikzDevice with R 3.4.3 on Linux. Please file a new issue if the problem persists.
After set DEBUG to TRUE, the following code demonstrated the bug.
it will print endlessly: % Calculated character metrics. ascent: 7.851560, descent: 0.976530, width: 10.000000
If I replaced
text(5,2, "江")
totext(5,2, "a")
, It will end normally.However, I don't know how to debug C code.
This issue is the root of https://github.com/yihui/tikzDevice/issues/155.
By the way, it may not be the bug of tikzDevice, maybe the bug of R itself. I don't know.