An "Outline" face of Helvetica Neue Bold font inappropriately selected by font-matching code if present in the font family

RESOLVED FIXED in Firefox 42

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: u544563, Assigned: jtd)

Tracking

({fonts, regression})

41 Branch
mozilla43
x86_64
All
fonts, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 unaffected, firefox41+ wontfix, firefox42+ fixed, firefox43 fixed)

Details

Attachments

(6 attachments)

(Reporter)

Description

3 years ago
Created attachment 8636395 [details]
Screenshot comparing font display in FF DevEd & Chrome (ff_dev_outline_font.png)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150720004006

Steps to reproduce:

Running Firefox 40b6 & Chrome 45 on linux/64 

Visit any number of sites (e.g. GitHub) in both of these browsers; *this* example: 

https://addons.mozilla.org/en-US/firefox/complete-themes/

Fonts in both browsers are identically displayed.

Upgrade FF 40b6 -> 41.0a2 (2015-07-20) Developer Edition

Start DevEd in 'full' mode, nav to: https://addons.mozilla.org/en-US/firefox/complete-themes/

Restart DevEd in 'safe' mode, nav to same URL.

Compare displayed results & fond rendering


Actual results:

Fonts in FF DevEd are displayed as outline fonts

The comparison of FF DevEd to Chrome 45 is shown in the attached screenshot.

FF DevEd on the left; Chrome 45 on the right.

I've reproduced this as initially presented by a colleague;  I.e., other user, other computer -- same results reproduced.


Expected results:

Fonts in FF DevEd should be displayed as non-outline fonts, identical to FF 40b6 and Chrome 45
(Reporter)

Updated

3 years ago
Keywords: fonts
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
(Reporter)

Comment 1

3 years ago
Poking at examples of outlined fonts with Style Inspector,  I found, e.g.,  text styled as:

.markdown-body {
    font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

displays OUTLINEd.

If I delete the font-family: ..., i.e.,

.markdown-body {
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

the outlined font vanishes, and the displayed text/font matches previous FF version and Chrome
(Reporter)

Comment 2

3 years ago
It appears to be an issue with "Helvetica Neue"

THIS display OUTLINEd fonts
    font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;

as does this
    font-family: "Helvetica Neue";

but none of these do
    font-family: "Helvetica Neue";
    font-family: Helvetica;
    font-family: "Segoe UI";
    font-family: Arial;
    font-family: freesans;
    font-family: sans-serif;

Updated

3 years ago
Component: Untriaged → Layout: Text
Keywords: regression
Product: Firefox → Core
(Reporter)

Comment 3

3 years ago
oops, typo.

should say:

...
but none of these do
    font-family: Helvetica;
    font-family: "Segoe UI";
    font-family: Arial;
    font-family: freesans;
    font-family: sans-serif;
Sounds like you have a "Helvetica Neue Outline" font installed, and we're picking that instead of the normal style. This is presumably triggered by the changes in bug 1056479 and followups.
Blocks: 1056479
Flags: needinfo?(jdaggett)
(Reporter)

Comment 5

3 years ago
fyi, I've here:

locate -i helveticaneue | grep /usr/local/share/fonts/
	/usr/local/share/fonts/OpenType/HelveticaNeue-BlackCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BlackCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BlackExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BlackExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BlackItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Black.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Bold.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-BoldOutline.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-CondensedObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Condensed.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ExtBlackCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ExtBlkCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ExtendedObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Extended.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-HeavyCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-HeavyCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-HeavyExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-HeavyExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-HeavyItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Heavy.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Italic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-LightCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-LightCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-LightExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-LightExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-LightItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Light.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-MediumCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-MediumCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-MediumExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-MediumExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-MediumItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Medium.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Roman.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ThinCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ThinCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ThinExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ThinExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-ThinItalic.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-Thin.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltLigCondObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltLigExtObl.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltraLigCond.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltraLigExt.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltraLight.otf
	/usr/local/share/fonts/OpenType/HelveticaNeue-UltraLtItal.otf
If you go to about:config and set the option gfx.font_rendering.fontconfig.fontlist.enabled to false, and then restart the browser, does that fix the issue? That would confirm this is related to the bug 1056479 changes.
Flags: needinfo?(pgnet.dev)
(Reporter)

Comment 7

3 years ago
> set the option gfx.font_rendering.fontconfig.fontlist.enabled to false, and then restart the browser

yes it does -- the fonts as displayed at the link above, and on github, are no longer OUTLINEd

setting the option is not sufficient; a restart _is- required.
Flags: needinfo?(pgnet.dev)
[Tracking Requested - why for this release]: Web compat regression.
status-firefox41: --- → affected
status-firefox42: --- → affected
tracking-firefox41: --- → ?
tracking-firefox42: --- → ?
Severity: normal → major
status-firefox40: --- → unaffected

Comment 9

3 years ago
Not sure if it is helpful but I can confirm it still happens with 42.0a1 (2015-07-25) 64bit, E10's enabled.
Tracked.
tracking-firefox41: ? → +
tracking-firefox42: ? → +
(Assignee)

Updated

3 years ago
Assignee: nobody → jdaggett
Flags: needinfo?(jdaggett)
Summary: upgrade from FF 40b6 -> 41.0a2 (2015-07-20) Developer Edition causes bold/title fonts at many sites to display incorrectly as outline fonts → outlined version of bold font selected when using new Linux fontconfig platform fontlist
(Assignee)

Updated

3 years ago
Component: Layout: Text → Graphics: Text
(Assignee)

Comment 11

3 years ago
I suspect the problem font is this one:

/usr/local/share/fonts/OpenType/HelveticaNeue-BoldOutline.otf

Where did you pick these fonts up? I'd like to try and reproduce the problem you're seeing here.
Flags: needinfo?(pgnet.dev)

Comment 12

3 years ago
Mine were from an Adobe Font Pack.  No longer available in that format.  Afaict, now available from Fonts.com.

Closest I can find is:

http://www.fonts.com/font/linotype/neue-helvetica/75-bold-outline
(Assignee)

Comment 13

3 years ago
(In reply to PGNet Dev from comment #12)
> Mine were from an Adobe Font Pack.  No longer available in that format. 
> Afaict, now available from Fonts.com.
> 
> Closest I can find is:
> 
> http://www.fonts.com/font/linotype/neue-helvetica/75-bold-outline

The Adobe Font pack fonts use different file names and the font name would end up as "Helvetica Neue LT Std" instead of "Helvetica Neue". But I do see that Adobe shipped "outline" versions of many faces using the same font family name. Using these fonts will cause problems for most browsers, since there's no way to distinguish between the "normal" versions and the outlined version. Guessing that the older font selection code was sorting the names in such a way that the normal version was selected before the outlined version.
(Assignee)

Comment 14

3 years ago
Adjusting the importance as this will only affect users who install the specific font pack here and I think that will be quite rare. It's still a problem which should consider tackling but I think it's not one that affects a wide variety of users.
Severity: major → normal

Comment 15

3 years ago
On Windows 10, I have deleted all of the Outlined Fonts that is installed and restarted Firefox afterwards. But the font issue still seems to be occurring. Is there anything else I should do that I am missing?
(Assignee)

Comment 16

3 years ago
(In reply to unique.ek from comment #15)
> On Windows 10, I have deleted all of the Outlined Fonts that is installed
> and restarted Firefox afterwards. But the font issue still seems to be
> occurring. Is there anything else I should do that I am missing?

What's the page where this is occurring? Open up that page, and inspect the element showing the undesired font. What does the font panel indicate is the font in use?
Flags: needinfo?(unique.ek)

Comment 17

3 years ago
Created attachment 8645528 [details]
20150810 032127-WIN-LCEH6A86523.png

Comment 18

3 years ago
Css: font-family: "Helvetica Neue",Arial,sans-serif;
Site: https://addons.mozilla.org/en-US/firefox/
Screenshot : https://bugzilla.mozilla.org/attachment.cgi?id=8645528
Flags: needinfo?(unique.ek)

Updated

3 years ago
Flags: needinfo?(pgnet.dev) → needinfo?

Comment 19

3 years ago
Just noticed that even tho Fonts Folder does not show any outlined fonts as installed, I could see those fonts still available both on Regedit and with cmd dir command. So I have rebooted in safe mode and removed those entries and the problem seems to be fixed for Outlined font.

But I think now Firefox started to use Italic version of it. There should be a better solution than deleting fonts from my PC. I am designer, I need those fonts for my work.

The font I have forcefully removed was named: HelveticaNeue-BoldOutline.otf

Adding new screenshot for Italic issue. Honestly I don't want to remove all Helvetica fonts to be able use Firefox properly. And I should say that almost every designer has those fonts installed, so that's a lot of unhappy users for Firefox. I hope the fix won't take long.

Comment 20

3 years ago
Created attachment 8645536 [details]
Italic Issue - 20150810 041300-WIN-LCEH6A86523.png
(Assignee)

Comment 21

3 years ago
I think it would be helpful to turn on font logging so that we can see which fonts are getting picked up.

1. Enable font logging by defining the following environment variables

  NSPR_LOG_MODULES=fontlist:5,textrun:5
  NSPR_LOG_FILE=/path/to/fontlog.txt

2. Restart Firefox

3. Navigate to the page showing the outline font

4. Wait 30 seconds

5. Quit Firefox and remove the environment variable definitions from step (1)

If you could run these steps and attach the log file that would be a big help.
Flags: needinfo?
(Assignee)

Updated

3 years ago
Flags: needinfo?(unique.ek)

Comment 22

3 years ago
(In reply to John Daggett (:jtd) from comment #21)
> I think it would be helpful to turn on font logging so that we can see which
> fonts are getting picked up.
> 
> 1. Enable font logging by defining the following environment variables
> 
>   NSPR_LOG_MODULES=fontlist:5,textrun:5
>   NSPR_LOG_FILE=/path/to/fontlog.txt
> 
> 2. Restart Firefox
> 
> 3. Navigate to the page showing the outline font
> 
> 4. Wait 30 seconds
> 
> 5. Quit Firefox and remove the environment variable definitions from step (1)
> 
> If you could run these steps and attach the log file that would be a big
> help.

Above steps did not generated any log files.

I have entered "C:/font-log.txt" without quotes for the "NSPR_LOG_FILE" variable. Any suggestions?
Flags: needinfo?(unique.ek)

Updated

3 years ago
Flags: needinfo?(jdaggett)
(Assignee)

Comment 23

3 years ago
(In reply to Erdin Kacan from comment #22)

> Above steps did not generated any log files.
> 
> I have entered "C:/font-log.txt" without quotes for the "NSPR_LOG_FILE"
> variable. Any suggestions?

Two things. I think you need "c:\font-log.txt" (backslash, this being MS-DOS 2015 :P). If your acct doesn't have admin privs, you'll need to create a folder somewhere and set the path to that folder instead.
Flags: needinfo?(jdaggett)

Comment 24

3 years ago
Created attachment 8646086 [details]
Font Logs

Backslash was a typo, my bad. Changing the directory did the trick. I've admin privs, not sure why it has failed to write on C: drive previously. Anyways, I've attached the file.
Duplicate of this bug: 1193623
This was originally filed as a Linux bug, but is clearly affecting Windows users as well if they have the "Outline" face installed as part of the Helvetica Neue family (see also the duplicate report in bug 1193623).

Presumably it could similarly affect other font families if there happen to be multiple faces that are not distinguished by the attributes the font-matching code actually uses.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Summary: outlined version of bold font selected when using new Linux fontconfig platform fontlist → An "Outline" face of Helvetica Neue Bold font inappropriately selected by font-matching code if present in the font family
The logs (comment 24) indicate that a lot of Helvetica Neue faces are being loaded with apparently incorrect style/weight/stretch properties in our font list. In particular, Oblique faces are getting style:normal; Extended and Condensed faces are getting stretch:0; Light and UltraLight are both weight:300; and a variety of Roman/Medium/Heavy/Black faces all end up with weight:500. 

We're getting about 50 faces of Helvetica Neue altogether, but only around 10 unique sets of properties to use in font matching.... so the results are liable to be pretty chaotic. 

I suspect that the style/stretch/weight properties we're getting may be values that were intended for separate simple families (so, for example, an Extended Black face may be considered to have stretch:0 and weight:500 when it is the sole member of a "Helvetica Neue Extended Black" family; but as part of the overall "Helvetica Neue" family, those properties are worthless).

John, given that this seems to be a regression that people are just recently experiencing, even though they've presumably had this font collection for some time, can we figure out what changed and restore the previous sorting or whatever behavior was involved?
Flags: needinfo?(jdaggett)
(Assignee)

Comment 28

3 years ago
Created attachment 8653246 [details]
list of Helvetica Neue faces from Erdin's font logs

As Jonathan notes, the oblique faces in this group of fonts are being classified as *not* italic/oblique. This will lead to conflicts with the regular faces. I suspect the root cause of the bug on non-Linux platforms may be the changes made for supporting fontconfig within gfxPlatformFontList.
Flags: needinfo?(jdaggett)
(Assignee)

Updated

3 years ago
Blocks: 1165179
(Assignee)

Comment 30

3 years ago
Created attachment 8654703 [details] [diff] [review]
patch, adjust the ordering of style matching

The patch on bug 1165179 added all fonts of equal matching style distance to the fontlist, rather than just the last one. To deal with @font-face families with unicode-range faces properly, the style matching code iterates over available fonts in reverse order. But this means that for families like the old Helvetica Neue family on Linux/Windows, odd faces like "Bold Outline" will have precedence over standard faces like "Bold". The solution here is to iterate over the available fonts in forward order and simply flip the insertion order for @font-face families.

I can reproduce the problem here with a copy of the Helvetica Neue family under Linux. The patch fixes the problem (i.e. Bold is used instead of Bold Outline). This should fix all the problems noted here.
Attachment #8654703 - Flags: review?(cam)
Comment on attachment 8654703 [details] [diff] [review]
patch, adjust the ordering of style matching

Review of attachment 8654703 [details] [diff] [review]:
-----------------------------------------------------------------

Hopefully mAvailableFonts doesn't grow too large, as filling the array will now take N^2 time...
Attachment #8654703 - Flags: review?(cam) → review+
(In reply to Jonathan Kew (:jfkthame) (PTO - back Sept 1st) from comment #27)
> We're getting about 50 faces of Helvetica Neue altogether, but only around
> 10 unique sets of properties to use in font matching.... so the results are
> liable to be pretty chaotic. 

Hmm, is this how big mAvailableFonts will be?
(Assignee)

Comment 33

3 years ago
(In reply to Cameron McCormack (:heycam) from comment #31)
> Comment on attachment 8654703 [details] [diff] [review]
> patch, adjust the ordering of style matching
> 
> Review of attachment 8654703 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Hopefully mAvailableFonts doesn't grow too large, as filling the array will
> now take N^2 time...

The n^2 case only applies to downloadable fonts where having more than say 10 faces in a family will be relatively rare. It's an array of refPtr's so copying things around as the faces are added isn't going to be the end of the world. For platform fonts this cost will be paid only once per browser run, when the faces of a family are enumerated. I doubt either will have any perf impact.
(Assignee)

Comment 34

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/34ee64c25acf864c6086818760297ec0f9932fb8
Bug 1185812 - rejigger the ordering of fonts within a family to avoid obscure faces. r=heycam
(In reply to John Daggett (:jtd) from comment #33)
> The n^2 case only applies to downloadable fonts where having more than say
> 10 faces in a family will be relatively rare. It's an array of refPtr's so
> copying things around as the faces are added isn't going to be the end of
> the world. For platform fonts this cost will be paid only once per browser
> run, when the faces of a family are enumerated. I doubt either will have any
> perf impact.

OK, sounds reasonable.
The comment

// add the given font entry to the end of the family's list

seems misleading now.
https://hg.mozilla.org/mozilla-central/rev/34ee64c25acf
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Duplicate of this bug: 1202558
John, do you think this fix is safe to uplift to Beta41?
Flags: needinfo?(jdaggett)
(and aurora)
(Assignee)

Comment 41

3 years ago
Comment on attachment 8654703 [details] [diff] [review]
patch, adjust the ordering of style matching

Approval Request Comment
[Feature/regressing bug #]: bug 1165179 broadened the set of fonts picked up by font selection, which affected users who have installed older versions of Helvetica Neue on non-OSX platforms
[User impact if declined]: content may show up in strange outline font
[Describe test coverage new/current, TreeHerder]: fix landed last week and appears stable
[Risks and why]: affects only those with a relatively rare set of fonts installed 
[String/UUID change made/needed]: none
Flags: needinfo?(jdaggett)
Attachment #8654703 - Flags: approval-mozilla-beta?
Attachment #8654703 - Flags: approval-mozilla-aurora?
Comment on attachment 8654703 [details] [diff] [review]
patch, adjust the ordering of style matching

Let's take it for 42. Thanks
Attachment #8654703 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8654703 [details] [diff] [review]
patch, adjust the ordering of style matching

While this is a valid issue, it is too late in the Beta cycle to take these kinds of fixes. I am afraid that it may regress release quality which is not what we want just before gtb RC
Attachment #8654703 - Flags: approval-mozilla-beta? → approval-mozilla-beta-

Updated

3 years ago
status-firefox41: affected → wontfix
(Assignee)

Comment 45

3 years ago
(In reply to Ritu Kothari (:ritu) from comment #43)

> While this is a valid issue, it is too late in the Beta cycle to take these
> kinds of fixes. I am afraid that it may regress release quality which is not
> what we want just before gtb RC

Sounds reasonable. As I described above, this will only affect those who have installed older versions of Helvetica Neue on non-OSX systems. Newer versions of Helvetica Neue ship with better organization (e.g. moving the Outline face to a separate family) or use a slightly different name. The common inclusion of Helvetica Neue on OSX/iOS systems means that authors are much more likely to include "Helvetica Neue" in their fontlists.
Duplicate of this bug: 1203687
Depends on: 1221263
Duplicate of this bug: 1223494
You need to log in before you can comment on or make changes to this bug.