From 49516b31368d0b18524490e41d65c611d47de7ce Mon Sep 17 00:00:00 2001 From: Elin Waring Date: Thu, 22 Aug 2024 02:17:43 -0400 Subject: [PATCH] Update glyph.R Check that file exists. --- src/library/grDevices/R/glyph.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/library/grDevices/R/glyph.R b/src/library/grDevices/R/glyph.R index 4be8dabbba8..26e7aecb321 100644 --- a/src/library/grDevices/R/glyph.R +++ b/src/library/grDevices/R/glyph.R @@ -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")