Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/font.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @export
font_import <- function(paths = NULL, recursive = TRUE, prompt = TRUE,
pattern = NULL) {
pattern = NULL, perl = FALSE) {

if (prompt) {
resp <- readline("Importing fonts may take a few minutes, depending on the number of fonts and the speed of the system.\nContinue? [y/n] ")
Expand All @@ -22,7 +22,7 @@ font_import <- function(paths = NULL, recursive = TRUE, prompt = TRUE,
}
}

ttf_import(paths, recursive, pattern)
ttf_import(paths, recursive, pattern, perl)
}


Expand Down
6 changes: 3 additions & 3 deletions R/truetype.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @importFrom Rttf2pt1 which_ttf2pt1
#' @export
ttf_import <- function(paths = NULL, recursive = TRUE, pattern = NULL) {
ttf_import <- function(paths = NULL, recursive = TRUE, pattern = NULL, perl = FALSE) {

if (is.null(paths)) paths <- ttf_find_default_path()

Expand All @@ -21,7 +21,7 @@ ttf_import <- function(paths = NULL, recursive = TRUE, pattern = NULL) {
ignore.case = TRUE))

if (!is.null(pattern)) {
matchfiles <- grepl(pattern, basename(ttfiles))
matchfiles <- grepl(pattern, basename(ttfiles), perl = perl)
ttfiles <- ttfiles[matchfiles]
}

Expand Down Expand Up @@ -56,7 +56,7 @@ ttf_extract <- function(ttfiles) {
message("Extracting .afm files from .ttf files...")

# This stores information about the fonts
fontdata <- data.frame(fontfile = ttfiles, FontName = "",
fontdata <- data.frame(fontfile = ttfiles, FontName = "",
stringsAsFactors = FALSE)

outfiles <- file.path(metrics_path(),
Expand Down