Instead of using the pdfmark 0, 1, 2, 3 for bookmarks "style" we could instead use the R base graphics standard throwing an error for unsupported "oblique" and HersheySerif values. According to ?grid::gpar() description of fontface:
The specification of ‘fontface’ can be an integer or a string. If
an integer, then it follows the R base graphics standard: 1 =
plain, 2 = bold, 3 = italic, 4 = bold italic. If a string, then
valid values are: ‘"plain"’, ‘"bold"’, ‘"italic"’, ‘"oblique"’,
and ‘"bold.italic"’. For the special case of the HersheySerif
font family, ‘"cyrillic"’, ‘"cyrillic.oblique"’, and ‘"EUC"’ are
also available.
Instead of using the pdfmark 0, 1, 2, 3 for bookmarks "style" we could instead use the R base graphics standard throwing an error for unsupported "oblique" and HersheySerif values. According to
?grid::gpar()
description offontface
: