Learn R Programming

gdtools (version 0.4.0)

str_metrics: Get font metrics for a string.

Description

Get font metrics for a string.

Usage

str_metrics(
  x,
  fontname = "sans",
  fontsize = 12,
  bold = FALSE,
  italic = FALSE,
  fontfile = ""
)

Value

A named numeric vector

Arguments

x

Character vector of strings to measure

fontname

Font name

fontsize

Font size

bold, italic

Is text bold/italic?

fontfile

Font file

Examples

Run this code
str_metrics("Hello World!")

Run the code above in your browser using DataLab