R: Set font

font {flextable} | R Documentation

## Set font

### Description

change font of selected rows and columns of a flextable.

### Usage

    font(x, i = NULL, j = NULL, fontname, part = "body")

### Arguments

`x` | a flextable object
`i` | rows selection
`j` | columns selection
`fontname` | string value, the font name.
`part` | partname of the table (one of 'all', 'body', 'header', 'footer')

### Examples

    require("gdtools")
    fontname <- "Times"

    if( !font_family_exists(fontname) ){
      # if Times is not available, we will use the first available
      font_list <- sys_fonts()
      fontname <- as.character(font_list$family[1])
    }

    ft <- regulartable(head(iris))
    ft <- font(ft, fontname = fontname, part = "header")

[Package flextable version 0.4.5 Index]