Are you unable to use numbers on CSS font family names?

So I was last night coding a little thing to randomize the font used in a part of the title of my page, and it works perfectly. However, I ran into an issue regarding numbers in the font name. As you can see in the image, I have an array of fonts, pick one at random, and then use a template literal to change the font to the element's style. The font is called 1942 Report, and so I called it 1942 in the @font-face declaration in CSS. However, this didn't seem to work within the javascript code. It did however, work when I manually set that font into the font-family attribute within the stylesheet. Are font names not supposed to ever have numbers? Or is it the javascript that inserts it in a different way? I couldn't find anything about this online except for one person that seemingly had a similar issue with numbers, so I'm curious about it

Of course, I don't need to have numbers in my fonts and I'll just avoid using them if it causes issue, but I would like to know what is going on
image.png
Was this page helpful?