Learn R Programming

openxlsx2 (version 0.3.1)

create_font: create font format

Description

create font format

Usage

create_font(
  b = "",
  charset = "",
  color = wb_colour(hex = "FF000000"),
  condense = "",
  extend = "",
  family = "2",
  i = "",
  name = "Calibri",
  outline = "",
  scheme = "minor",
  shadow = "",
  strike = "",
  sz = "11",
  u = "",
  vertAlign = ""
)

Arguments

b

bold

charset

charset

color

rgb color: default "FF000000"

condense

condense

extend

extend

family

font family: default "2"

i

italic

name

font name: default "Calibri"

outline

outline

scheme

font scheme: default "minor"

shadow

shadow

strike

strike

sz

font size: default "11",

u

underline

vertAlign

vertical alignment

Examples

Run this code
font <- create_font()
# openxml has the alpha value leading
hex8 <- unlist(xml_attr(read_xml(font), "font", "color"))
hex8 <- paste0("#", substr(hex8, 3, 8), substr(hex8, 1,2))

# # write test color
# col <- crayon::make_style(col2rgb(hex8, alpha = TRUE))
# cat(col("Test"))

Run the code above in your browser using DataLab