Description Usage Arguments Value Examples
These property functions modify or return the fonts of an rtf_doc
object or
individual titles/footnotes objects of the hf_line
class.
When used on an rtf_doc
object to retrieve fonts, the distinct set of fonts
of all objects contained within the rtf_doc are returned. When used on an
rtf_doc
to set fonts, the default font for the RTF document is set.
When used on titles/footnotes (hf_line
objects), the font is either returned
of set for that individual line.
1 2 3 4 5 |
x |
|
... |
Additional arguments passed to method dispatch |
value |
A string representing a font |
For font()
, the font attribute of the object in the case of
hf_line
and the table, or each unique font in the table, titles,
footnotes, and the overall document in the case of rtf_doc
. For
set_font()
and `font<-`()
, the modified object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(huxtable)
ht <- huxtable(
column1 = 1:5,
column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("text", font = "Comic Sans")))
pharmaRTF::font(rtf)
# Returns "Courier New" "Comic Sans"
pharmaRTF::font(rtf) <- "Times"
pharmaRTF::font(rtf)
# Returns "Times" "Comic Sans"
pharmaRTF::font(rtf$titles[[1]]) <- "Windings"
pharmaRTF::font(rtf)
# Returns "Times" "Windings"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.