I think that the showtext package may be the way to go. I've modified the example to use showtext with a very different-looking font, so that it's obvious that it's working.
library(grid)
library(Gmisc)
library(glue)
library(showtext)
font_add_google("Rock Salt", "rock")
showtext_auto()
grid.newpage()
TxtGp <- getOption("boxGrobTxt", default = gpar(fontfamily = "rock", fontsize = 16))
Tp <- boxGrob(glue("State 1: Tp",
" ",
"Entered: 72 (IA: 48, IAK: 24)",
"Censored: 8 (IA: 7, IAK: 1)",
"Failed: 11 (IA: 4, IAK: 7)",
"To II: 53 (IA: 37, IAK: 16)",
.sep = "\n"),
txt_gp = TxtGp,
width = .4, height = .4, y = 0.8, x = 0.2)
II <- boxGrob(glue("State 2: II",
" ",
"Entered: 53 (IA: 37, IAK: 16)",
"Censored: 30 (IA: 20, IAK: 10)",
"Failed: 0 (IA: 0, IAK: 0)",
"To LostII: 23 (IA: 17, IAK: 6)",
.sep = "\n"),
txt_gp = TxtGp, width = .4, height = .4,
y = 0.8, x = 0.8)
LostII <- boxGrob(glue("State 3: LostII",
" ",
"Entered: 23 (IA: 17, IAK: 6)",
"Censored: 18 (IA: 14, IAK: 4)",
"Failed: 5 (IA: 3, IAK: 2)",
"To Failed: 5 (IA: 3, IAK: 2)",
.sep = "\n"),
txt_gp = TxtGp, width = .4, height = .4,
y = 0.2, x = 0.8)
Failed <- boxGrob(glue("State 4: Failed",
" ",
"Entered: 16 (IA: 7, IAK: 9)",
"Failed: 16 (IA: 7, IAK: 9)",
.sep = "\n"),
txt_gp = TxtGp, width = .4, height = .4,
y = 0.2, x = 0.2)
Tp; II; LostII; Failed
connectGrob(Tp, II, type = 'horizontal')
connectGrob(II, LostII, type = 'vertical')
connectGrob(LostII, Failed, type = 'horizontal')
connectGrob(Tp, Failed, type = 'vertical')
It uses Google fonts, so you may have to search for fonts that are similar to the ones on your computer.
About extrafont: the extrafont package is really only getting minimal maintenance these days. Showtext may be a better solution in this case.