Skip to contents

This function checks if a font is installed in your machine. To list all available fonts, set font = NULL.

Usage

font_exists(font = "Arial Narrow", font_dirs = NULL, quiet = FALSE, ...)

Arguments

font

Character. Which font to check. No need to add .TFF.

font_dirs

Character vector. Additional directories to check for fonts.

quiet

Boolean. Keep quiet? If not, show message

...

Additional parameters.

Value

Boolean result of the existing fonts check.

Examples

font_exists(font = "Arial")
#> [1] FALSE
font_exists(font = "arial")
#> [1] FALSE
font_exists(font = "")
#> Maybe you meant one of these:
#> 'C059-BdIta', 'C059-Bold', 'C059-Italic', 'C059-Roman', 'D050000L', 'DejaVuMathTeXGyre', 'DejaVuSans', 'DejaVuSans-Bold', 'DejaVuSans-BoldOblique', 'DejaVuSans-ExtraLight', 'DejaVuSans-Oblique', 'DejaVuSansCondensed', 'DejaVuSansCondensed-Bold', 'DejaVuSansCondensed-BoldOblique', 'DejaVuSansCondensed-Oblique', 'DejaVuSansMono', 'DejaVuSansMono-Bold', 'DejaVuSansMono-BoldOblique', 'DejaVuSansMono-Oblique', 'DejaVuSerif', 'DejaVuSerif-Bold', 'DejaVuSerif-BoldItalic', 'DejaVuSerif-Italic', 'DejaVuSerifCondensed', 'DejaVuSerifCondensed-Bold', 'DejaVuSerifCondensed-BoldItalic', 'DejaVuSerifCondensed-Italic', 'DroidSansFallbackFull', 'Lato-Black', 'Lato-BlackItalic', 'Lato-Bold', 'Lato-BoldItalic', 'Lato-Hairline', 'Lato-HairlineItalic', 'Lato-Heavy', 'Lato-HeavyItalic', 'Lato-Italic', 'Lato-Light', 'Lato-LightItalic', 'Lato-Medium', 'Lato-MediumItalic', 'Lato-Regular', 'Lato-Semibold', 'Lato-SemiboldItalic', 'Lato-Thin', 'Lato-ThinItalic', 'LiberationMono-Bold', 'LiberationMono-BoldItalic', 'LiberationMono-Italic', 'LiberationMono-Regular', 'LiberationSans-Bold', 'LiberationSans-BoldItalic', 'LiberationSans-Italic', 'LiberationSans-Regular', 'LiberationSansNarrow-Bold', 'LiberationSansNarrow-BoldItalic', 'LiberationSansNarrow-Italic', 'LiberationSansNarrow-Regular', 'LiberationSerif-Bold', 'LiberationSerif-BoldItalic', 'LiberationSerif-Italic', 'LiberationSerif-Regular', 'NimbusMonoPS-Bold', 'NimbusMonoPS-BoldItalic', 'NimbusMonoPS-Italic', 'NimbusMonoPS-Regular', 'NimbusRoman-Bold', 'NimbusRoman-BoldItalic', 'NimbusRoman-Italic', 'NimbusRoman-Regular', 'NimbusSans-Bold', 'NimbusSans-BoldItalic', 'NimbusSans-Italic', 'NimbusSans-Regular', 'NimbusSansNarrow-Bold', 'NimbusSansNarrow-BoldOblique', 'NimbusSansNarrow-Oblique', 'NimbusSansNarrow-Regular', 'NotoColorEmoji', 'NotoMono-Regular', 'NotoSansMono-Bold', 'NotoSansMono-Regular', 'P052-Bold', 'P052-BoldItalic', 'P052-Italic', 'P052-Roman', 'StandardSymbolsPS', 'URWBookman-Demi', 'URWBookman-DemiItalic', 'URWBookman-Light', 'URWBookman-LightItalic', 'URWGothic-Book', 'URWGothic-BookOblique', 'URWGothic-Demi', 'URWGothic-DemiOblique', 'Z003-MediumItalic'
#> [1] FALSE
font_exists(font = NULL)
#>  [1] "C059-BdIta"                      "C059-Bold"                      
#>  [3] "C059-Italic"                     "C059-Roman"                     
#>  [5] "D050000L"                        "NimbusMonoPS-Bold"              
#>  [7] "NimbusMonoPS-BoldItalic"         "NimbusMonoPS-Italic"            
#>  [9] "NimbusMonoPS-Regular"            "NimbusRoman-Bold"               
#> [11] "NimbusRoman-BoldItalic"          "NimbusRoman-Italic"             
#> [13] "NimbusRoman-Regular"             "NimbusSans-Bold"                
#> [15] "NimbusSans-BoldItalic"           "NimbusSans-Italic"              
#> [17] "NimbusSans-Regular"              "NimbusSansNarrow-Bold"          
#> [19] "NimbusSansNarrow-BoldOblique"    "NimbusSansNarrow-Oblique"       
#> [21] "NimbusSansNarrow-Regular"        "P052-Bold"                      
#> [23] "P052-BoldItalic"                 "P052-Italic"                    
#> [25] "P052-Roman"                      "StandardSymbolsPS"              
#> [27] "URWBookman-Demi"                 "URWBookman-DemiItalic"          
#> [29] "URWBookman-Light"                "URWBookman-LightItalic"         
#> [31] "URWGothic-Book"                  "URWGothic-BookOblique"          
#> [33] "URWGothic-Demi"                  "URWGothic-DemiOblique"          
#> [35] "Z003-MediumItalic"               "DejaVuMathTeXGyre"              
#> [37] "DejaVuSans-Bold"                 "DejaVuSans-BoldOblique"         
#> [39] "DejaVuSans-ExtraLight"           "DejaVuSans-Oblique"             
#> [41] "DejaVuSans"                      "DejaVuSansCondensed-Bold"       
#> [43] "DejaVuSansCondensed-BoldOblique" "DejaVuSansCondensed-Oblique"    
#> [45] "DejaVuSansCondensed"             "DejaVuSansMono-Bold"            
#> [47] "DejaVuSansMono-BoldOblique"      "DejaVuSansMono-Oblique"         
#> [49] "DejaVuSansMono"                  "DejaVuSerif-Bold"               
#> [51] "DejaVuSerif-BoldItalic"          "DejaVuSerif-Italic"             
#> [53] "DejaVuSerif"                     "DejaVuSerifCondensed-Bold"      
#> [55] "DejaVuSerifCondensed-BoldItalic" "DejaVuSerifCondensed-Italic"    
#> [57] "DejaVuSerifCondensed"            "DroidSansFallbackFull"          
#> [59] "Lato-Black"                      "Lato-BlackItalic"               
#> [61] "Lato-Bold"                       "Lato-BoldItalic"                
#> [63] "Lato-Hairline"                   "Lato-HairlineItalic"            
#> [65] "Lato-Heavy"                      "Lato-HeavyItalic"               
#> [67] "Lato-Italic"                     "Lato-Light"                     
#> [69] "Lato-LightItalic"                "Lato-Medium"                    
#> [71] "Lato-MediumItalic"               "Lato-Regular"                   
#> [73] "Lato-Semibold"                   "Lato-SemiboldItalic"            
#> [75] "Lato-Thin"                       "Lato-ThinItalic"                
#> [77] "LiberationMono-Bold"             "LiberationMono-BoldItalic"      
#> [79] "LiberationMono-Italic"           "LiberationMono-Regular"         
#> [81] "LiberationSans-Bold"             "LiberationSans-BoldItalic"      
#> [83] "LiberationSans-Italic"           "LiberationSans-Regular"         
#> [85] "LiberationSansNarrow-Bold"       "LiberationSansNarrow-BoldItalic"
#> [87] "LiberationSansNarrow-Italic"     "LiberationSansNarrow-Regular"   
#> [89] "LiberationSerif-Bold"            "LiberationSerif-BoldItalic"     
#> [91] "LiberationSerif-Italic"          "LiberationSerif-Regular"        
#> [93] "NotoColorEmoji"                  "NotoMono-Regular"               
#> [95] "NotoSansMono-Bold"               "NotoSansMono-Regular"