sprinkle_font {pixiedust} | R Documentation |
Sprinkle the Characteristics of Text in a Cell
Description
Text can be made to stand out (or fade away) by using font features such as bold and italic text, color, size, or different fonts.
Usage
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
## Default S3 method:
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
## S3 method for class 'dust_list'
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
Arguments
x |
An object of class |
rows |
Either a numeric vector of rows in the tabular object to be
modified or an object of class |
cols |
Either a numeric vector of columns in the tabular object to be modified, or a character vector of column names. A mixture of character and numeric indices is permissible. |
bold |
|
italic |
|
font_size |
|
font_size_units |
|
font_color |
|
font_family |
|
... |
Additional arguments to pass to other methods. Currently ignored. |
part |
A character string denoting which part of the table to modify. |
fixed |
|
recycle |
A |
Details
The bold
and italic
features are recognized by all
formats.
Font size features are recognized by HTML and LaTeX. LaTeX only recognizes
the font size unit options of "pt"
and "em"
, but will quietly
change "px"
to "pt"
when printing.
Font color features are recognized by HTML and LaTeX.
Font family is only recognized by HTML.
Functional Requirements
Correctly change the
bold
column of the table part for the selected cells.Correctly change the
italic
column of the table part for the selected cells.Correctly change the
font_size
column of the table part for the selected cells.Correctly change the
font_size_units
column of the table part for the selected cells.Correctly chagne the
font_color
column of the table part for the selected cells.Correctly change the
font_family
column of the table part for the selected cells.Cast an error if
x
is not a dust object.Cast an error if
bold
is notlogical(1)
Cast an error if
italic
is notlogical(1)
Cast an error if
font_size
is notnumeric(1)
Cast an error if
font_size_units
is notcharacter(1)
Cast an error if
font_size_units
is not one of px, pt, em, orCast an error if
font_color
is notcharacter(1)
Cast an error if
font_family
is notcharacter(1)
Cast an error if
part
is not a subset ofc("body", "head", "foot", "interfoot")
Cast an error if
recycle = "none"
andbold
does not have length 1.Cast an error if
recycle = "none"
anditalic
does not have length 1.Cast an error if
recycle = "none"
andfont_size
does not have length 1.Cast an error if
recycle = "none"
andfont_size_units
does not have length 1.Cast an error if
recycle = "none"
andfont_color
does not have length 1.Cast an error if
recycle = "none"
andfont_family
does not have length 1.
The functional behavior of the fixed
and recycle
arguments
is not tested for this function. It is tested and validated in the
tests for index_to_sprinkle
.
Author(s)
Benjamin Nutter