For a number of reasons the default piecepack made by piecepackr does not comply with the Anatomy of a Piecepack standard. But not to fear - one can easily configure a piecepack that looks like one of the original piecepacks.
library("piecepackr")
stopifnot(packageVersion("ppdf") >= "0.3.0-14")
piecepack_suits <- list(suit_text="\U0001f31e,\U0001f31c,\U0001f451,\u269c,\uaa5c", # 🌞,🌜,👑,⚜,꩜
suit_fontfamily="Noto Emoji,Noto Sans Symbols2,Noto Emoji,Noto Sans Symbols,Noto Sans Cham",
suit_cex="0.6,0.7,0.75,0.9,0.9")
dark_colorscheme <- list(suit_color="darkred,black,darkgreen,darkblue,black",
border_color="black")
orthodox_ranks <- list(rank_text=",\uaa5c,2,3,4,5", use_suit_as_ace=TRUE,
rank_fontfamily="Noto Sans",
rank_fontfamily.r2="Noto Sans Cham", rank_cex.r2.matchstick=0.7)
saucer <- list(suit_text.saucer_face = "", suit_text.saucer_back = "",
dm_text.saucer = "|", dm_fontfamily.saucer = "Noto Sans",
dm_r.saucer = 0.42, dm_color.saucer = "black",
invert_colors.saucer_face = TRUE,
mat_width.saucer_face=0.3, mat_color.saucer="white",
width.saucer = 7/8, height.saucer=7/8)
coin <- list(dm_text.coin = "|",
dm_fontfamily.coin = "Noto Sans",
dm_r.coin = 0.42,
dm_color.coin = "black")
die <- list(dm_text.die = "")
pawn <- list(suit_text.pawn = "",
dm_text.pawn = "",
invert_colors.pawn = TRUE)
pyramids <- list(rank_text.pyramid="A,B,C,D,E,F", use_suit_as_ace.pyramid=FALSE,
dm_t.pyramid_face=270, dm_r.pyramid_face=0.28, dm_cex.pyramid_face=3.5,
dm_text.pyramid_face = "|", dm_fontfamily.pyramid_face = "Noto Sans",
dm_color.pyramid_face="black", ps_color.pyramid_left = "black",
ps_color.pyramid_right = "black",
ps_t.pyramid_face=90, ps_r.pyramid_face=0.07, ps_cex.pyramid_face=0.4)
matchsticks <- list(invert_colors.matchstick=TRUE, use_suit_as_ace.matchstick=FALSE,
dm_r.r1.matchstick=0)
orthodox1 <- c(piecepack_suits, dark_colorscheme, orthodox_ranks, saucer, coin,
die, pawn, pyramids, matchsticks)
noto_credit <- c("\u25cf This piecepack uses characters from Google Noto Fonts. OFL 1.1.",
"\thttps://www.google.com/get/noto/")
description <- "This 'orthodox' piecepack fully complies with the 'Anatomy of a Piecepack' standard"
orthodox1$description <- description
orthodox1$credit <- noto_credit
orthodox1$title <- "Orthodox piecepack (Green Crowns)"
if (packageVersion("piecepackr") >= "1.10.0-8") {
orthodox1$copyright <- "Created in 2019 by Trevor L Davis. No Rights Reserved."
orthodox1$spdx_id <- "CC0-1.0"
}
borders <- list(border_lex=4, border_color="black")
bleed <- list(border_lex=0, border_color=NA_character_)
orthodox1_cutlines <- pp_cfg(orthodox1)
orthodox1_borders <- pp_cfg(c(borders, orthodox1))
orthodox1_bleed <- pp_cfg(c(bleed, orthodox1))
ppdf::piecepack_preview() |> pmap_piece(cfg=orthodox1_cutlines, default.units="in")
A preview of an ‘orthodox’ piecepack made by piecepackr
orthodox2 <- as.list(orthodox1)
orthodox2$suit_color="darkred,black,gold,darkblue,black"
orthodox2$title <- "Orthodox piecepack (Gold Crowns)"
orthodox2_cutlines <- pp_cfg(orthodox2)
orthodox2_borders <- pp_cfg(c(borders, orthodox2))
orthodox2_bleed <- pp_cfg(c(bleed, orthodox2))
ppdf::piecepack_preview() |> pmap_piece(cfg=orthodox2_cutlines, default.units="in")
An ‘orthodox’ piecepack with gold crowns
orthodox3 <- as.list(orthodox1)
orthodox3$suit_text <- "♥,♠,♣,♦,\uaa5c"
orthodox3$suit_cex <- "1,1,1,1,0.9"
orthodox3$suit_color <- "darkred,black,black,darkred,black"
orthodox3$suit_fontfamily <- "Noto Sans Symbols"
orthodox3$suit_fontfamily.s5 <- "Noto Sans Cham"
orthodox3$suit_text.pawn = NULL
orthodox3$suit_cex.pawn = 0.5
orthodox3$suit_text.saucer_face = NULL
orthodox3$suit_cex.saucer_face <- 0.5
orthodox3$title <- "French-suited piecepack (Orthodox)"
orthodox3$description <- "A French-suited piecepack that otherwise complies with the 'Anatomy of a Piecepack' standard"
orthodox3_cutlines <- pp_cfg(orthodox3)
orthodox3_borders <- pp_cfg(c(borders, orthodox3))
orthodox3_bleed <- pp_cfg(c(bleed, orthodox3))
ppdf::piecepack_preview() |> pmap_piece(cfg=orthodox3_cutlines, default.units="in")
French-suited piecepack in an orthodox style