How can I determine what font a browser is actually using to render some text?

CssBrowserFonts

Css Problem Overview


My CSS specifies "font-family: Helvetica, Arial, sans-serif;" for the whole page. It looks like Verdana is being used instead on some parts. I would like to be able to verify this.

I've tried copying and pasting from my browser into Word, but it's not preserving the font.

Is there some way to determine which font is actually being used for a section of text?

Firebug will give me the list of fonts as above[1], but I don't see a way to determine which one of the fonts is being used.

  1. It turns out the wrong list was being used, which solved my original Verdana problem. But I'm still curious if there's a way to identify the actual rendering font.

Css Solutions


Solution 1 - Css

Since many years Firefox and Chrome have built-in tools for that to show all details, but the October 2021 Safari 15.x still needs you to copy some text and investigate that.

Firefox

In Firefox, the Page Inspector that shows after right-clicking some text and choosing Inspect Element, has a Fonts view:

Firefox fonts view

This will also tell you which style is used, such as Regular, ExtraLight, Italic, BoldItalic and all.

Like for the above screenshot:

> .SF NS
> System Font
> Apple SD Gothic Neo
> Apple SD Gothic Neo Regular

So, you see all fonts that are used in the element you're looking at, even when only selecting a single glyph. Just hover a single font name in the inspector to highlight the glyphe(s) that use that specific font. Hovering "Apple SD Gothic Neo Regular" nicely highlights just the "웃":

Apple SD Gothic Neo Regular

Hovering "System Fonts" gets me:

System Fonts

For web fonts, it seems Firefox shows the name from the CSS along with details from within the downloaded font. In its "All Fonts on Page" section it also tells where fonts were downloaded from.

For me, in October 2021, Firefox has the best options to determine the font. But: not all browsers may use the same font, so read on!

Chrome

For Chrome, go into DevTools' "Elements", go to its "Computed" tab, and scroll all the way down to the section called "Rendered Fonts". Unlike with Firefox, this only shows the base font name, not any specific style it may be using:

Chrome Web Inspector

For web fonts, Chrome just shows "Network resource" (where Firefox shows many more details).

Like with Firefox, you see all fonts that are used in the element you're looking at, even when only selecting a single glyph. Chrome does give you a count of the glyphes that use a specific font within the selected element, but does not support hovering to highlight the glyphe(s) that use a specific font:

> .SF NS — Local file (192 glyphs)
> .Apple SD Gothic NeoI — Local file (1 glyph)

Safari

The October 2021 Safari 15 has finally introduced a "Fonts" tab, but its output is quite limited. For "Identity" it often shows secondary information such as "TN web use only" (where Firefox shows that as a comment, like in "Interstate Condensed, TN web use only"). Or shows nothing at all. But, finally, it's a start:

Safari fonts tab

This only works for elements. For text nodes (like a single character), the fonts tab is not shown.

For the same example as used above, Safari does not even indicate multiple fonts are used:

> Identity
> Name .AppleSystemUIFont

So, read on.

Other browsers (and Safari)

For Safari and other browsers that do not have a full fledged fonts view, simply copy & paste a fragment of the text into some word processor or Rich Text editor, select some specific text, and see which name shows up in some font dropdown list. On my Mac, this does not work when pasting from Firefox (where for "웃" Firefox's "Apple SD Gothic Neo" is converted into "AppleMyungjo" on pasting), but works well for Safari and Chrome:

https://i.stack.imgur.com/zBplz.png"><img src="https://i.stack.imgur.com/zBplz.png" width="400" alt="Text pasted from browser into rich text editor">

Multiple fonts in a single HTML element

For the above screenshots, the actual CSS defines:

font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Liberation Sans", sans-serif;

But those fonts often don't include many special characters. As the font information works per HTML element, where Unicode text in an element could actually use multiple fonts in its child text node, the developer tools show multiple fonts as well. When in doubt, hover the fonts in Firefox, or in other browsers just double-click the text in the HTML pane and get rid of the text you're not interested in. Then, when selecting the surrounding element again, you'll just see one option.

Different fonts in different browsers

Unfortunately, different browsers (and even different versions of a single browser) on the very same machine may use different fonts, due to the font types supported/preferred by a browser. On a Mac, for example, Safari may prefer Apple Advanced Technology while Firefox supports Microsoft OpenType (which may yield problems for Arabic after installing Microsoft Office on a Mac). Or for the "웃" character in the screenshots above, Firefox and Chrome on my Mac nowadays prefer "Apple SD Gothic Neo" and ".Apple SD Gothic NeoI" (which are OpenType PostScript) but older versions of Firefox used "AppleGothic Regular" instead (which is a TrueType font).

file /System/Library/Fonts/AppleSDGothicNeo.ttc 
/System/Library/Fonts/AppleSDGothicNeo.ttc: OpenType font collection data, 2.0, 18 fonts, at 0x60 OpenType Font data, 18 tables, 1st "BASE"

file /System/Library/Fonts/Supplemental/AppleGothic.ttf 
/System/Library/Fonts/Supplemental/AppleGothic.ttf: TrueType Font data, 18 tables, 1st "cmap", 33 names, Macintosh, Copyright ? 1994-2006 Apple Computer, Inc. All rights reserved.AppleGothicRegularAppleGothic Reg

Note that Chrome (on a Mac) shows a leading dot and trailing uppercase "i" in "NeoI" which are lacking in Firefox for the same example. On that Mac, Font Book shows:

Font Book

I've not investigated what that entails.

Solution 2 - Css

Per Wilfred Hughes' answer, Firefox now supports this natively. This article has more details.

This answer original referenced the "Font Finder" plugin, but only because it was from 4 years ago. The fact that old answers linger like this and the community cannot update them is one of the few remaining failures of Stack Overflow.

Solution 3 - Css

Solution 4 - Css

WhatFont is a Chrome extension that will tell you specifically which font in the font stack is being loaded.

Solution 5 - Css

For current versions of Firefox (since v7), there's an add-on called "fontinfo" that will report the actual font being used (rather than what the CSS font-family property says), taking account of cases where the browser falls back to a different font because the requested font-family wasn't available or didn't support the characters used in the text.

Solution 6 - Css

You could try checking that specific section with Firebug for Firefox. It should give you all the exact properties.

Solution 7 - Css

The "FontFinder" plugin mentioned by jeremy seems not to work here, giving the first font of the CSS list regardless of the actually rendered font (Firefox 4.0rc1 on Linux). The following plugin however gives you the "correct" font, it seems.

Context Font

Solution 8 - Css

There is no need to use any external browser plugins for that. In order to check which font is really used on the website in Google Chrome, you need to:

  • open developer tools (right click on a website and select inspect)
  • select desired object within "elements" tab
  • select "computed" tab, in the bottom pane you would see "rendered fonts":

enter image description here

Solution 9 - Css

Based on the text-measuring approach and script from Lalit Patel, I have created bookmarklets that can guess the font that is being used for the currently selected text (or the body, if nothing is selected). It seems to work very well for me for figuring out which font in a stack is used! (It can't tell you what sans-serif actually maps to, though.)

Grab them here: <https://alanhogan.com/bookmarklets#font-stack-full>

The source is on GitHub.

See also: this CodePen, which uses mostly the same code. Give it a try by selected different paragraphs and watching the table / guess update!

Solution 10 - Css

You could try using Find Website Used Fonts to identify the different typefaces used on a website or web page.It's a free chrome extension that also lets you preview a typed in text of your own in the different font-styles identified from a webpage. Super convenient and easy to use, it's also free so that's a major plus. Hope this helps 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionlavaturtleView Question on Stackoverflow
Solution 1 - CssArjanView Answer on Stackoverflow
Solution 2 - CssJeremy KauffmanView Answer on Stackoverflow
Solution 3 - CssWilfred HughesView Answer on Stackoverflow
Solution 4 - Cssuser1100745View Answer on Stackoverflow
Solution 5 - CssJonathanView Answer on Stackoverflow
Solution 6 - CssjeroenView Answer on Stackoverflow
Solution 7 - CssDave VogtView Answer on Stackoverflow
Solution 8 - CsslukeView Answer on Stackoverflow
Solution 9 - CssAlan H.View Answer on Stackoverflow
Solution 10 - CssFay LoraView Answer on Stackoverflow