Let's say I have the following font face definitions:
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: url("../fonts/open-sans.regular.woff") format("woff");
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: url('../fonts/open-sans.light.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: url('../fonts/open-sans.semibold.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: url('../fonts/open-sans.bold.woff') format('woff');
}
In Chrome's dev tools, I can tell which font family is being used:
But is there a way to tell which specific font file is being used? I'm trying to verify that the browser is actually using the bold version of the font, for example, instead of doing its own 'fake' bolding on the regular version of the font.
yash shukla tech. With a font-family you set more than one font to the selected item that could be reverted to should the 1st font fail to load, the 2nd will take it's place and so on while with the font-style you set only one font to selected item with no back up font to revert to.
And a “font family” represents a collection of related fonts, such as bold and italic variations of the same “typeface” or “font”. In summary, in common terminology, typeface (aka font) means the design, font means the file containing the typeface, and font-family means collection of related fonts.
To answer my own question, Nikul Khatik gave the correct answer. Chrome dev tools doesn't support this feature, but Firefox's does:
So use Firefox to get the actual font face that's used for an element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With