Learn R Programming

openxlsx2 (version 1.9)

create_font: Create font format

Description

Create font format

Usage

create_font(
  b = "",
  charset = "",
  color = wb_color(hex = "FF000000"),
  condense = "",
  extend = "",
  family = "2",
  i = "",
  name = "Aptos Narrow",
  outline = "",
  scheme = "minor",
  shadow = "",
  strike = "",
  sz = "11",
  u = "",
  vert_align = "",
  ...
)

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 "Aptos Narrow"

outline

outline

scheme

font scheme: default "minor"

shadow

shadow

strike

strike

sz

font size: default "11",

u

underline

vert_align

vertical alignment

...

...

See Also

wb_add_font()

Other style creating functions: create_border(), create_cell_style(), create_colors_xml(), create_dxfs_style(), create_fill(), create_numfmt(), create_tablestyle()

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