Struct extendr_api::graphics::device_descriptor::DeviceDescriptor
source · pub struct DeviceDescriptor { /* private fields */ }
Expand description
A builder of libR_sys::DevDesc.
Implementations§
source§impl DeviceDescriptor
impl DeviceDescriptor
pub fn new() -> Self
sourcepub fn device_size(self, left: f64, right: f64, bottom: f64, top: f64) -> Self
pub fn device_size(self, left: f64, right: f64, bottom: f64, top: f64) -> Self
Sets the device sizes (unit: point).
If not specified, the following numbers (7 inches square, following the R Internals’ convetion) will be used.
left
: 0right
: 7 inches * points per inch =7 * 72
bottom
: 0top
: 7 inches * points per inch =7 * 72
Please note that, depending on the the coordinate system of the device,
left
might be larger than right
, or bottom
larger than top
(for
example, in SVG, the origin is at the top left corner).
sourcepub fn ipr(self, ipr: [f64; 2]) -> Self
pub fn ipr(self, ipr: [f64; 2]) -> Self
Sets inches per raster unit (i.e. point). Note that most of the cases, there’s no need to change this value.
A point is usually 1/72 (the default value), but another value can be specified here to scale the device. The first element is width, the second is height.
sourcepub fn cra(self, cra: [f64; 2]) -> Self
pub fn cra(self, cra: [f64; 2]) -> Self
Sets the font size (unit: point). Note that most of the cases, there’s no need to change this value.
The first element is width, the second is height. If not specified,
[0.9 * 12.0, 1.2 * 12.0]
, which is suggested by the R Internals as “a
good choice” will be used (12 point is the usual default for graphics
devices).
sourcepub fn startps(self, startps: f64) -> Self
pub fn startps(self, startps: f64) -> Self
Sets the initial value of pointsize.
If not specified, 12, which is the usual default for graphics devices, will be used.
sourcepub fn startcol(self, startcol: Color) -> Self
pub fn startcol(self, startcol: Color) -> Self
Sets the initial value of colour.
If not specified, black (0x000000
) will be used.
sourcepub fn startfill(self, startfill: Color) -> Self
pub fn startfill(self, startfill: Color) -> Self
Sets the initial value of fill.
If not specified, white (0xffffff
) will be used.
sourcepub fn startlty(self, startlty: LineType) -> Self
pub fn startlty(self, startlty: LineType) -> Self
Sets the initial value of line type.
If not specified, LineType::Solid will be used.
sourcepub fn startfont(self, startfont: FontFace) -> Self
pub fn startfont(self, startfont: FontFace) -> Self
Sets the initial value of font face.
If not specified, FontFace::Plain will be used.