Font: Create a Font object.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Font.R

Description

Create a Font object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
is.Font(x)

Font(
  wb,
  color = NULL,
  heightInPoints = NULL,
  name = NULL,
  isItalic = FALSE,
  isStrikeout = FALSE,
  isBold = FALSE,
  underline = NULL,
  boldweight = NULL
)

Arguments

x

A Font object, as returned by Font.

wb

a workbook object as returned by createWorkbook or loadWorkbook.

color

a character specifiying the font color. Any color names as returned by colors can be used. Or, a hex character, e.g. "#FF0000" for red. For Excel 95 workbooks, only a subset of colors is available, see the constant INDEXED_COLORS_.

heightInPoints

a numeric value specifying the font height. Usual values are 10, 12, 14, etc.

name

a character value for the font to use. All values that you see in Excel should be available, e.g. "Courier New".

isItalic

a logical indicating the font should be italic.

isStrikeout

a logical indicating the font should be stiked out.

isBold

a logical indicating the font should be bold.

underline

a numeric value specifying the thickness of the underline. Allowed values are 0, 1, 2.

boldweight

a numeric value indicating bold weight. Normal is 400, regular bold is 700.

Details

Default values for NULL parameters are taken from Excel. So the default font color is black, the default font name is "Calibri", and the font height in points is 11.

For Excel 95/2000/XP/2003, it is impossible to set the font to bold. This limitation may be removed in the future.

NOTE: You need to have a Workbook object to attach a Font object to it.

Value

Font returns a list with a java reference to a Font object, and a class attribute "Font".

is.Font returns TRUE if the argument is of class "Font" and FALSE otherwise.

Author(s)

Adrian Dragulescu

See Also

CellStyle for using the a Font object.

Examples

1
2
3
4
## Not run: 
  font <-  Font(wb, color="blue", isItalic=TRUE)

## End(Not run)

xlsx documentation built on Nov. 10, 2020, 3:52 p.m.