diff --git a/404.html b/404.html index ff6f2a1..378a0cf 100644 --- a/404.html +++ b/404.html @@ -26,7 +26,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html index 3d23318..882cbbf 100644 --- a/CODE_OF_CONDUCT.html +++ b/CODE_OF_CONDUCT.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/LICENSE-text.html b/LICENSE-text.html index 541c237..8454a6d 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/LICENSE.html b/LICENSE.html index 3ca8ad9..350e62e 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/articles/c_interface.html b/articles/c_interface.html index 070a8d7..0b63231 100644 --- a/articles/c_interface.html +++ b/articles/c_interface.html @@ -28,7 +28,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/articles/index.html b/articles/index.html index 48c4e33..36f62a3 100644 --- a/articles/index.html +++ b/articles/index.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/authors.html b/authors.html index 9a5ebc4..cd4438a 100644 --- a/authors.html +++ b/authors.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 @@ -76,13 +76,13 @@ Citation Pedersen T, Ooms J, Govett D (2024). systemfonts: System Native Font Finding. -R package version 1.0.6.9000, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts. +R package version 1.1.0, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts. @Manual{, title = {systemfonts: System Native Font Finding}, author = {Thomas Lin Pedersen and Jeroen Ooms and Devon Govett}, year = {2024}, - note = {R package version 1.0.6.9000, https://systemfonts.r-lib.org}, + note = {R package version 1.1.0, https://systemfonts.r-lib.org}, url = {https://github.com/r-lib/systemfonts}, } diff --git a/index.html b/index.html index c2f7b90..6526346 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/news/index.html b/news/index.html index c3cd3ff..eb270e7 100644 --- a/news/index.html +++ b/news/index.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 @@ -51,7 +51,7 @@ -systemfonts (development version) +systemfonts 1.1.0 match_fonts() have been added as a vectorized and generalized version of match_font(). In the process match_font() has been deprecated in favour of match_fonts() diff --git a/pkgdown.yml b/pkgdown.yml index 3230282..a689be2 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: c_interface: c_interface.html -last_built: 2024-05-13T13:52Z +last_built: 2024-05-15T12:08Z urls: reference: https://systemfonts.r-lib.org/reference article: https://systemfonts.r-lib.org/articles diff --git a/reference/as_font_weight.html b/reference/as_font_weight.html index 2e19a27..f4e025b 100644 --- a/reference/as_font_weight.html +++ b/reference/as_font_weight.html @@ -16,7 +16,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/font_fallback.html b/reference/font_fallback.html index 0023f46..0e74803 100644 --- a/reference/font_fallback.html +++ b/reference/font_fallback.html @@ -24,7 +24,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/font_feature.html b/reference/font_feature.html index 11c0961..b7ad3f5 100644 --- a/reference/font_feature.html +++ b/reference/font_feature.html @@ -18,7 +18,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/font_info.html b/reference/font_info.html index da1c505..49f1da0 100644 --- a/reference/font_info.html +++ b/reference/font_info.html @@ -14,7 +14,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/get_fallback.html b/reference/get_fallback.html index 0777013..693dbda 100644 --- a/reference/get_fallback.html +++ b/reference/get_fallback.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/glyph_info.html b/reference/glyph_info.html index b388115..ed2f341 100644 --- a/reference/glyph_info.html +++ b/reference/glyph_info.html @@ -14,7 +14,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/index.html b/reference/index.html index 1df077a..0f13ca3 100644 --- a/reference/index.html +++ b/reference/index.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/match_fonts.html b/reference/match_fonts.html index 54aa302..b5437e6 100644 --- a/reference/match_fonts.html +++ b/reference/match_fonts.html @@ -26,7 +26,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/register_font.html b/reference/register_font.html index d75e45f..0076c62 100644 --- a/reference/register_font.html +++ b/reference/register_font.html @@ -22,7 +22,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/register_variant.html b/reference/register_variant.html index c09fa9d..f29c1bf 100644 --- a/reference/register_variant.html +++ b/reference/register_variant.html @@ -14,7 +14,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/reset_font_cache.html b/reference/reset_font_cache.html index 23ae55d..efc2ad2 100644 --- a/reference/reset_font_cache.html +++ b/reference/reset_font_cache.html @@ -18,7 +18,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/shape_string.html b/reference/shape_string.html index 3efa79d..c530922 100644 --- a/reference/shape_string.html +++ b/reference/shape_string.html @@ -18,7 +18,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/str_split_emoji.html b/reference/str_split_emoji.html index d585cfb..f609c33 100644 --- a/reference/str_split_emoji.html +++ b/reference/str_split_emoji.html @@ -20,7 +20,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/string_metrics_dev.html b/reference/string_metrics_dev.html index ba24b31..ef843d3 100644 --- a/reference/string_metrics_dev.html +++ b/reference/string_metrics_dev.html @@ -14,7 +14,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/string_width.html b/reference/string_width.html index f9c6c14..e2ff07f 100644 --- a/reference/string_width.html +++ b/reference/string_width.html @@ -16,7 +16,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/string_widths_dev.html b/reference/string_widths_dev.html index b3b142e..2caab7c 100644 --- a/reference/string_widths_dev.html +++ b/reference/string_widths_dev.html @@ -20,7 +20,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/system_fonts.html b/reference/system_fonts.html index 39bbc7b..7ea0405 100644 --- a/reference/system_fonts.html +++ b/reference/system_fonts.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/reference/systemfonts-package.html b/reference/systemfonts-package.html index bf1a9b7..3e1c383 100644 --- a/reference/systemfonts-package.html +++ b/reference/systemfonts-package.html @@ -10,7 +10,7 @@ systemfonts - 1.0.6.9000 + 1.1.0 diff --git a/search.json b/search.json index 3dcb877..1c843be 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://systemfonts.r-lib.org/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (https://www.contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":"https://systemfonts.r-lib.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2019 Thomas Lin Pedersen Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-matching","dir":"Articles","previous_headings":"","what":"Font matching","title":"systemfonts C interface","text":"C equivalent match_font() R function locate_font() following signature: takes UTF-8 encoded string font family name, int setting italic bold styles along char pointer filled located path maximum length can hold. return value int giving index font font file. advent systemfonts 0.3.0 fonts can now also OpenType features attached use register_font() register_variant(). wish support features can use alternative : returned FontSettings struct contain font location index along OpenType feature settings. struct (along FontFeature struct dependency) shown pretty self-documenting. cache FontSettings struct features array may cleared time call ended. systemfonts takes care caching something concerned code.","code":"int locate_font( const char *family, int italic, int bold, char *path, int max_path_length ) FontSettings locate_font_with_features( const char *family, int italic, int bold ) struct FontFeature { char feature[4]; int setting; }; struct FontSettings { char file[PATH_MAX + 1]; unsigned int index; const FontFeature* features; int n_features; };"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"glyph-metrics","dir":"Articles","previous_headings":"","what":"Glyph metrics","title":"systemfonts C interface","text":"C equivalent glyph_info() glyph_metrics() following signature: takes glyph measure int giving UTF code glyph, along fontfile index identify font measure . takes size pt resolution ppi. write ascent, descent, width pts pointers passed , return 0 operation successful.","code":"int glyph_metrics( uint32_t code, const char* fontfile, int index, double size, double res, double* ascent, double* descent, double* width )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"string-width","dir":"Articles","previous_headings":"","what":"String width","title":"systemfonts C interface","text":"C equivalent string_width() R function also called string_width() following signature: function calculates width string, ignoring newlines (automatically handled graphic engine). takes UTF-8 encoded string, along fontfile index identifying font use calculation. also take size pt res ppi setting size. addition takes include_bearing flag control whether bearings first last character taken account (recommended graphic engine). write width pts passed pointer return 0 successful.","code":"string_width( const char* string, const char* fontfile, int index, double size, double res, int include_bearing, double* width )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"string-shape","dir":"Articles","previous_headings":"","what":"String shape","title":"systemfonts C interface","text":"parred version shape_string() accessible C level string_shape(). behaves less like string_width() , instead returns location write glyph relative (0, 0) origin. string_shape() behaves less like string_width() , instead returns location write glyph relative (0, 0) origin. takes UTF-8 encoded string, along fontfile index identifying font use calculation. also take size pt res ppi setting size. addition takes include_bearing flag control whether bearings first last character taken account (recommended graphic engine). write x y location glyph pts passed arrays, stopping provided max_length return 0 successful.","code":"string_shape( const char* string, const char* fontfile, int index, double size, double res, double* x, double* y, unsigned int max_length )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"retrieving-cached-freetype-face","dir":"Articles","previous_headings":"","what":"Retrieving cached freetype face","title":"systemfonts C interface","text":"heavy part text layouting reading parsing font files. systemfonts contains cache make sure parsing kept minimum. want use cache load cache freetype face object (FT_Face) can use get_cached_face(). resides separate header (systemfonts-ft.h) requires FreeType linked package, rest C api . look cache face size matches request return found. , load add cache, returning . get_cached_face() sets passed error pointer 0 successful. Freetype uses reference counting keep track objects count increased call get_cached_face(). responsiblity caller decrease face longer needed using FT_Done_Face().","code":"get_cached_face( const char* fontfile, int index, double size, double res, int * error )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-fallback","dir":"Articles","previous_headings":"","what":"Font fallback","title":"systemfonts C interface","text":"rendering text given requested characters glyph given font. one can elect render “missing glyph” glyph (often either empty square questionmark tilted square) better approach often find font substitute contain character use rendering . function allows find fallback font given string font. string stripped characters already know render. fallback font returned FontSettings object, though features always empty.","code":"FontSettings get_fallback( const char* string, const char* path, int index )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-weight","dir":"Articles","previous_headings":"","what":"Font Weight","title":"systemfonts C interface","text":"encoding text CSS may necessary know exact weight font given file may reflected style sheet. function takes path index returns weight (100-900 steps 100) 0 undefined font.","code":"int get_font_weight( const char* path, int index )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"family-name","dir":"Articles","previous_headings":"","what":"Family name","title":"systemfonts C interface","text":"may beneficial know family name given path index font. can obtained get_font_family() write name provided char* argument. return 0 somehow unsuccessful.","code":"int get_font_family( const char* path, int index, char* family, int max_length )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"emoji-location","dir":"Articles","previous_headings":"","what":"Emoji location","title":"systemfonts C interface","text":"Figuring character string treated emoji non-trivial due existence emojis text representation default etc. systemfonts allow get embedding emojis string based correct rules.","code":"void detect_emoji_embedding( const uint32_t* string, int n, int* embedding, const char *path, int index )"},{"path":"https://systemfonts.r-lib.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Thomas Lin Pedersen. Author, maintainer. Jeroen Ooms. Author. Devon Govett. Author. Author font-manager . Copyright holder, funder.","code":""},{"path":"https://systemfonts.r-lib.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Pedersen T, Ooms J, Govett D (2024). systemfonts: System Native Font Finding. R package version 1.0.6.9000, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts.","code":"@Manual{, title = {systemfonts: System Native Font Finding}, author = {Thomas Lin Pedersen and Jeroen Ooms and Devon Govett}, year = {2024}, note = {R package version 1.0.6.9000, https://systemfonts.r-lib.org}, url = {https://github.com/r-lib/systemfonts}, }"},{"path":"https://systemfonts.r-lib.org/index.html","id":"systemfonts","dir":"","previous_headings":"","what":"System Native Font Finding","title":"System Native Font Finding","text":"systemfonts package locates installed fonts. uses system-native libraries Mac (CoreText) Linux (FontConfig), uses Freetype parse fonts registry Windows.","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"System Native Font Finding","text":"systemfonts available CRAN using install.packages('systemfonts'). however still development can install development version using devtools.","code":"# install.packages('devtools') devtools::install_github('r-lib/systemfonts')"},{"path":"https://systemfonts.r-lib.org/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"System Native Font Finding","text":"main use package locate font files based family style: function returns path file holding font, well 0-based index font file. also possible get data.frame available fonts: , can query additional information fonts specific glyphs, interest using font_info() glyph_info() functions.","code":"library(systemfonts) match_fonts('Avenir', italic = TRUE) #> path index features #> 1 /System/Library/Fonts/Avenir.ttc 1 system_fonts() #> # A tibble: 843 × 9 #> path index name family style weight width italic monospace #> #> 1 /System/Library/Fonts… 2 Rock… Rockw… Bold bold norm… FALSE FALSE #> 2 /Users/thomas/Library… 0 Open… Open … Ligh… normal norm… TRUE FALSE #> 3 /Users/thomas/Library… 0 Open… Open … Semi… semib… semi… TRUE FALSE #> 4 /System/Library/Fonts… 0 Note… Notew… Light normal norm… FALSE FALSE #> 5 /System/Library/Fonts… 1 Deva… Devan… Bold bold norm… FALSE FALSE #> 6 /System/Library/Fonts… 0 Kann… Kanna… Regu… normal norm… FALSE FALSE #> 7 /System/Library/Fonts… 0 Verd… Verda… Bold bold norm… FALSE FALSE #> 8 /System/Library/Fonts… 8 Aria… Arial… Light light norm… FALSE FALSE #> 9 /Users/thomas/Library… 0 Open… Open … Medi… medium norm… TRUE FALSE #> 10 /System/Library/Fonts… 10 Appl… Apple… Thin thin norm… FALSE FALSE #> # ℹ 833 more rows"},{"path":"https://systemfonts.r-lib.org/index.html","id":"c-api","dir":"","previous_headings":"","what":"C API","title":"System Native Font Finding","text":"getting information R nice, intended use mostly compiled code graphic devices can easily locate relevant font files etc. order use functions systemfonts C(++) code package list systemfonts LinkingTo field DESCRIPTION file. done can now #include code use provided functions. Look inst/include/systemfonts.h file familiarise C API.","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"system-defaults","dir":"","previous_headings":"","what":"System Defaults","title":"System Native Font Finding","text":"systemfonts always try find font , even none exist given family name style. resolves system specific relied , can expected valid font file always returned matter input. special aliases exist behaves predictably system dependent: \"\" \"sans\" return Helvetica Mac, Arial Windows, default sans-serif font Linux (DejaVu Sans Ubuntu) \"serif\" return Times Mac, Times New Roman Windows, default serif font Linux (DejaVu Serif Ubuntu) \"mono\" return Courier Mac, Courier New Windows, default mono font Linux (DejaVu Mono Ubuntu) \"emoji\" return Apple Color Emoji Mac, Segoe UI Emoji Windows, default emoji font Linux (Noto Color Ubuntu)","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"System Native Font Finding","text":"Please note ‘systemfonts’ project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert weight and width to numerics — as_font_weight","title":"Convert weight and width to numerics — as_font_weight","text":"often natural describe font weight width names rather numbers (e.g. \"bold\" \"condensed\"), underneath names matched numeric values. two functions used retrieve numeric counterparts names","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert weight and width to numerics — as_font_weight","text":"","code":"as_font_weight(weight) as_font_width(width)"},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert weight and width to numerics — as_font_weight","text":"weight, width character vectors valid names weight width","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert weight and width to numerics — as_font_weight","text":"integer vector matching length input","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert weight and width to numerics — as_font_weight","text":"","code":"as_font_weight( c(\"undefined\", \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\") ) #> [1] 0 100 200 300 400 500 600 700 800 900 as_font_width( c(\"undefined\", \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\") ) #> [1] 0 1 2 3 4 5 6 7 8 9"},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the fallback font for a given string — font_fallback","title":"Get the fallback font for a given string — font_fallback","text":"fallback font font use substitute chosen font contain requested characters. Using font fallbacks means user worry mixing characters different scripts mixing text emojies. Fallback calculated full string result platform specific. font covers characters string undefined \"best match\" returned. best approach figure characters covered chosen font figure fallbacks , rather just request fallback full string.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the fallback font for a given string — font_fallback","text":"","code":"font_fallback( string, family = \"\", italic = FALSE, bold = FALSE, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the fallback font for a given string — font_fallback","text":"string strings find fallbacks family name font families match italic logical indicating font slant bold logical indicating whether font weight path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the fallback font for a given string — font_fallback","text":"data frame path index column giving fallback specified string font combinations","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the fallback font for a given string — font_fallback","text":"","code":"font_fallback(\"\\U0001f604\") # Smile emoji #> path index #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf 0"},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":null,"dir":"Reference","previous_headings":"","what":"Define OpenType font feature settings — font_feature","title":"Define OpenType font feature settings — font_feature","text":"function encapsulates specification OpenType font features. specific features named arguments, available features can set using specific 4-letter tag list 4-letter tags available see e.g. overview Wikipedia.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define OpenType font feature settings — font_feature","text":"","code":"font_feature(ligatures = NULL, letters = NULL, numbers = NULL, ...)"},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define OpenType font feature settings — font_feature","text":"ligatures Settings related ligatures. One types ligatures turn (see details). letters Settings related appearance single letters (opposed ligatures substitutes multiple letters). See details supported values. numbers Settings related appearance numbers. See details supported values. ... key-value pairs key 4-letter tag value setting (usually TRUE turn ).","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define OpenType font feature settings — font_feature","text":"font_feature object","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define OpenType font feature settings — font_feature","text":"OpenType features defined 4-letter tag along integer value. Often value simple 0 () 1 (), features support additional values, e.g. stylistic alternates (salt) font may provide multiple variants letter value used chose one use. Common features related appearance may given long form name either ligatures, letters, numbers argument avoid remembering often arbitrary 4-letter tag. Providing long form name setting tag 1 can thus used set tags values. possible long form names given tag parenthesis: Ligatures standard (liga): Turns standard multiple letter substitution historical (hlig): Use obsolete historical ligatures contextual (clig): Apply secondary ligatures based character patterns surrounding potential ligature discretionary (dlig): Use ornamental ligatures Letters swash (cswh): Use contextual swashes (ornamental decorations) alternates (calt): Use alternate letter forms based sourrounding pattern historical (hist): Use obsolete historical forms letters localized (locl): Use alternate forms preferred script language randomize (rand): Use random variants letters (e.g. mimick handwriting) alt_annotation (nalt): Use alternate annotations (e.g. circled digits) stylistic (salt): Use stylistic alternative form letter subscript (subs): Set letter subscript superscript (sups): Set letter superscript titling (titl): Use letter forms well suited large text titles small_caps (smcp): Use small caps variants letters Numbers lining (lnum): Use number variants rest baseline oldstyle (onum): Use old style numbers use descender ascender various numbers proportional (pnum): Let numbers take width based visual width glyph tabular (tnum): Enforce numbers take width fractions (frac): Convert numbers separated / fraction glyph fractions_alt (afrc): Use alternate fraction form horizontal divider","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define OpenType font feature settings — font_feature","text":"","code":"font_feature(letters = \"stylistic\", numbers = c(\"lining\", \"tabular\")) #> A list of OpenType font feature settings #> - salt: 1 #> - lnum: 1 #> - tnum: 1 # Use the tag directly to access additional stylistic variants font_feature(numbers = c(\"lining\", \"tabular\"), salt = 2) #> A list of OpenType font feature settings #> - salt: 2 #> - lnum: 1 #> - tnum: 1"},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query font-specific information — font_info","title":"Query font-specific information — font_info","text":"Get general information font, relative given size. Size specific measures returned pixel units. function vectorised length longest argument.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query font-specific information — font_info","text":"","code":"font_info( family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query font-specific information — font_info","text":"family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query font-specific information — font_info","text":"data.frame giving info requested font + size combinations. data.frame contain following columns: path path font file index 0-based index font fontfile family family name font style style name font italic logical giving font italic bold logical giving font bold monospace logical giving font monospace weight factor giving weight font width factor giving width font kerning logical giving font supports kerning color logical giving font color glyphs scalable logical giving font scalable vertical logical giving font vertical n_glyphs number glyphs font n_sizes number predefined sizes font n_charmaps number character mappings font file bbox bounding box large enough contain glyphs font max_ascend maximum ascend tallest glyph font max_descent maximum descend descending glyph font max_advance_width maximum horizontal advance glyph can make max_advance_height maximum vertical advance glyph can make lineheight height single line text font underline_pos position potential underlining segment underline_size width underline","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query font-specific information — font_info","text":"","code":"font_info('serif') #> # A tibble: 1 × 24 #> path index family style italic bold monospace weight width kerning #> #> 1 /usr/sha… 0 DejaV… Book FALSE FALSE FALSE normal norm… TRUE #> # ℹ 14 more variables: color , scalable , vertical , #> # n_glyphs , n_sizes , n_charmaps , bbox , #> # max_ascend , max_descend , max_advance_width , #> # max_advance_height , lineheight , underline_pos , #> # underline_size # Avoid lookup if font file is already known sans <- match_fonts('sans') font_info(path = sans$path, index = sans$index) #> # A tibble: 1 × 24 #> path index family style italic bold monospace weight width kerning #> #> 1 /usr/sha… 0 DejaV… Book FALSE FALSE FALSE normal norm… TRUE #> # ℹ 14 more variables: color , scalable , vertical , #> # n_glyphs , n_sizes , n_charmaps , bbox , #> # max_ascend , max_descend , max_advance_width , #> # max_advance_height , lineheight , underline_pos , #> # underline_size "},{"path":"https://systemfonts.r-lib.org/reference/get_fallback.html","id":null,"dir":"Reference","previous_headings":"","what":"Get location of the fallback font — get_fallback","title":"Get location of the fallback font — get_fallback","text":"Get location fallback font","code":""},{"path":"https://systemfonts.r-lib.org/reference/get_fallback.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get location of the fallback font — get_fallback","text":"","code":"get_fallback()"},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query glyph-specific information from fonts — glyph_info","title":"Query glyph-specific information from fonts — glyph_info","text":"function allows extract information individual glyphs font, based specified size. size related measures pixel-units. function vectorised length glyphs vector.","code":""},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query glyph-specific information from fonts — glyph_info","text":"","code":"glyph_info( glyphs, family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query glyph-specific information from fonts — glyph_info","text":"glyphs vector glyphs. Strings split separate glyphs automatically family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query glyph-specific information from fonts — glyph_info","text":"data.frame information glyph, containing following columns: glyph glyph character index index glyph font file width width glyph height height glyph x_bearing horizontal distance origin leftmost part glyph y_bearing vertical distance origin top part glyph x_advance horizontal distance move cursor adding glyph y_advance vertical distance move cursor adding glyph bbox tight bounding box surrounding glyph","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":null,"dir":"Reference","previous_headings":"","what":"Find a system font by name and style — match_fonts","title":"Find a system font by name and style — match_fonts","text":"function locates font file (index) best matching name optional style. font file returned even perfect match found, necessarily similar requested family relied font substitution. aliases \"sans\", \"serif\", \"mono\", \"symbol\", \"emoji\" match respective system defaults (\"\" equivalent \"sans\"). match_font() deprecated favour match_fonts() provides vectorisation, well querying different weights (rather just \"normal\" \"bold\") well different widths.","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find a system font by name and style — match_fonts","text":"","code":"match_fonts(family, italic = FALSE, weight = \"normal\", width = \"undefined\") match_font(family, italic = FALSE, bold = FALSE)"},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find a system font by name and style — match_fonts","text":"family name font families match italic logical indicating font slant weight weight query , either numbers (0, 100, 200, 300, 400, 500, 600, 700, 800, 900) strings (\"undefined\", \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\"). NA interpreted \"undefined\"/0 width width query either numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) strings (\"undefined\", \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\"). NA interpreted \"undefined\"/0 bold logical indicating whether font weight","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find a system font by name and style — match_fonts","text":"list containing paths locating font files, 0-based index font files features font case registered font located.","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find a system font by name and style — match_fonts","text":"","code":"# Get the system default sans-serif font in italic match_fonts('sans', italic = TRUE) #> # A tibble: 1 × 3 #> path index features #> #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf 0 # Try to match it to a thin variant match_fonts(c('sans', 'serif'), weight = \"thin\") #> # A tibble: 2 × 3 #> path index features #> #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight… 0 #> 2 /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf 0 "},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":null,"dir":"Reference","previous_headings":"","what":"Register font collections as families — register_font","title":"Register font collections as families — register_font","text":"design, systemfonts searches fonts installed natively system. possible, however, register fonts e.g. font packages local font files, get searched searching installed fonts. can always get overview registered fonts registry_fonts() function works registry focused analogue system_fonts(). wish clear registry, can either restart R session call clear_registry().","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register font collections as families — register_font","text":"","code":"register_font( name, plain, bold = plain, italic = plain, bolditalic = plain, features = font_feature() ) registry_fonts() clear_registry()"},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register font collections as families — register_font","text":"name name collection known (.e. family) plain, bold, italic, bolditalic Fontfiles different faces collection. can either filepath list containing filepath index (font files containing multiple fonts). given default plain specification. features font_feature object describing specific OpenType font features turn registered font.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Register font collections as families — register_font","text":"register_font() clear_registry() returns NULL invisibly. registry_fonts() returns data table style system_fonts() though less detailed based information font file.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Register font collections as families — register_font","text":"register_font also makes possible use system fonts traits covered graphic engine R. plotting operations possible specify family name whether font bold /italic. numerous fonts never get matched , especially bold one many weights. Apart granting way use new varieties fonts, font registration also allows override default sans, serif, mono mappings, simply registering collection relevant default name. registered fonts searched first take precedence default.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Register font collections as families — register_font","text":"","code":"# Create a random font collection fonts <- system_fonts() plain <- sample(which(!fonts$italic & fonts$weight <= 'normal'), 1) bold <- sample(which(!fonts$italic & fonts$weight > 'normal'), 1) italic <- sample(which(fonts$italic & fonts$weight <= 'normal'), 1) bolditalic <- sample(which(fonts$italic & fonts$weight > 'normal'), 1) register_font( 'random', plain = list(fonts$path[plain], fonts$index[plain]), bold = list(fonts$path[bold], fonts$index[bold]), italic = list(fonts$path[italic], fonts$index[italic]), bolditalic = list(fonts$path[bolditalic], fonts$index[bolditalic]) ) # Look at your creation registry_fonts() #> # A tibble: 4 × 7 #> path index family style weight italic features #> #> 1 /usr/share/fonts/opentype/urw… 0 random Regu… normal FALSE #> 2 /usr/share/fonts/truetype/dej… 0 random Bold bold FALSE #> 3 /usr/share/fonts/type1/urw-ba… 0 random Ital… normal TRUE #> 4 /usr/share/fonts/opentype/urw… 0 random Bold… bold TRUE # Reset clear_registry()"},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":null,"dir":"Reference","previous_headings":"","what":"Register a font as a variant as an existing one — register_variant","title":"Register a font as a variant as an existing one — register_variant","text":"function wrapper around register_font() allows easily create variants existing system fonts, e.g. target different weights /widths, attaching OpenType features font.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register a font as a variant as an existing one — register_variant","text":"","code":"register_variant( name, family, weight = NULL, width = NULL, features = font_feature() )"},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register a font as a variant as an existing one — register_variant","text":"name new family name variant respond family name existing font family variant weight One two \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\". one given sets weight whole variant. two given first one defines plain weight second bold weight. NULL variants given family closest \"normal\" \"bold\" chosen. width One \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\" giving width variant. NULL width closest \"normal\" chosen. features font_feature object describing specific OpenType font features turn registered font variant.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Register a font as a variant as an existing one — register_variant","text":"","code":"# Get the default \"sans\" family sans <- match_fonts(\"sans\")$path sans <- system_fonts()$family[system_fonts()$path == sans][1] # Register a variant of it: register_variant( \"sans_ligature\", sans, features = font_feature(ligatures = \"discretionary\") ) registry_fonts() #> # A tibble: 4 × 7 #> path index family style weight italic features #> #> 1 /usr/share/fonts/truetype/dej… 0 sans_… Regu… normal FALSE #> 2 /usr/share/fonts/truetype/dej… 0 sans_… Bold bold FALSE #> 3 /usr/share/fonts/truetype/dej… 0 sans_… Ital… normal TRUE #> 4 /usr/share/fonts/truetype/dej… 0 sans_… Bold… bold TRUE # clean up clear_registry()"},{"path":"https://systemfonts.r-lib.org/reference/reset_font_cache.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset the system font cache — reset_font_cache","title":"Reset the system font cache — reset_font_cache","text":"Building list system fonts time consuming therefore cached. , turn, means changes system fonts (.e. installing new fonts), propagate systemfonts. solution reset cache, result next call e.g. match_fonts() trigger rebuild cache.","code":""},{"path":"https://systemfonts.r-lib.org/reference/reset_font_cache.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset the system font cache — reset_font_cache","text":"","code":"reset_font_cache()"},{"path":"https://systemfonts.r-lib.org/reference/reset_font_cache.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset the system font cache — reset_font_cache","text":"","code":"all_fonts <- system_fonts() ##-- Install a new font on the system --## all_fonts_new <- system_fonts() ## all_fonts_new will be equal to all_fonts reset_font_cache() all_fonts_new <- system_fonts() ## all_fonts_new will now contain the new font"},{"path":"https://systemfonts.r-lib.org/reference/shape_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate glyph positions for strings — shape_string","title":"Calculate glyph positions for strings — shape_string","text":"basic text shaping strings. function use freetype calculate advances, kerning possible. perform font substitution ligature resolving thus much line standard graphic devices text shaping. Inputs recycled length strings.","code":""},{"path":"https://systemfonts.r-lib.org/reference/shape_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate glyph positions for strings — shape_string","text":"","code":"shape_string( strings, id = NULL, family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, lineheight = 1, align = \"left\", hjust = 0, vjust = 0, width = NA, tracking = 0, indent = 0, hanging = 0, space_before = 0, space_after = 0, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/shape_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate glyph positions for strings — shape_string","text":"strings character vector strings shape id vector grouping strings together. strings share id shaping continue strings family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures lineheight multiplier lineheight align Within text box alignment, either 'left', 'center', 'right' hjust, vjust justification textbox surrounding text width requested string inches. Setting something NA turn word wrapping. tracking Tracking glyphs (space adjustment) measured 1/1000 em. indent indent first line paragraph measured inches. hanging indent remaining lines paragraph measured inches. space_before, space_after spacing paragraph, measured points path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/shape_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate glyph positions for strings — shape_string","text":"list two element: shape contains position glyph, relative origin enclosing textbox. metrics contain metrics full strings. shape data.frame following columns: glyph glyph character index index glyph font file metric_id index string glyph part (referencing row metrics data.frame) string_id index string glyph came (referencing element strings input) x_offset x offset pixels origin textbox y_offset y offset pixels origin textbox x_mid x offset pixels middle glyph, measured origin glyph metrics data.frame following columns: string text string consist width width string height height string left_bearing distance left edge textbox leftmost glyph right_bearing distance right edge textbox rightmost glyph top_bearing distance top edge textbox topmost glyph bottom_bearing distance bottom edge textbox bottommost glyph left_border position leftmost edge textbox related origin top_border position topmost edge textbox related origin pen_x horizontal position next glyph string pen_y vertical position next glyph string","code":""},{"path":"https://systemfonts.r-lib.org/reference/shape_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate glyph positions for strings — shape_string","text":"","code":"string <- \"This is a long string\\nLook; It spans multiple lines\\nand all\" # Shape with default settings shape_string(string) #> $shape #> # A tibble: 59 × 7 #> glyph index metric_id string_id x_offset y_offset x_midpoint #> #> 1 \"T\" 55 0 1 0 0 3.5 #> 2 \"h\" 75 0 1 7 0 4 #> 3 \"i\" 76 0 1 15 0 1.5 #> 4 \"s\" 86 0 1 18 0 3 #> 5 \" \" 3 0 1 24 0 2 #> 6 \"i\" 76 0 1 28 0 1.5 #> 7 \"s\" 86 0 1 31 0 3 #> 8 \" \" 3 0 1 37 0 2 #> 9 \"a\" 68 0 1 41 0 3.5 #> 10 \" \" 3 0 1 48 0 2 #> # ℹ 49 more rows #> #> $metrics #> # A tibble: 1 × 11 #> string width height left_bearing right_bearing top_bearing #> #> 1 \"This is a long str… 168 53.0 -1 0 1.14 #> # ℹ 5 more variables: bottom_bearing , left_border , #> # top_border , pen_x , pen_y #> # Mix styles within the same string string <- c( \"This string will have\\na \", \"very large\", \" text style\\nin the middle\" ) shape_string(string, id = c(1, 1, 1), size = c(12, 24, 12)) #> $shape #> # A tibble: 59 × 7 #> glyph index metric_id string_id x_offset y_offset x_midpoint #> #> 1 \"T\" 55 0 1 0 0 3.5 #> 2 \"h\" 75 0 1 7 0 4 #> 3 \"i\" 76 0 1 15 0 1.5 #> 4 \"s\" 86 0 1 18 0 3 #> 5 \" \" 3 0 1 24 0 2 #> 6 \"s\" 86 0 1 28 0 3 #> 7 \"t\" 87 0 1 34 0 2.5 #> 8 \"r\" 85 0 1 39 0 2.5 #> 9 \"i\" 76 0 1 44 0 1.5 #> 10 \"n\" 81 0 1 47 0 4 #> # ℹ 49 more rows #> #> $metrics #> # A tibble: 1 × 11 #> string width height left_bearing right_bearing top_bearing #> #> 1 \"This string will h… 194 67.0 -1 0 1.14 #> # ℹ 5 more variables: bottom_bearing , left_border , #> # top_border , pen_x , pen_y #>"},{"path":"https://systemfonts.r-lib.org/reference/str_split_emoji.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","title":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","text":"order correct text rendering, font needed must figured . common case rendering emojis within string system emoji font used rather requested font. function inspect provided strings split runs must rendered emoji font, rest. Arguments recycled length string vector.","code":""},{"path":"https://systemfonts.r-lib.org/reference/str_split_emoji.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","text":"","code":"str_split_emoji( string, family = \"\", italic = FALSE, bold = FALSE, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/str_split_emoji.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","text":"string character vector strings splitted. family name font families match italic logical indicating font slant bold logical indicating whether font weight path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/str_split_emoji.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","text":"data.frame containing following columns: string substring containing consecutive run glyphs id index original string vector substring part emoji logical vector giving substring run emojis ","code":""},{"path":"https://systemfonts.r-lib.org/reference/str_split_emoji.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a string into emoji and non-emoji glyph runs — str_split_emoji","text":"","code":"emoji_string <- \"This is a joke\\U0001f642. It should be obvious from the smiley\" str_split_emoji(emoji_string) #> # A tibble: 3 × 3 #> string id emoji #> #> 1 This is a joke 1 FALSE #> 2 🙂 1 TRUE #> 3 . It should be obvious from the smiley 1 FALSE"},{"path":"https://systemfonts.r-lib.org/reference/string_metrics_dev.html","id":null,"dir":"Reference","previous_headings":"","what":"Get string metrics as measured by the current device — string_metrics_dev","title":"Get string metrics as measured by the current device — string_metrics_dev","text":"function much like string_widths_dev() also returns ascent descent string making possible construct tight bounding box around string.","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_metrics_dev.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get string metrics as measured by the current device — string_metrics_dev","text":"","code":"string_metrics_dev( strings, family = \"\", face = 1, size = 12, cex = 1, unit = \"cm\" )"},{"path":"https://systemfonts.r-lib.org/reference/string_metrics_dev.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get string metrics as measured by the current device — string_metrics_dev","text":"strings character vector strings measure family font families use. get recycled face font faces use. get recycled size font size use. get recycled cex cex multiplier use. get recycled unit unit return width . Either \"cm\", \"inches\", \"device\", \"relative\"","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_metrics_dev.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get string metrics as measured by the current device — string_metrics_dev","text":"data.frame width, ascent, descent columns giving metrics requested unit.","code":""},{"path":[]},{"path":"https://systemfonts.r-lib.org/reference/string_metrics_dev.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get string metrics as measured by the current device — string_metrics_dev","text":"","code":"# Get the metrics as measured in cm (default) string_metrics_dev(c('some text', 'a string with descenders')) #> # A tibble: 2 × 3 #> width ascent descent #> #> 1 2.12 0.318 0.0353 #> 2 5.21 0.353 0.106"},{"path":"https://systemfonts.r-lib.org/reference/string_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the width of a string, ignoring new-lines — string_width","title":"Calculate the width of a string, ignoring new-lines — string_width","text":"simple alternative shape_string() simply calculates width strings without taking newline account. suitable calculate width words lines already splitted \\n. Input recycled length strings.","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the width of a string, ignoring new-lines — string_width","text":"","code":"string_width( strings, family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, include_bearing = TRUE, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/string_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the width of a string, ignoring new-lines — string_width","text":"strings character vector strings family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures include_bearing Logical, left right bearing included string width? path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_width.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the width of a string, ignoring new-lines — string_width","text":"numeric vector giving width strings pixels. Use provided res value convert absolute values.","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the width of a string, ignoring new-lines — string_width","text":"","code":"strings <- c('A short string', 'A very very looong string') string_width(strings) #> [1] 82 151"},{"path":"https://systemfonts.r-lib.org/reference/string_widths_dev.html","id":null,"dir":"Reference","previous_headings":"","what":"Get string widths as measured by the current device — string_widths_dev","title":"Get string widths as measured by the current device — string_widths_dev","text":"certain composition tasks beneficial get width string interpreted device going plot . grid provides construction textGrob converting corresponding grob width e.g. cm, comes huge overhead. string_widths_dev() provides direct, vectorised, access graphic device high performance possible.","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_widths_dev.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get string widths as measured by the current device — string_widths_dev","text":"","code":"string_widths_dev( strings, family = \"\", face = 1, size = 12, cex = 1, unit = \"cm\" )"},{"path":"https://systemfonts.r-lib.org/reference/string_widths_dev.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get string widths as measured by the current device — string_widths_dev","text":"strings character vector strings measure family font families use. get recycled face font faces use. get recycled size font size use. get recycled cex cex multiplier use. get recycled unit unit return width . Either \"cm\", \"inches\", \"device\", \"relative\"","code":""},{"path":"https://systemfonts.r-lib.org/reference/string_widths_dev.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get string widths as measured by the current device — string_widths_dev","text":"numeric vector width strings given strings unit given unit","code":""},{"path":[]},{"path":"https://systemfonts.r-lib.org/reference/string_widths_dev.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get string widths as measured by the current device — string_widths_dev","text":"","code":"# Get the widths as measured in cm (default) string_widths_dev(c('a string', 'an even longer string')) #> [1] 1.609549 4.536502"},{"path":"https://systemfonts.r-lib.org/reference/system_fonts.html","id":null,"dir":"Reference","previous_headings":"","what":"List all fonts installed on your system — system_fonts","title":"List all fonts installed on your system — system_fonts","text":"List fonts installed system","code":""},{"path":"https://systemfonts.r-lib.org/reference/system_fonts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List all fonts installed on your system — system_fonts","text":"","code":"system_fonts()"},{"path":"https://systemfonts.r-lib.org/reference/system_fonts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List all fonts installed on your system — system_fonts","text":"data frame row font various information column","code":""},{"path":"https://systemfonts.r-lib.org/reference/system_fonts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List all fonts installed on your system — system_fonts","text":"","code":"# See all monospace fonts fonts <- system_fonts() fonts[fonts$monospace, ] #> # A tibble: 18 × 9 #> path index name family style weight width italic monospace #> #> 1 /usr/share/font… 0 Nimb… Nimbu… Bold… bold norm… TRUE TRUE #> 2 /usr/share/font… 0 Libe… Liber… Bold bold norm… FALSE TRUE #> 3 /usr/share/font… 0 Nimb… Nimbu… Regu… normal norm… FALSE TRUE #> 4 /usr/share/font… 0 Libe… Liber… Ital… normal norm… TRUE TRUE #> 5 /usr/share/font… 0 Noto… Noto … Regu… normal norm… FALSE TRUE #> 6 /usr/share/font… 0 Deja… DejaV… Book normal norm… FALSE TRUE #> 7 /usr/share/font… 0 Deja… DejaV… Bold… bold norm… FALSE TRUE #> 8 /usr/share/font… 0 Noto… Noto … Regu… normal norm… FALSE TRUE #> 9 /usr/share/font… 0 Deja… DejaV… Bold bold norm… FALSE TRUE #> 10 /usr/share/font… 0 Nimb… Nimbu… Regu… normal norm… FALSE TRUE #> 11 /usr/share/font… 0 Libe… Liber… Bold… bold norm… TRUE TRUE #> 12 /usr/share/font… 0 Deja… DejaV… Obli… normal norm… FALSE TRUE #> 13 /usr/share/font… 0 Nimb… Nimbu… Bold… bold norm… TRUE TRUE #> 14 /usr/share/font… 0 Nimb… Nimbu… Bold bold norm… FALSE TRUE #> 15 /usr/share/font… 0 Nimb… Nimbu… Bold bold norm… FALSE TRUE #> 16 /usr/share/font… 0 Nimb… Nimbu… Ital… normal norm… TRUE TRUE #> 17 /usr/share/font… 0 Nimb… Nimbu… Ital… normal norm… TRUE TRUE #> 18 /usr/share/font… 0 Libe… Liber… Regu… normal norm… FALSE TRUE"},{"path":"https://systemfonts.r-lib.org/reference/systemfonts-package.html","id":null,"dir":"Reference","previous_headings":"","what":"systemfonts: System Native Font Finding — systemfonts-package","title":"systemfonts: System Native Font Finding — systemfonts-package","text":"Provides system native access font catalogue. font handling varies systems difficult correctly locate installed fonts across different operating systems. 'systemfonts' package provides bindings native libraries Windows, macOS Linux finding font files can used e.g. graphic devices. main use intended compiled code 'systemfonts' also provides access R.","code":""},{"path":[]},{"path":"https://systemfonts.r-lib.org/reference/systemfonts-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"systemfonts: System Native Font Finding — systemfonts-package","text":"Maintainer: Thomas Lin Pedersen thomas.pedersen@posit.co (ORCID) Authors: Jeroen Ooms jeroen@berkeley.edu (ORCID) Devon Govett (Author font-manager) contributors: Posit, PBC [copyright holder, funder]","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-development-version","dir":"Changelog","previous_headings":"","what":"systemfonts (development version)","title":"systemfonts (development version)","text":"match_fonts() added vectorized generalized version match_font(). process match_font() deprecated favour match_fonts() Two internal functions converting weight width names integers exported Fix segfault macOS system encounters corrupted font collection (#113)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-106","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.6","title":"systemfonts 1.0.6","text":"CRAN release: 2024-03-07 Fix bug shape_string() using vjust = 1 (#85)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-104","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.4","title":"systemfonts 1.0.4","text":"CRAN release: 2022-02-11 Use Courier New default mono font macOS instead Courier avoid issues FreeType Courier (#105)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-104-1","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.4","title":"systemfonts 1.0.4","text":"CRAN release: 2022-02-11 Provide fallback solution setup CRAN windows builder fonts can discovered (#87)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-103","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.3","title":"systemfonts 1.0.3","text":"CRAN release: 2021-10-13 Avoid warning including systemfonts header (#77) Fix size selection non-scalable fonts requested size bigger available Fix compilation bug systemfont used C packages (#76)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-102","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.2","title":"systemfonts 1.0.2","text":"CRAN release: 2021-05-11 Ensure compitability freetype <= 2.4.11 (#70, @jan-glx) Prepare UCRT compilation","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-101","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.1","title":"systemfonts 1.0.1","text":"CRAN release: 2021-02-09 Fix bug font matching Windows matching monospace fonts Fix bug reset_font_cache() mac cause system crash cache filled advance (#67)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-100","dir":"Changelog","previous_headings":"","what":"systemfonts 1.0.0","title":"systemfonts 1.0.0","text":"CRAN release: 2021-02-01 Tweak size determination non-scalable fonts Fix bug switching scalable non-scalable fonts cache Add utility querying font fallbacks R C level Add C-level API finding emoji embeddings strings Add utility getting weight font C code Add utility getting family name font C code Add font weight width output font_info()","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-032","dir":"Changelog","previous_headings":"","what":"systemfonts 0.3.2","title":"systemfonts 0.3.2","text":"CRAN release: 2020-09-29 Fix compiled code old R versions Changes comply next cpp11 version","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-031","dir":"Changelog","previous_headings":"","what":"systemfonts 0.3.1","title":"systemfonts 0.3.1","text":"CRAN release: 2020-09-08 Fixed warnings CRAN LTO machine","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-030","dir":"Changelog","previous_headings":"","what":"systemfonts 0.3.0","title":"systemfonts 0.3.0","text":"CRAN release: 2020-09-01 Added get_cached_face() packages might retrieve FT_Face objects cache. Adapted cpp11 Add infrastructure setting OpenType font features registered font either register_font() new register_variant(), along font_feature() function.","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-023","dir":"Changelog","previous_headings":"","what":"systemfonts 0.2.3","title":"systemfonts 0.2.3","text":"CRAN release: 2020-06-09 Replace buggy Freetype cache subsystem implementation Fix indexing bug glyph_metrics()","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-022","dir":"Changelog","previous_headings":"","what":"systemfonts 0.2.2","title":"systemfonts 0.2.2","text":"CRAN release: 2020-05-14 Fix remaining valgrind issues fixing included font-manager code Rewrite text shaping algorithm make future proof Work around nasty freetype bug cache subsystem","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-021","dir":"Changelog","previous_headings":"","what":"systemfonts 0.2.1","title":"systemfonts 0.2.1","text":"CRAN release: 2020-04-29 Various fixes correctness compiled code","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-020","dir":"Changelog","previous_headings":"","what":"systemfonts 0.2.0","title":"systemfonts 0.2.0","text":"CRAN release: 2020-04-16 Add string_widths_dev() string_metrics_dev() request current graphic device string widths metrics. Add system registering non-system fonts look-. systemfonts now detect user-installed fonts Windows (possible 1806 update) Font lookup now cached faster performance. caching get flushed new fonts added registry, manually reset_font_cache() Systemfonts now provide querying font information font_info() glyph_info() Basic string shaping now provided shape_string() Line width calculation now available string_width() (ignores presence newlines, use shape_string() complicated strings) Added str_split_emoji() splitting strings substrings emoji non-emoji glyphs Provide header file easy use within C packages Fix memory management issues Mac Fix handling erroneous font files windows","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-011","dir":"Changelog","previous_headings":"","what":"systemfonts 0.1.1","title":"systemfonts 0.1.1","text":"CRAN release: 2019-07-01 Fix compilation systems old fontconfig version (Solaris)","code":""},{"path":"https://systemfonts.r-lib.org/news/index.html","id":"systemfonts-010","dir":"Changelog","previous_headings":"","what":"systemfonts 0.1.0","title":"systemfonts 0.1.0","text":"CRAN release: 2019-06-28 First version match_font() system_fonts() capabilities. come. Added NEWS.md file track changes package.","code":""}] +[{"path":"https://systemfonts.r-lib.org/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (https://www.contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":"https://systemfonts.r-lib.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2019 Thomas Lin Pedersen Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-matching","dir":"Articles","previous_headings":"","what":"Font matching","title":"systemfonts C interface","text":"C equivalent match_font() R function locate_font() following signature: takes UTF-8 encoded string font family name, int setting italic bold styles along char pointer filled located path maximum length can hold. return value int giving index font font file. advent systemfonts 0.3.0 fonts can now also OpenType features attached use register_font() register_variant(). wish support features can use alternative : returned FontSettings struct contain font location index along OpenType feature settings. struct (along FontFeature struct dependency) shown pretty self-documenting. cache FontSettings struct features array may cleared time call ended. systemfonts takes care caching something concerned code.","code":"int locate_font( const char *family, int italic, int bold, char *path, int max_path_length ) FontSettings locate_font_with_features( const char *family, int italic, int bold ) struct FontFeature { char feature[4]; int setting; }; struct FontSettings { char file[PATH_MAX + 1]; unsigned int index; const FontFeature* features; int n_features; };"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"glyph-metrics","dir":"Articles","previous_headings":"","what":"Glyph metrics","title":"systemfonts C interface","text":"C equivalent glyph_info() glyph_metrics() following signature: takes glyph measure int giving UTF code glyph, along fontfile index identify font measure . takes size pt resolution ppi. write ascent, descent, width pts pointers passed , return 0 operation successful.","code":"int glyph_metrics( uint32_t code, const char* fontfile, int index, double size, double res, double* ascent, double* descent, double* width )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"string-width","dir":"Articles","previous_headings":"","what":"String width","title":"systemfonts C interface","text":"C equivalent string_width() R function also called string_width() following signature: function calculates width string, ignoring newlines (automatically handled graphic engine). takes UTF-8 encoded string, along fontfile index identifying font use calculation. also take size pt res ppi setting size. addition takes include_bearing flag control whether bearings first last character taken account (recommended graphic engine). write width pts passed pointer return 0 successful.","code":"string_width( const char* string, const char* fontfile, int index, double size, double res, int include_bearing, double* width )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"string-shape","dir":"Articles","previous_headings":"","what":"String shape","title":"systemfonts C interface","text":"parred version shape_string() accessible C level string_shape(). behaves less like string_width() , instead returns location write glyph relative (0, 0) origin. string_shape() behaves less like string_width() , instead returns location write glyph relative (0, 0) origin. takes UTF-8 encoded string, along fontfile index identifying font use calculation. also take size pt res ppi setting size. addition takes include_bearing flag control whether bearings first last character taken account (recommended graphic engine). write x y location glyph pts passed arrays, stopping provided max_length return 0 successful.","code":"string_shape( const char* string, const char* fontfile, int index, double size, double res, double* x, double* y, unsigned int max_length )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"retrieving-cached-freetype-face","dir":"Articles","previous_headings":"","what":"Retrieving cached freetype face","title":"systemfonts C interface","text":"heavy part text layouting reading parsing font files. systemfonts contains cache make sure parsing kept minimum. want use cache load cache freetype face object (FT_Face) can use get_cached_face(). resides separate header (systemfonts-ft.h) requires FreeType linked package, rest C api . look cache face size matches request return found. , load add cache, returning . get_cached_face() sets passed error pointer 0 successful. Freetype uses reference counting keep track objects count increased call get_cached_face(). responsiblity caller decrease face longer needed using FT_Done_Face().","code":"get_cached_face( const char* fontfile, int index, double size, double res, int * error )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-fallback","dir":"Articles","previous_headings":"","what":"Font fallback","title":"systemfonts C interface","text":"rendering text given requested characters glyph given font. one can elect render “missing glyph” glyph (often either empty square questionmark tilted square) better approach often find font substitute contain character use rendering . function allows find fallback font given string font. string stripped characters already know render. fallback font returned FontSettings object, though features always empty.","code":"FontSettings get_fallback( const char* string, const char* path, int index )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"font-weight","dir":"Articles","previous_headings":"","what":"Font Weight","title":"systemfonts C interface","text":"encoding text CSS may necessary know exact weight font given file may reflected style sheet. function takes path index returns weight (100-900 steps 100) 0 undefined font.","code":"int get_font_weight( const char* path, int index )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"family-name","dir":"Articles","previous_headings":"","what":"Family name","title":"systemfonts C interface","text":"may beneficial know family name given path index font. can obtained get_font_family() write name provided char* argument. return 0 somehow unsuccessful.","code":"int get_font_family( const char* path, int index, char* family, int max_length )"},{"path":"https://systemfonts.r-lib.org/articles/c_interface.html","id":"emoji-location","dir":"Articles","previous_headings":"","what":"Emoji location","title":"systemfonts C interface","text":"Figuring character string treated emoji non-trivial due existence emojis text representation default etc. systemfonts allow get embedding emojis string based correct rules.","code":"void detect_emoji_embedding( const uint32_t* string, int n, int* embedding, const char *path, int index )"},{"path":"https://systemfonts.r-lib.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Thomas Lin Pedersen. Author, maintainer. Jeroen Ooms. Author. Devon Govett. Author. Author font-manager . Copyright holder, funder.","code":""},{"path":"https://systemfonts.r-lib.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Pedersen T, Ooms J, Govett D (2024). systemfonts: System Native Font Finding. R package version 1.1.0, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts.","code":"@Manual{, title = {systemfonts: System Native Font Finding}, author = {Thomas Lin Pedersen and Jeroen Ooms and Devon Govett}, year = {2024}, note = {R package version 1.1.0, https://systemfonts.r-lib.org}, url = {https://github.com/r-lib/systemfonts}, }"},{"path":"https://systemfonts.r-lib.org/index.html","id":"systemfonts","dir":"","previous_headings":"","what":"System Native Font Finding","title":"System Native Font Finding","text":"systemfonts package locates installed fonts. uses system-native libraries Mac (CoreText) Linux (FontConfig), uses Freetype parse fonts registry Windows.","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"System Native Font Finding","text":"systemfonts available CRAN using install.packages('systemfonts'). however still development can install development version using devtools.","code":"# install.packages('devtools') devtools::install_github('r-lib/systemfonts')"},{"path":"https://systemfonts.r-lib.org/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"System Native Font Finding","text":"main use package locate font files based family style: function returns path file holding font, well 0-based index font file. also possible get data.frame available fonts: , can query additional information fonts specific glyphs, interest using font_info() glyph_info() functions.","code":"library(systemfonts) match_fonts('Avenir', italic = TRUE) #> path index features #> 1 /System/Library/Fonts/Avenir.ttc 1 system_fonts() #> # A tibble: 843 × 9 #> path index name family style weight width italic monospace #> #> 1 /System/Library/Fonts… 2 Rock… Rockw… Bold bold norm… FALSE FALSE #> 2 /Users/thomas/Library… 0 Open… Open … Ligh… normal norm… TRUE FALSE #> 3 /Users/thomas/Library… 0 Open… Open … Semi… semib… semi… TRUE FALSE #> 4 /System/Library/Fonts… 0 Note… Notew… Light normal norm… FALSE FALSE #> 5 /System/Library/Fonts… 1 Deva… Devan… Bold bold norm… FALSE FALSE #> 6 /System/Library/Fonts… 0 Kann… Kanna… Regu… normal norm… FALSE FALSE #> 7 /System/Library/Fonts… 0 Verd… Verda… Bold bold norm… FALSE FALSE #> 8 /System/Library/Fonts… 8 Aria… Arial… Light light norm… FALSE FALSE #> 9 /Users/thomas/Library… 0 Open… Open … Medi… medium norm… TRUE FALSE #> 10 /System/Library/Fonts… 10 Appl… Apple… Thin thin norm… FALSE FALSE #> # ℹ 833 more rows"},{"path":"https://systemfonts.r-lib.org/index.html","id":"c-api","dir":"","previous_headings":"","what":"C API","title":"System Native Font Finding","text":"getting information R nice, intended use mostly compiled code graphic devices can easily locate relevant font files etc. order use functions systemfonts C(++) code package list systemfonts LinkingTo field DESCRIPTION file. done can now #include code use provided functions. Look inst/include/systemfonts.h file familiarise C API.","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"system-defaults","dir":"","previous_headings":"","what":"System Defaults","title":"System Native Font Finding","text":"systemfonts always try find font , even none exist given family name style. resolves system specific relied , can expected valid font file always returned matter input. special aliases exist behaves predictably system dependent: \"\" \"sans\" return Helvetica Mac, Arial Windows, default sans-serif font Linux (DejaVu Sans Ubuntu) \"serif\" return Times Mac, Times New Roman Windows, default serif font Linux (DejaVu Serif Ubuntu) \"mono\" return Courier Mac, Courier New Windows, default mono font Linux (DejaVu Mono Ubuntu) \"emoji\" return Apple Color Emoji Mac, Segoe UI Emoji Windows, default emoji font Linux (Noto Color Ubuntu)","code":""},{"path":"https://systemfonts.r-lib.org/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"System Native Font Finding","text":"Please note ‘systemfonts’ project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert weight and width to numerics — as_font_weight","title":"Convert weight and width to numerics — as_font_weight","text":"often natural describe font weight width names rather numbers (e.g. \"bold\" \"condensed\"), underneath names matched numeric values. two functions used retrieve numeric counterparts names","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert weight and width to numerics — as_font_weight","text":"","code":"as_font_weight(weight) as_font_width(width)"},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert weight and width to numerics — as_font_weight","text":"weight, width character vectors valid names weight width","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert weight and width to numerics — as_font_weight","text":"integer vector matching length input","code":""},{"path":"https://systemfonts.r-lib.org/reference/as_font_weight.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert weight and width to numerics — as_font_weight","text":"","code":"as_font_weight( c(\"undefined\", \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\") ) #> [1] 0 100 200 300 400 500 600 700 800 900 as_font_width( c(\"undefined\", \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\") ) #> [1] 0 1 2 3 4 5 6 7 8 9"},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the fallback font for a given string — font_fallback","title":"Get the fallback font for a given string — font_fallback","text":"fallback font font use substitute chosen font contain requested characters. Using font fallbacks means user worry mixing characters different scripts mixing text emojies. Fallback calculated full string result platform specific. font covers characters string undefined \"best match\" returned. best approach figure characters covered chosen font figure fallbacks , rather just request fallback full string.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the fallback font for a given string — font_fallback","text":"","code":"font_fallback( string, family = \"\", italic = FALSE, bold = FALSE, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the fallback font for a given string — font_fallback","text":"string strings find fallbacks family name font families match italic logical indicating font slant bold logical indicating whether font weight path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the fallback font for a given string — font_fallback","text":"data frame path index column giving fallback specified string font combinations","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_fallback.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the fallback font for a given string — font_fallback","text":"","code":"font_fallback(\"\\U0001f604\") # Smile emoji #> path index #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf 0"},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":null,"dir":"Reference","previous_headings":"","what":"Define OpenType font feature settings — font_feature","title":"Define OpenType font feature settings — font_feature","text":"function encapsulates specification OpenType font features. specific features named arguments, available features can set using specific 4-letter tag list 4-letter tags available see e.g. overview Wikipedia.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define OpenType font feature settings — font_feature","text":"","code":"font_feature(ligatures = NULL, letters = NULL, numbers = NULL, ...)"},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define OpenType font feature settings — font_feature","text":"ligatures Settings related ligatures. One types ligatures turn (see details). letters Settings related appearance single letters (opposed ligatures substitutes multiple letters). See details supported values. numbers Settings related appearance numbers. See details supported values. ... key-value pairs key 4-letter tag value setting (usually TRUE turn ).","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define OpenType font feature settings — font_feature","text":"font_feature object","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define OpenType font feature settings — font_feature","text":"OpenType features defined 4-letter tag along integer value. Often value simple 0 () 1 (), features support additional values, e.g. stylistic alternates (salt) font may provide multiple variants letter value used chose one use. Common features related appearance may given long form name either ligatures, letters, numbers argument avoid remembering often arbitrary 4-letter tag. Providing long form name setting tag 1 can thus used set tags values. possible long form names given tag parenthesis: Ligatures standard (liga): Turns standard multiple letter substitution historical (hlig): Use obsolete historical ligatures contextual (clig): Apply secondary ligatures based character patterns surrounding potential ligature discretionary (dlig): Use ornamental ligatures Letters swash (cswh): Use contextual swashes (ornamental decorations) alternates (calt): Use alternate letter forms based sourrounding pattern historical (hist): Use obsolete historical forms letters localized (locl): Use alternate forms preferred script language randomize (rand): Use random variants letters (e.g. mimick handwriting) alt_annotation (nalt): Use alternate annotations (e.g. circled digits) stylistic (salt): Use stylistic alternative form letter subscript (subs): Set letter subscript superscript (sups): Set letter superscript titling (titl): Use letter forms well suited large text titles small_caps (smcp): Use small caps variants letters Numbers lining (lnum): Use number variants rest baseline oldstyle (onum): Use old style numbers use descender ascender various numbers proportional (pnum): Let numbers take width based visual width glyph tabular (tnum): Enforce numbers take width fractions (frac): Convert numbers separated / fraction glyph fractions_alt (afrc): Use alternate fraction form horizontal divider","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_feature.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define OpenType font feature settings — font_feature","text":"","code":"font_feature(letters = \"stylistic\", numbers = c(\"lining\", \"tabular\")) #> A list of OpenType font feature settings #> - salt: 1 #> - lnum: 1 #> - tnum: 1 # Use the tag directly to access additional stylistic variants font_feature(numbers = c(\"lining\", \"tabular\"), salt = 2) #> A list of OpenType font feature settings #> - salt: 2 #> - lnum: 1 #> - tnum: 1"},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query font-specific information — font_info","title":"Query font-specific information — font_info","text":"Get general information font, relative given size. Size specific measures returned pixel units. function vectorised length longest argument.","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query font-specific information — font_info","text":"","code":"font_info( family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query font-specific information — font_info","text":"family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query font-specific information — font_info","text":"data.frame giving info requested font + size combinations. data.frame contain following columns: path path font file index 0-based index font fontfile family family name font style style name font italic logical giving font italic bold logical giving font bold monospace logical giving font monospace weight factor giving weight font width factor giving width font kerning logical giving font supports kerning color logical giving font color glyphs scalable logical giving font scalable vertical logical giving font vertical n_glyphs number glyphs font n_sizes number predefined sizes font n_charmaps number character mappings font file bbox bounding box large enough contain glyphs font max_ascend maximum ascend tallest glyph font max_descent maximum descend descending glyph font max_advance_width maximum horizontal advance glyph can make max_advance_height maximum vertical advance glyph can make lineheight height single line text font underline_pos position potential underlining segment underline_size width underline","code":""},{"path":"https://systemfonts.r-lib.org/reference/font_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query font-specific information — font_info","text":"","code":"font_info('serif') #> # A tibble: 1 × 24 #> path index family style italic bold monospace weight width kerning #> #> 1 /usr/sha… 0 DejaV… Book FALSE FALSE FALSE normal norm… TRUE #> # ℹ 14 more variables: color , scalable , vertical , #> # n_glyphs , n_sizes , n_charmaps , bbox , #> # max_ascend , max_descend , max_advance_width , #> # max_advance_height , lineheight , underline_pos , #> # underline_size # Avoid lookup if font file is already known sans <- match_fonts('sans') font_info(path = sans$path, index = sans$index) #> # A tibble: 1 × 24 #> path index family style italic bold monospace weight width kerning #> #> 1 /usr/sha… 0 DejaV… Book FALSE FALSE FALSE normal norm… TRUE #> # ℹ 14 more variables: color , scalable , vertical , #> # n_glyphs , n_sizes , n_charmaps , bbox , #> # max_ascend , max_descend , max_advance_width , #> # max_advance_height , lineheight , underline_pos , #> # underline_size "},{"path":"https://systemfonts.r-lib.org/reference/get_fallback.html","id":null,"dir":"Reference","previous_headings":"","what":"Get location of the fallback font — get_fallback","title":"Get location of the fallback font — get_fallback","text":"Get location fallback font","code":""},{"path":"https://systemfonts.r-lib.org/reference/get_fallback.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get location of the fallback font — get_fallback","text":"","code":"get_fallback()"},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query glyph-specific information from fonts — glyph_info","title":"Query glyph-specific information from fonts — glyph_info","text":"function allows extract information individual glyphs font, based specified size. size related measures pixel-units. function vectorised length glyphs vector.","code":""},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query glyph-specific information from fonts — glyph_info","text":"","code":"glyph_info( glyphs, family = \"\", italic = FALSE, bold = FALSE, size = 12, res = 72, path = NULL, index = 0 )"},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query glyph-specific information from fonts — glyph_info","text":"glyphs vector glyphs. Strings split separate glyphs automatically family name font families match italic logical indicating font slant bold logical indicating whether font weight size pointsize font use size related measures res ppi size related mesures path, index path index font file circumvent lookup based family style","code":""},{"path":"https://systemfonts.r-lib.org/reference/glyph_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query glyph-specific information from fonts — glyph_info","text":"data.frame information glyph, containing following columns: glyph glyph character index index glyph font file width width glyph height height glyph x_bearing horizontal distance origin leftmost part glyph y_bearing vertical distance origin top part glyph x_advance horizontal distance move cursor adding glyph y_advance vertical distance move cursor adding glyph bbox tight bounding box surrounding glyph","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":null,"dir":"Reference","previous_headings":"","what":"Find a system font by name and style — match_fonts","title":"Find a system font by name and style — match_fonts","text":"function locates font file (index) best matching name optional style. font file returned even perfect match found, necessarily similar requested family relied font substitution. aliases \"sans\", \"serif\", \"mono\", \"symbol\", \"emoji\" match respective system defaults (\"\" equivalent \"sans\"). match_font() deprecated favour match_fonts() provides vectorisation, well querying different weights (rather just \"normal\" \"bold\") well different widths.","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find a system font by name and style — match_fonts","text":"","code":"match_fonts(family, italic = FALSE, weight = \"normal\", width = \"undefined\") match_font(family, italic = FALSE, bold = FALSE)"},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find a system font by name and style — match_fonts","text":"family name font families match italic logical indicating font slant weight weight query , either numbers (0, 100, 200, 300, 400, 500, 600, 700, 800, 900) strings (\"undefined\", \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\"). NA interpreted \"undefined\"/0 width width query either numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) strings (\"undefined\", \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\"). NA interpreted \"undefined\"/0 bold logical indicating whether font weight","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find a system font by name and style — match_fonts","text":"list containing paths locating font files, 0-based index font files features font case registered font located.","code":""},{"path":"https://systemfonts.r-lib.org/reference/match_fonts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find a system font by name and style — match_fonts","text":"","code":"# Get the system default sans-serif font in italic match_fonts('sans', italic = TRUE) #> # A tibble: 1 × 3 #> path index features #> #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf 0 # Try to match it to a thin variant match_fonts(c('sans', 'serif'), weight = \"thin\") #> # A tibble: 2 × 3 #> path index features #> #> 1 /usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight… 0 #> 2 /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf 0 "},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":null,"dir":"Reference","previous_headings":"","what":"Register font collections as families — register_font","title":"Register font collections as families — register_font","text":"design, systemfonts searches fonts installed natively system. possible, however, register fonts e.g. font packages local font files, get searched searching installed fonts. can always get overview registered fonts registry_fonts() function works registry focused analogue system_fonts(). wish clear registry, can either restart R session call clear_registry().","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register font collections as families — register_font","text":"","code":"register_font( name, plain, bold = plain, italic = plain, bolditalic = plain, features = font_feature() ) registry_fonts() clear_registry()"},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register font collections as families — register_font","text":"name name collection known (.e. family) plain, bold, italic, bolditalic Fontfiles different faces collection. can either filepath list containing filepath index (font files containing multiple fonts). given default plain specification. features font_feature object describing specific OpenType font features turn registered font.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Register font collections as families — register_font","text":"register_font() clear_registry() returns NULL invisibly. registry_fonts() returns data table style system_fonts() though less detailed based information font file.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Register font collections as families — register_font","text":"register_font also makes possible use system fonts traits covered graphic engine R. plotting operations possible specify family name whether font bold /italic. numerous fonts never get matched , especially bold one many weights. Apart granting way use new varieties fonts, font registration also allows override default sans, serif, mono mappings, simply registering collection relevant default name. registered fonts searched first take precedence default.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_font.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Register font collections as families — register_font","text":"","code":"# Create a random font collection fonts <- system_fonts() plain <- sample(which(!fonts$italic & fonts$weight <= 'normal'), 1) bold <- sample(which(!fonts$italic & fonts$weight > 'normal'), 1) italic <- sample(which(fonts$italic & fonts$weight <= 'normal'), 1) bolditalic <- sample(which(fonts$italic & fonts$weight > 'normal'), 1) register_font( 'random', plain = list(fonts$path[plain], fonts$index[plain]), bold = list(fonts$path[bold], fonts$index[bold]), italic = list(fonts$path[italic], fonts$index[italic]), bolditalic = list(fonts$path[bolditalic], fonts$index[bolditalic]) ) # Look at your creation registry_fonts() #> # A tibble: 4 × 7 #> path index family style weight italic features #> #> 1 /usr/share/fonts/opentype/urw… 0 random Regu… normal FALSE #> 2 /usr/share/fonts/truetype/dej… 0 random Bold bold FALSE #> 3 /usr/share/fonts/type1/urw-ba… 0 random Ital… normal TRUE #> 4 /usr/share/fonts/opentype/urw… 0 random Bold… bold TRUE # Reset clear_registry()"},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":null,"dir":"Reference","previous_headings":"","what":"Register a font as a variant as an existing one — register_variant","title":"Register a font as a variant as an existing one — register_variant","text":"function wrapper around register_font() allows easily create variants existing system fonts, e.g. target different weights /widths, attaching OpenType features font.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register a font as a variant as an existing one — register_variant","text":"","code":"register_variant( name, family, weight = NULL, width = NULL, features = font_feature() )"},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register a font as a variant as an existing one — register_variant","text":"name new family name variant respond family name existing font family variant weight One two \"thin\", \"ultralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"ultrabold\", \"heavy\". one given sets weight whole variant. two given first one defines plain weight second bold weight. NULL variants given family closest \"normal\" \"bold\" chosen. width One \"ultracondensed\", \"extracondensed\", \"condensed\", \"semicondensed\", \"normal\", \"semiexpanded\", \"expanded\", \"extraexpanded\", \"ultraexpanded\" giving width variant. NULL width closest \"normal\" chosen. features font_feature object describing specific OpenType font features turn registered font variant.","code":""},{"path":"https://systemfonts.r-lib.org/reference/register_variant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Register a font as a variant as an existing one — register_variant","text":"","code":"# Get the default \"sans\" family sans <- match_fonts(\"sans\")$path sans <- system_fonts()$family[system_fonts()$path == sans][1] # Register a variant of it: register_variant( \"sans_ligature\", sans, features = font_feature(ligatures = \"discretionary\") ) registry_fonts() #> # A tibble: 4 × 7 #> path index family style weight italic features #> #> 1 /usr/share/fonts/truetype/dej… 0 sans_… Regu… normal FALSE
Pedersen T, Ooms J, Govett D (2024). systemfonts: System Native Font Finding. -R package version 1.0.6.9000, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts. +R package version 1.1.0, https://systemfonts.r-lib.org, https://github.com/r-lib/systemfonts.
@Manual{, title = {systemfonts: System Native Font Finding}, author = {Thomas Lin Pedersen and Jeroen Ooms and Devon Govett}, year = {2024}, - note = {R package version 1.0.6.9000, https://systemfonts.r-lib.org}, + note = {R package version 1.1.0, https://systemfonts.r-lib.org}, url = {https://github.com/r-lib/systemfonts}, }
match_fonts()
match_font()