I'm reposting this question because it seems to have gone unanswered.
Is there a way to query the current editor font using rstudioapi?
My first guess would be to use readRStudioPreference(), but I don't know what the preference name would be. readRStudioPreference("server_editor_font"), which is cited in the RStudio Server Administration Guide, doesn't yield anything when used on RStudio Desktop.
There is not; the desktop font setting is one of a very small handful that are not stored in rstudio-prefs.json, in part because it is OS-specific. It is stored in an undocumented internal state file. You can infer this file's location from the support article that tells you where to go to remove it: