| font_info | R Documentation |
Get general information about a font, relative to a given size. Size specific measures will be returned in pixel units. The function is vectorised to the length of the longest argument.
font_info(
family = "",
italic = FALSE,
weight = "normal",
width = "undefined",
size = 12,
res = 72,
path = NULL,
index = 0,
variation = font_variation(),
bold = deprecated()
)
family |
The name of the font families to match |
italic |
logical indicating the font slant |
weight |
The weight to query for, either in numbers ( |
width |
The width to query for either in numbers ( |
size |
The pointsize of the font to use for size related measures |
res |
The ppi of the size related measures |
path, index |
path and index of a font file to circumvent lookup based on family and style |
variation |
A |
bold |
A data.frame giving info on the requested font + size combinations. The data.frame will contain the following columns:
The path to the font file
The 0-based index of the font in the fontfile
The family name of the font
The style name of the font
The name of the font, if present, otherwise the family name
A logical giving if the font is italic
A logical giving if the font is bold
A logical giving if the font is monospace
A factor giving the weight of the font
A factor giving the width of the font
A logical giving if the font supports kerning
A logical giving if the font has color glyphs
A logical giving if the font is scalable
A logical giving if the font is vertical
The number of glyphs in the font
The number of predefined sizes in the font
The number of character mappings in the font file
A bounding box large enough to contain any of the glyphs in the font
The maximum ascend of the tallest glyph in the font
The maximum descend of the most descending glyph in the font
The maximum horizontal advance a glyph can make
The maximum vertical advance a glyph can make
The height of a single line of text in the font
The position of a potential underlining segment
The width the the underline
A list column with the character mappings supported by the font
A list column describing the variation axes of a variable font. Each element is a named list, keyed by axis tag, of numeric vectors giving the current setting, minimum, default, and maximum of the axis. Empty for non-variable fonts
font_info('serif')
# Avoid lookup if font file is already known
sans <- match_fonts('sans')
font_info(path = sans$path, index = sans$index)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.