How to dynamically know if a Google font is serif/sans-serif, and if the font has bold/italic variants
<p>I want to know is if it is possible to dynamically find out if a font is serif/sans-serif (or mono/cursive) or supports bold/italic variants. I'm dynamically building stylesheets so it would be incredibly useful. If not I'll have to create a local dictionary, but I'm hoping to avoid that if possible. Just to be clear, I know you can manually visit the google.com/fonts and get all the relevant information about a font. </p>

<p>EDIT:
The reason I need to know the font details is because when generating css styles it is important to know the appropriate fallback (serif, san-serif, cursive, or monospace). I want to restrict which fonts are selectable for body text, because any font used for the body needs to support bold and italics.</p>

<p>I would like to be able to either pre-generate a dictionary or dynamically check font by font, instead of manually making a dictionary with entries like this:</p>

<pre><code>'Aclonica': {string: "'Aclonica', sans-serif", bold: false, italic: false},
</code></pre>