font_size: Return or set font size

Description Usage Arguments Value Examples

View source: R/properties.R

Description

These property functions modify or return the font sizes of an rtf_doc object or individual titles/footnotes objects of the hf_line class.

When used on an rtf_doc object to retrieve font sizes, the document level default font size within the rtf_doc is returned. When used on an rtf_doc to set fonts, the default font size for the RTF document is set.

When used on titles/footnotes (hf_line objects), the font size is either returned of set for that individual line.

Usage

1
2
3
4
5
font_size(x, ...)

font_size(x) <- value

set_font_size(x, value)

Arguments

x

rtf_doc object or a hf_line object.

...

Additonal arguments passed to method dispatch.

value

A numeric value for font size in points.

Value

For font_size(), the font_size attribute of the supplied rtf_doc or hf_line. For `font_size<-`() and set_font_size, the modified object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(huxtable)
ht <- huxtable(
  column1 = 1:5,
  column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle", font_size = 15)))

pharmaRTF::font_size(rtf)
# Returns 12

pharmaRTF::font_size(rtf) <- 14

pharmaRTF::font_size(rtf$titles[[1]])
# Returns 15
pharmaRTF::font_size(rtf)
# Returns 14

pharmaRTF documentation built on Sept. 28, 2021, 5:08 p.m.