Learn R Programming

formatters (version 0.5.11)

font_spec: Font size specification

Description

Font size specification

Usage

font_spec(font_family = "Courier", font_size = 8, lineheight = 1)

Arguments

font_family

(character(1))
font family to use during string width and lines-per-page calculations. You can specify "Times New Roman" as "Times" or "serif", regardless of OS. Beyond that, see family entry in graphics::par() for details.

font_size

(numeric(1))
font size to use during string width calculations and lines-per-page calculations.

lineheight

(numeric(1))
line height to use during lines-per-page calculations.

Details

Passing the output of this constructor to the rendering or pagination machinery defines a font for use when calculating word wrapping and pagination.

See Also

nchar_ttype(), toString(), pagination_algo, export_as_pdf()

Examples

Run this code
fspec <- font_spec("Courier", 8, 1)

lets <- paste(letters, collapse = "")

nchar_ttype(lets, fspec)

fspec2 <- font_spec("Times", 8, 1)

nchar_ttype(lets, fspec2)

Run the code above in your browser using DataLab