% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nr-draw.R
\name{nr_text_mono}
\alias{nr_text_mono}
\title{Draw text on a native raster image using the built-in monospaced
bitmapped font.}
\usage{
nr_text_mono(
  nr,
  x,
  y,
  str,
  color = "black",
  fontsize = 8L,
  hjust = 0.5,
  vjust = 0.5,
  use_alpha = TRUE
)
}
\arguments{
\item{nr}{native raster image}

\item{x, y}{coordinates of lower-left corner of text}

\item{str}{character string}

\item{color}{Color as a character string. Either a standard R color
(e.g. 'blue', 'white')
or a hex color of the form \code{#rrggbbaa}, \code{#rrggbb}, \code{#rgba}
or \code{#rgb}}

\item{fontsize}{height of font in pizels.  Only valid values are 8, 12 and 16.
Default: 8.}

\item{hjust, vjust}{Justification of text relative to its \code{(x,y)}
location.  Default \code{(0.5, 0.5)} to centre the text at (x, y)}

\item{use_alpha}{Use alpha channel when drawing? Logical. Default: TRUE}
}
\value{
Invisibly return the supplied native raster image which was been
        modified in-place
}
\description{
The only font currently available is 'spleen' - a monospace
bitmap font from: https://github.com/fcambus/spleen
}
\details{
The 'spleen' font is licensed under BSD and the license is included in this
package as "LICENSE-spleen.txt". 
To view LICENSE: 

\code{cat(readLines(system.file('LICENSE-spleen.txt', package = 'nara')), 
 sep = "\n")}
}
\examples{
w <- 150
h <- 30
nr <- nr_new(w, h, 'grey80')

nr_text_mono(nr, x = w/2, y = h/2, str = "Hello RStats!", fontsize = 16)
plot(nr)

nr <- nr_new(w, h, 'grey80')
nr_text_mono(nr, x = 0, y = 0, str = "Hello RStats!", hjust = 0, vjust = 1, fontsize = 16)
plot(nr)
}
