The font device state is an environment with
four variables guaranteed to be set:
open
(logical(1)
)
whether a device is already open with font info
fontspec
(font_spec
)
the font specification, if any, that is currently active (list()
if none is).
spacewidth
(numeric(1)
)
the width of the space character in the currently active font.
ismonospace
(logical(1)
)
whether the specified font is monospaced.
open_font_dev
opens a pdf device with the specified font
only if there is not one currently open with the same font.
If a new device is opened, it caches spacewidth
and
ismonospace
for use in nchar_ttype
).
close_font_dev
closes any open font state device
and clears the cached values.
debug_font_dev
and undebug_font_dev
activate and deactivate, respectively,
logging of where in the call stack font devices are being opened.