Attempting to use Segoe font in browser - css

I want to render a page with fonts mostly being font-family:"Segoe" (that line goes in the appropriate class selectors which I've verified are working), however I get back a standard font (times new roman I think). Why won't it work? I am on Windows-7 64 bit so it's installed.

The name is "Segoe UI" not "Segoe". Change that and it will work.

Related

Rendered text looks very different in Qt and Blink, although same font is set

The upper font is from a QLabel with QFont("Arial").
The lower font is rendered with QWebEngine, e.g. Chromium/Blink backend, using css
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
Is there a way to make the blink one look as dark and sharp as the Qt one? It looks blurry and as both texts in the app are placed next to each other, it does not look good enough.
(Qt5.8 msvc 2015 on windows 8.1)
Edit
The reason is that chromium since version 52 did drop GDI support. In former version GDI rendering could be activated by disabling the DirectWrite flag. So basically I need to recompile Qt with a different chromium backend. Or perhaps with Cent Browser because it still supports that flag despite using newest chromium.
First get the font family using QFontInfo::family().
This function returns matched family name of windows system font.
QFont f("Arial");
QFontInfo info(f);
QString family = info.family();
In simple terms "QFontInfo object is used to determine the attributes of the font actually used in the window system."
Use the family name returned by QFontInfo and set the same for QWebEngine by QWebEngineSettings::setFontFamily or using CSS.
useful links:
http://doc.qt.io/qt-5/qfontinfo.html#family
http://doc.qt.io/qt-5/qwebenginesettings.html#setFontFamily

CSS Webfont not rendering missing character

I'm using the "Quicksand" font for a web project (http://www.google.com/fonts/specimen/Quicksand) and I've a problem : the ² character doesn't exist for that font. I thought that it would be rendered in other fonts (written after Quicksand in the font-family property), but it is not. When I write ², the only thing rendered is a white space.
Is there a way to render not supported characters by other fonts ?
Here's the CSS used :
font-family: "Quicksand", Helvetica, Arial, sans-serif;
There is a bug in the Quicksand font: for the Unicode code position U+00B2, SUPERSCRIPT TWO, it has an empty glyph. It is 396 units wide, so it is wider than a normal SPACE (300 units) in the font. Another character with a similar problem is U+201A SINGLE LOW-9 QUOTATION MARK “‚”, which has an empty glyph 230 units wide.
In principle, you could circumvent the bug by using unicode-range in a #font-face rule to specify that a particular character be taken from a different font. However, browser support is still too limited (and the approach would require that you host the font files instead of using them from the Google server).
Another possibility would be to edit the font. This requires a font editor and a permission from the copyright holder (and your hosting the font files of course).
A third option is to wrap each occurrence of “²” in a span element with a class and setting font-family on them suitably. Beware that this means mixing glyphs from different fonts, which should be avoided in good typography.
Finally, consider using a different font. There are several questions about rendering problems with the Quicksand font at SO.

Converting Vegur to be used for font-face

I need to use Vegur font, which is available in otf format, for a website. However, when I try to convert it using font squirrel or any other similar font-face generator (e.g. http://fontface.codeandmore.com/) font immediately loses all smoothness and quality...
Is anyone aware of where I could get a pre-converted version of the font? Or what else could I use to convert the font.
have you checked this page with html characters rather than the one you've linked to (that has images)?
http://www.fontspace.com/arro/vegur/22551.charmap
My OS is windowsXP (using Chrome at the moment) and XP notoriously renders non default fonts with poor quality and no smoothness. On the page you've linked to, the font looks nice and smooth because is just an image, while when I check the link above, all chars render poorly... what's your OS?

How to find the CSS font-family that is really in use? [duplicate]

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.
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.
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:
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 "웃":
Hovering "System Fonts" gets me:
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:
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:
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:
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:
I've not investigated what that entails.
The FontFinder plugin for Firefox does exactly what you want. After installing, highlight a block of text, right click and go to FontFinder -> Analyze Selection. It will tell you the actual font being used as well as a other information like font-family, spacing, color, etc.
Note that per Wilfred Hughes' answer, Firefox now supports this natively. This article has more details.
Firefox 22+ will show you which font is currently in use, without any extensions.
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":
You could try checking that specific section with Firebug for Firefox. It should give you all the exact properties.

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

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.
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.
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:
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 "웃":
Hovering "System Fonts" gets me:
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:
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:
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:
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:
I've not investigated what that entails.
The FontFinder plugin for Firefox does exactly what you want. After installing, highlight a block of text, right click and go to FontFinder -> Analyze Selection. It will tell you the actual font being used as well as a other information like font-family, spacing, color, etc.
Note that per Wilfred Hughes' answer, Firefox now supports this natively. This article has more details.
Firefox 22+ will show you which font is currently in use, without any extensions.
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":
You could try checking that specific section with Firebug for Firefox. It should give you all the exact properties.

Resources