This function produces a plot showing a preview of a Star Trek font from the trekfont package. It will return a message if any of trekfont, showtext or ggplot2 are not installed. If family is missing, it will return a vector of all available font families.

st_font(family, size = 11)

Arguments

family

character, font family.

size,

numeric, font size passed to ggplot.

Value

a character vector, or a plot side effect. See details.

Details

In RStudio on Windows the font may not show in the RStudio graphics device. Try using the regular R GUI.

Examples

if(all(c("trekfont", "showtext", "ggplot2") %in% installed.packages())){
  st_font()
}
#>   [1] "AmarilloUSAF"                 "Ba'ku"                       
#>   [3] "BernyKlingon"                 "Borg"                        
#>   [5] "CorporateURW"                 "Crillee"                     
#>   [7] "CrilleeItalicBT"              "DeltaFlyer"                  
#>   [9] "Enterprise"                   "Fabrini"                     
#>  [11] "Federation"                   "FederationBold"              
#>  [13] "FederationClassic"            "FederationClassicMovie"      
#>  [15] "FederationCrille"             "FederationDS9Title"          
#>  [17] "FederationHull"               "FederationStarfleet"         
#>  [19] "FederationStarfleetSquare"    "FederationTNGTitle"          
#>  [21] "FederationWide"               "FinalFrontier"               
#>  [23] "FutureRegular"                "GallaudetRegular"            
#>  [25] "GornathonRegular"             "Iconian"                     
#>  [27] "Khan"                         "Klingon"                     
#>  [29] "KlingonBlade"                 "KlingonDagger"               
#>  [31] "KlingonScript"                "KlingonStilleto"             
#>  [33] "KlingonTNG"                   "Klinzhai"                    
#>  [35] "Klinzhaihollow"               "Malcorian"                   
#>  [37] "ModernVulcan"                 "Modernvulcan1.1"             
#>  [39] "Montalban"                    "MontalbanBold"               
#>  [41] "MontalbanBoldItalic"          "MontalbanCondensed"          
#>  [43] "MontalbanCondensedBold"       "MontalbanCondensedBoldItalic"
#>  [45] "MontalbanCondensedItalic"     "MontalbanItalic"             
#>  [47] "OldVulcan"                    "Preservers"                  
#>  [49] "Romulan"                      "RomulanEagle"                
#>  [51] "RomulanFake"                  "RomulanFalcon"               
#>  [53] "RomulanHawk"                  "RomulusPlain"                
#>  [55] "SliderRegular"                "Son'a"                       
#>  [57] "Square721CondensedBT"         "StarCine"                    
#>  [59] "StarDown"                     "StarDownV1.1"                
#>  [61] "StarfleetBoldExtendedBT"      "StarNext"                    
#>  [63] "StarSeries"                   "StarTitle"                   
#>  [65] "StarTrekBT"                   "StarTrekFilmBT"              
#>  [67] "StarTrekGenHeavyBT"           "StarTrekNextExtraBoldBT"     
#>  [69] "StarTrekNextPiBT"             "StarTrekPiBT"                
#>  [71] "STBajoranAncient"             "STBajoranIdeogram"           
#>  [73] "STbinar"                      "STCardassian"                
#>  [75] "STDominion"                   "STElAurian"                  
#>  [77] "STFerengi1L"                  "STFerengi1R"                 
#>  [79] "STFerengiGothicR"             "STFerengiL"                  
#>  [81] "STFerengiR"                   "STGothicFerengi"             
#>  [83] "STKlinzhai"                   "Stop"                        
#>  [85] "Swiss911ExtraCompressedBT"    "Swiss911UltraCompressedBT"   
#>  [87] "TholianRegular"               "TNGcast"                     
#>  [89] "TNGMonitorsPlain"             "Transitional521BT"           
#>  [91] "Trekbats"                     "TrekbatsRegular"             
#>  [93] "TrekClassicShipHull"          "TrekDS9CreditsText"          
#>  [95] "TrekDS9Hollow"                "TrekGeneration1"             
#>  [97] "TrekGeneration2"              "TrekkerRegular"              
#>  [99] "TrekkerTwoRegular"            "TrekMovie2"                  
#> [101] "TrekTNGMonitors"              "TRHeavy"                     
#> [103] "Trill"                        "Venetian301BT"               
#> [105] "Vidiian"                      "VothSTVoyager"               
#> [107] "ZiganTradOkudeska"           
if (FALSE) st_font("Federation") # \dontrun{} # should be run in an interactive session