Title: Set of Installed Fonts
Version: 0.2.1
Description: Provides a set of fonts with permissive licences. This is useful when you want to avoid system fonts to make sure your outputs are reproducible.
Depends: R (≥ 3.0.0)
Imports: fontBitstreamVera (≥ 0.1.0), fontLiberation (≥ 0.1.0)
Suggests: testthat, htmltools
License: GPL-3 | file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 5.0.1
Collate: 'font-getters.R' 'fontset.R' 'fontset-bitstream-vera.R' 'fontset-dejavu.R' 'fontset-liberation.R' 'fontset-symbola.R' 'html-dependency.R' 'utils.R'
NeedsCompilation: no
Packaged: 2017-01-31 20:11:24 UTC; lionel
Author: Lionel Henry [cre, aut], RStudio [cph], George Douros [cph] (Symbola font)
Maintainer: Lionel Henry <lionel@rstudio.com>
Repository: CRAN
Date/Publication: 2017-02-01 00:52:56

Font families and faces

Description

Returns families or faces as font files for a given font set. The files are organised by R nomenclature of families ("sans", "serif", "mono", and "symbol") and faces ("plain", "italic", "bold", and "bolditalic"). When a font does not have a combination, NA is reported.

Usage

font_families(fontset)

font_faces(fontset, family = c("sans", "serif", "mono", "symbol"))

Arguments

fontset

A string giving the name of a set of fonts (e.g. "Liberation" or"Bitstream Vera"). Use fontset_list() to obtain the list of fontsets registered in your session.

family

One of "sans", "serif", "mono" or "symbol".

Details

Note that the fonts returned by font_faces() and font_families() are constrained by R's nomenclature of fonts and are thus a subset of those returned by font_variants() and font_styles().

See Also

font_variants(), fonts()

Examples

font_families("Bitstream Vera")$mono$bold
font_faces("Bitstream Vera", "mono")

Font variants

Description

font_variants() returns a tree of fonts organised as per fontconfig's nomenclature. The first level contains variants of a font and the second level contains font styles.

Usage

font_variants(fontset)

font_styles(fontset, variant)

Arguments

fontset

A string giving the name of a set of fonts (e.g. "Liberation" or"Bitstream Vera"). Use fontset_list() to obtain the list of fontsets registered in your session.

variant

Font variant, as per Fontconfig's nomenclature. Use fontset_variants() to find out which variants are available for a fontset.

Details

See also font_families() and font_faces() for similar collections organised according to R nomenclature of fonts. Note that variants and styles are a super set of R families and faces and may contain more fonts.

See Also

font_families(), fonts()

Examples

font_variants("Bitstream Vera")
font_variants("Bitstream Vera")$Sans$Oblique
font_styles("Bitstream Vera", "Sans")

Get elements of a fontset

Description

fonts() returns the list of all font objects for a given fontset (a collection of fonts provided by fontquiver, such as Liberation or Bitstream Vera). font() returns one specific font. font_symbol() extracts the font marked as symbol font, if it exists in the fontset.

Usage

fonts(fontset)

font(fontset, variant, style)

font_symbol(fontset = "Symbola")

Arguments

fontset

A string giving the name of a set of fonts (e.g. "Liberation" or"Bitstream Vera"). Use fontset_list() to obtain the list of fontsets registered in your session.

variant

Font variant, as per Fontconfig's nomenclature. Use fontset_variants() to find out which variants are available for a fontset.

style

Font style, as per Fontconfig's nomenclature. Use fontset_styles() to find out which variants are available for a fontset.

Examples

font("Bitstream Vera", "Sans", "Roman")

f <- fonts("Liberation")
str(f, 1)

font_symbol("Symbola")

Fontset metadata

Description

This returns a data frame containing metadata about fonts. The columns "variant" and "style" correspond to the properties of the font as reported by fontconfig. The columns "family", "italic" and "bold" provide information in terms of R nomenclature of fonts. The column "base" gives the base filename of the font. See fontset_list() to obtain a list of available fontsets.

Usage

fontset_info(fontset)

Arguments

fontset

A string giving the name of a set of fonts (e.g. "Liberation" or"Bitstream Vera"). Use fontset_list() to obtain the list of fontsets registered in your session.

See Also

fontset_list(), font_families(), font_variants()


Get list of all registered fonts

Description

Get list of all registered fonts

Usage

fontset_list()

Register a font to fontquiver

Description

Register a font to fontquiver

Usage

fontset_register(fontset, getter, files)

Arguments

fontset

Name of the font set.

getter

Constructor of font objects.

files

Data structure containing font information.


Fontset variants and styles

Description

These functions return the variants and the styles available for a given fontset.

Usage

fontset_variants(fontset)

fontset_styles(fontset, variant)

Arguments

fontset

A string giving the name of a set of fonts (e.g. "Liberation" or"Bitstream Vera"). Use fontset_list() to obtain the list of fontsets registered in your session.

variant

Font variant, as per Fontconfig's nomenclature. Use fontset_variants() to find out which variants are available for a fontset.

Examples

fontset_variants("Liberation")
fontset_styles("Bitstream Vera", "Sans Mono")

Include font as CSS dependency

Description

Include font as CSS dependency

Usage

htmlFontDependency(...)

Arguments

...

Fonts or collections of fonts. See font_families() and font_variants() for creating collections of fonts. You can also supply lists of individual fonts as returned by fonts().

Examples

# Create an htmlDependency object:
dep <- htmlFontDependency(font_families("Bitstream Vera"))

# Use the fonts in your dependent css or html files. For example:
# body {
#  font-family: 'Bitstream Vera Sans Mono', courier;
# }

Splice fonts and font collections

Description

splice_fonts() Reduces its arguments to a flat list. It accepts indinstinctly font objects, lists of font objects (obtained with fonts()), or collections of fonts produced by font_variants() or font_families(). Duplicate fonts are removed from the result.

Usage

splice_fonts(...)

Arguments

...

Fonts or collections of fonts. See font_families() and font_variants() for creating collections of fonts. You can also supply lists of individual fonts as returned by fonts().

Examples

splice_fonts(font("Bitstream Vera", "Sans", "Oblique"), font_faces("Bitstream Vera", "mono"))

mirror server hosted at Truenetwork, Russian Federation.