Styling backup fonts with javascript or jquery

Hi all, I am using a small font for a primary nav, but when it doesn’t load, the backup font that replaces it is enormous. I can’t not use the small font as it’s part of my work’s branding, and no other default fonts are even remotely similar. Does anyone know how to do set a class using Javascript or Jquery to the backup font?

Thanks