% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{fmt_txt}
\alias{fmt_txt}
\alias{+.fmt_txt}
\alias{as.character.fmt_txt}
\alias{print.fmt_txt}
\title{format strings independent of the cell style.}
\usage{
fmt_txt(
  x,
  bold = FALSE,
  italic = FALSE,
  underline = FALSE,
  strike = FALSE,
  size = NULL,
  color = NULL,
  font = NULL,
  charset = NULL,
  outline = NULL,
  vert_align = NULL,
  family = NULL,
  shadow = NULL,
  condense = NULL,
  extend = NULL,
  ...
)

\method{+}{fmt_txt}(x, y)

\method{as.character}{fmt_txt}(x, ...)

\method{print}{fmt_txt}(x, ...)
}
\arguments{
\item{x, y}{an openxlsx2 fmt_txt string}

\item{bold, italic, underline, strike}{logical defaulting to \code{FALSE}}

\item{size}{the font size}

\item{color}{a \code{\link[=wb_color]{wb_color()}} for the font}

\item{font}{the font name}

\item{charset}{integer value from the table below}

\item{outline, shadow, condense, extend}{logical defaulting to \code{NULL}}

\item{vert_align}{any of \code{baseline}, \code{superscript}, or \code{subscript}}

\item{family}{a font family}

\item{...}{additional arguments}
}
\description{
format strings independent of the cell style.
}
\details{
The result is an xml string. It is possible to paste multiple \code{fmt_txt()}
strings together to create a string with differing styles. It is possible to
supply different underline styles to \code{underline}.

Using \code{fmt_txt(charset = 161)} will give the Greek Character Set\tabular{ll}{
   charset \tab "Character Set" \cr
   0 \tab "ANSI_CHARSET" \cr
   1 \tab "DEFAULT_CHARSET" \cr
   2 \tab "SYMBOL_CHARSET" \cr
   77 \tab "MAC_CHARSET" \cr
   128 \tab "SHIFTJIS_CHARSET" \cr
   129 \tab "HANGUL_CHARSET" \cr
   130 \tab "JOHAB_CHARSET" \cr
   134 \tab "GB2312_CHARSET" \cr
   136 \tab "CHINESEBIG5_CHARSET" \cr
   161 \tab "GREEK_CHARSET" \cr
   162 \tab "TURKISH_CHARSET" \cr
   163 \tab "VIETNAMESE_CHARSET" \cr
   177 \tab "HEBREW_CHARSET" \cr
   178 \tab "ARABIC_CHARSET" \cr
   186 \tab "BALTIC_CHARSET" \cr
   204 \tab "RUSSIAN_CHARSET" \cr
   222 \tab "THAI_CHARSET" \cr
   238 \tab "EASTEUROPE_CHARSET" \cr
   255 \tab "OEM_CHARSET" \cr
}

You can join additional objects into fmt_txt() objects using "+".
Though be aware that \code{fmt_txt("sum:") + (2 + 2)} is different to \code{fmt_txt("sum:") + 2 + 2}.
}
\examples{
fmt_txt("bar", underline = TRUE)
fmt_txt("foo ", bold = TRUE) + fmt_txt("bar")
as.character(fmt_txt(2))
}
\seealso{
\code{\link[=create_font]{create_font()}}
}
