Skip to content

Commit

Permalink
Update glyph.R
Browse files Browse the repository at this point in the history
Check that file exists.
  • Loading branch information
elinw authored Aug 22, 2024
1 parent bed10be commit 49516b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/library/grDevices/R/glyph.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ glyphFont <- function(file, index,
family, weight, style,
PSname=NA) {
file <- as.character(file)
if ( !file.exists(file)) {
stop("Font file does not exist")
}
nafile <- is.na(file)
if (any(nchar(file[!nafile], "bytes") > 500))
warning("Font file longer than 500 will be truncated")
Expand Down

0 comments on commit 49516b3

Please sign in to comment.