Bug 14880 - x11() seems to pass incorrect parameters to devga.
x11() seems to pass incorrect parameters to devga.
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Graphics
R 2.15.0
x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-13 21:37 UTC by justinmmcgrath+forward
Modified: 2012-04-17 20:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description justinmmcgrath+forward 2012-04-13 21:37:43 UTC
When calling x11() to create a device, plotting to the device produces a warning saying the font family cannot be found. Using windows() to create the device works properly. This also happens in version 2.14.1.

In the call to devga from x11(), the family parameter seems to be missing, so the antialias parameter is passed instead.

invisible(.External(Cdevga, "", d$width, d$height, d$pointsize, 
        FALSE, 1L, d$xpinch, d$ypinch, "white", d$gamma, d$xpos, 
        d$ypos, d$buffered, .PSenv, d$bg, d$restoreConsole, d$title, 
        TRUE, d$fillOddEven, d$antialias))

The parameter for "family" should be before "d$antialias". x11() doesn't take an antialias option, so maybe just use "" like as follows.

invisible(.External(Cdevga, "", d$width, d$height, d$pointsize, 
        FALSE, 1L, d$xpinch, d$ypinch, "white", d$gamma, d$xpos, 
        d$ypos, d$buffered, .PSenv, d$bg, d$restoreConsole, d$title, 
        TRUE, d$fillOddEven, "", d$antialias))

I also think that d$antialias should be converted to an integer before being passed to devga, and currently it is a character string.
Comment 1 Duncan Murdoch 2012-04-17 20:12:48 UTC
Thanks for the report.  (Please include reproducible code in bug reports.  I don't get a warning when I try x11(), warnings come later when I try to plot.  Took a while to figure that out...)