-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unneeded warnings when creating plot using non-default fonts #729
Comments
#561 may be one approach, but I have not implemented it yet. An inelegant solution is to set the recording device to png, e.g. options(device = function(file, width, height) {
png(tempfile(), width = width, height = height)
}) Maybe I should give up the idea of using the PDF null device to record graphics, but use the device specified in the |
possibly also solved by using |
I think this specific problem has been solved long ago. When |
FWIW I am still seeing this bug and I do need to use the workaround mentioned in #729 (comment) |
I still have this problem, too. My problem isn't resolved with this work around. The work around seems only to work with pdflatex or lualatex. But I habe to use xelatex.
(I'm using an extra example because I'm using a Mac and don't have this Ubuntu font. So I use Source Code Pro.) |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Take this code snippet as an example (assuming "Ubuntu" font is installed in the system):
When compiling this with knitr, the output pdf will contain a long list of warnings similar as below:
However, if we call the device function directly,
then there is no such warning issued.
I believe this is caused by the null graphics device
pdf(NULL)
. From my understanding knitr will evaluate code chunk on this null device and record the plotting operations to some objects. However,pdf()
only support standard fonts like "Times" and "Courier", and will yell to other fonts that it does not recognize.The "real" null device mentioned in http://yihui.name/en/2010/12/a-special-graphics-device-in-r-the-null-device/ is already removed from R. Is there any other approach to solve this problem?
The text was updated successfully, but these errors were encountered: