grid.cropmark | R Documentation |
grid.cropmark()
draws “crop marks” to the active graphics device.
cropmarkGrob()
is its grid grob counterpart.
Intended for use in adding crop marks around
game pieces in print-and-play layouts.
cropmarkGrob(
...,
piece_side = "tile_back",
suit = NA,
rank = NA,
cfg = getOption("piecepackr.cfg", pp_cfg()),
x = unit(0.5, "npc"),
y = unit(0.5, "npc"),
angle = 0,
width = NA,
height = NA,
scale = 1,
default.units = "npc",
envir = getOption("piecepackr.envir"),
name = NULL,
gp = gpar(),
vp = NULL,
bleed = unit(0.125, "in"),
cm_select = "12345678",
cm_width = unit(0.25, "mm"),
cm_length = unit(0.125, "in")
)
grid.cropmark(..., draw = TRUE)
... |
|
piece_side |
A string with piece and side separated by a underscore e.g. "coin_face" |
suit |
Number of suit (starting from 1). |
rank |
Number of rank (starting from 1) |
cfg |
Piecepack configuration list or |
x |
Where to place piece on x axis of viewport |
y |
Where to place piece on y axis of viewport |
angle |
Angle (on xy plane) to draw piece at |
width |
Width of piece |
height |
Height of piece |
scale |
Multiplicative scaling factor to apply to width, height, and depth. |
default.units |
A string indicating the default units to use if 'x', 'y', 'width', and/or 'height' are only given as numeric vectors. |
envir |
Environment (or named list) containing configuration list(s). |
name |
A character identifier (for grid) |
gp |
An object of class “gpar”. |
vp |
A |
bleed |
Bleed zone size to assume:
|
cm_select |
A string of integers from "1" to "8" indicating which crop marks to draw. "1" represents the top right crop mark then we proceeding clockwise to "8" which represents the top left crop mark. Default "12345678" draws all eight crop marks. |
cm_width |
Width of crop mark. |
cm_length |
Length of crop mark. |
draw |
A logical value indicating whether graphics output should be produced. |
A grid grob.
if (requireNamespace("grid", quietly = TRUE) &&
piecepackr:::device_supports_unicode()) {
cfg <- pp_cfg(list(mat_color = "pink", mat_width=0.05, border_color=NA))
grid::grid.newpage()
df <- data.frame(piece_side = "tile_face", suit = 2, rank = 2,
x = 2, y = 2, angle = 0,
stringsAsFactors = FALSE)
pmap_piece(df, grid.cropmark, cfg = cfg, default.units = "in")
pmap_piece(df, grid.piece, cfg = cfg, default.units = "in", bleed=TRUE)
}
if (requireNamespace("grid", quietly = TRUE) &&
piecepackr:::device_supports_unicode()) {
grid::grid.newpage()
df <- data.frame(piece_side = "coin_back", suit = 2, rank = 2,
x = 2, y = 2, angle = 0,
stringsAsFactors = FALSE)
pmap_piece(df, grid.cropmark, cfg = cfg, default.units = "in", bleed=TRUE)
pmap_piece(df, grid.piece, cfg = cfg, default.units = "in", bleed=TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.