Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine which font file is being used, not just the font family?

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:

enter image description here

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.

like image 621
Daniel T. Avatar asked Nov 10 '17 06:11

Daniel T.


People also ask

What is the difference between font-family and font style?

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.

What is the difference between font size and font-family?

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.


1 Answers

To answer my own question, Nikul Khatik gave the correct answer. Chrome dev tools doesn't support this feature, but Firefox's does:

enter image description here So use Firefox to get the actual font face that's used for an element.

like image 144
Daniel T. Avatar answered Sep 27 '22 23:09

Daniel T.