Bug 681808

Summary: Renders € sign as ¤ in http://www.apple.com/ie/macbookpro/
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: fontconfigAssignee: Behdad Esfahbod <behdad>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: behdad, fonts-bugs, gecko-bugs-nobody, mcepl, mkasik, pnemade, tagoh
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-11 12:00:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
screenshot of non-reproduction
none
test script to investigate fonts
none
Advanced content prefs
none
output of 'otfdump lsansuni.ttf'. none

Description David Woodhouse 2011-03-03 10:47:48 UTC
I see nothing wrong with the page. It is correctly marked as UTF-8 by both a Content-Type: header which appears both in the HTTP response and a <meta http-equiv> tag.

It contains the byte sequence e2 82 ac to represent the € sign, which is correct.

Firefox claims to be rendering it as UTF-8, which ought to be correct. And yet firefox is still showing me a ¤ sign.

If I tell Firefox to render it as ISO8859-1, it shows € instead. And I switch back to UTF-8 and it shows ¤ again.

Strangely, when I *select* the ¤ sign in that tab and paste it here, it pastes as €. So could it just be a *font* problem?

Comment 1 Matěj Cepl 2011-03-07 08:41:38 UTC
Created attachment 482622 [details]
screenshot of non-reproduction

Thanks for the bug report.  We have reviewed the information you have provided above, and there is some additional information we require that will be helpful in our diagnosis of this issue.

I cannot reproduce here with firefox-3.6.14-1.fc14 (see the attached screenshot). So, we need more information to be able to reproduce the issue here.

1) Are you able to reproduce this when running firefox in the safe mode (i.e.,
run it with parameter -safe-mode on the command line)
2) Are you able to reproduce the problem with the upstream binary from
http://www.firefox.com/?
3) Are you able to reproduce the problem with a fresh profile?
4) What fonts do you have set up for Firefox? (check for other encodings as well, particularly for UTF-8, which seems to be declared encoding of the page in question)
5) We would need to understand more about fonts on your system. Could you run the attached script on your system, please, and paste here the result?

Thank you for your cooperation and helping to make Fedora more awesome!
We will review this issue again once you've had a chance to attach this information.

Thanks in advance.

Comment 2 Matěj Cepl 2011-03-07 08:43:29 UTC
Created attachment 482624 [details]
test script to investigate fonts

Comment 3 Matěj Cepl 2011-03-07 08:50:37 UTC
Could I get also a screenshot of Edit/Preferences/Content/Advanced, please?

Thank you

Comment 4 David Woodhouse 2011-03-07 12:45:07 UTC
(In reply to comment #2)
> Created attachment 482624 [details]
> test script to investigate fonts

Serif:		DejaVuSerif.ttf: "DejaVu Serif" "Book"
Sans Serif:		DejaVuSans.ttf: "DejaVu Sans" "Book"
Lucida Grande:		DejaVuSans.ttf: "DejaVu Sans" "Book"
Lucida Sans Unicode:		lsansuni.ttf: "Lucida Sans Unicode" "normal"
Helvetica:		n019003l.pfb: "Nimbus Sans L" "Regular"
Arial:		arial.ttf: "Arial" "Normal"
Verdana:		verdana.ttf: "Verdana" "Normal"
sans-serif:		DejaVuSans.ttf: "DejaVu Sans" "Book"

Comment 5 David Woodhouse 2011-03-07 12:47:52 UTC
Created attachment 482666 [details]
Advanced content prefs

Comment 6 David Woodhouse 2011-03-07 12:48:40 UTC
If I uncheck 'Allow pages to choose their own fonts, instead of my selections above', then the problem goes away.

Comment 7 David Woodhouse 2011-03-07 13:02:34 UTC
Created attachment 482669 [details]
output of 'otfdump lsansuni.ttf'.

If I use firebug and remove 'Lucida Sans Unicode' from the CSS list of fonts, then I get the € character back.

Is this a fontconfig problem, or is the font just buggered? I can provide the actual .ttf file if necessary; here's the 'otfdump' output.

Comment 8 David Woodhouse 2011-03-07 13:07:59 UTC
Looks like this font doesn't *have* a glyph for code point 0x20ac. That would make it a code bug, right?

Comment 9 Matěj Cepl 2011-03-07 15:06:48 UTC
(In reply to comment #8)
> Looks like this font doesn't *have* a glyph for code point 0x20ac. That would
> make it a code bug, right?

yup ... I thought so ... some replacement rule had to kick in, because ¤ used to be a generic monetary sign, so when Firefox didn't find €, it tried the second best thing apparently (which is I guess correct on FF side, although the result is disappointing).

Although, an interesting question is why it didn't go after "Lucida Grande" when it has one and it is first. But that would be a question for pango folks. I think, nothing for Firefox here.

So, the question is ... what is lsansuni.ttf about, and where does it come from?

And the second question is ... should I reassign this to pango, or to whichever package lsansuni.ttf comes from?

Comment 10 Matěj Cepl 2011-03-07 15:25:52 UTC
Reassigning to fontconfig and asking mkasik for help.

Could we get that font as well attached to this bug (as a private attachment, so we won't distribute it worldwide), please?

Thank you

Comment 11 David Woodhouse 2011-03-07 22:10:19 UTC
Created attachment 482799 [details]
offending font

This is the font. I don't see how to make it private; could you do that please?

It's from a font CD I bought some time ago; it's not something we're distributing in Fedora.

Comment 12 Marek Kašík 2011-03-09 11:24:03 UTC
Hi,

I had a look at the problem but I haven't found its root yet. I'll investigate it in more detail later.

Regards

Marek

Comment 13 Behdad Esfahbod 2011-03-18 19:24:31 UTC
Can someone give me perms to download the font?

Comment 14 Nicolas Mailhot 2011-03-21 09:14:58 UTC
(In reply to comment #0)

> Strangely, when I *select* the ¤ sign in that tab and paste it here, it pastes
> as €. So could it just be a *font* problem?

It is very possible it is a font *and* software problem (just look at that font in gucharmap to check if the glyph is there or not, right click on it to make sure it comes from the font you expect)

In the early days of €:

1. a lot of fonts didn't include this sign, so some apps may have coded private fallbacks to other symbols (instead of relying on fontconfig because "it's not available in windows", sigh)

2. people expected € to replace ¤, because ¤ was already printed on western keyboards, not hugely useful, and in an 8-bit encoding (non unicode) world adding a new sign required dumping another. That's what happened in iso-8851-15, but because US people refused to make iso-8851-15 their encoding default instead of iso-8851-1 (as was expected by Europeans), iso-8851-15 is largely stillborn and less supported than UTF-8. And saner people put € on altgr+E instead of the badly placed key ¤ was relagated at (we may still have a few legacy xkeyboard-config layouts that put € at ¤). 

So:
1. if the font is missing €, its author should add it (but no chance in hell for that to happen in a freely distributable closed font)
2. if fontconfig or firefox still contains code to substitute ¤ to € it should be removed. With so many fonts including € this code is way past its due date

Comment 15 Nicolas Mailhot 2011-03-21 09:17:45 UTC
make it iso-8859 here (cut and paste strikes again :()

Comment 16 Behdad Esfahbod 2011-03-21 19:46:22 UTC
Apparently the Apple Roman encoding was changed to substitute the Euro sign instead of the currency sign.  That happened in Mac OS 8.5.  So, we can call this a legacy-font bug I guess.   See:

https://secure.wikimedia.org/wikipedia/en/wiki/Mac_OS_Roman#ref_currency

In fact, fontconfig has code to prefer Unicode cmap over Apple Roman cmap if the EURO SIGN is covered by the font.  That logic however is failing because indeed the Unicode cmap doesn't cover Euro.

It may be time to simply remove the Apple Roman decoding from fontconfig.  Filed:

  https://bugs.freedesktop.org/show_bug.cgi?id=35517

Comment 17 Akira TAGOH 2011-07-20 05:40:34 UTC
*** Bug 698601 has been marked as a duplicate of this bug. ***

Comment 18 Akira TAGOH 2011-07-20 05:41:10 UTC
*** Bug 698599 has been marked as a duplicate of this bug. ***

Comment 19 Fedora Update System 2012-03-23 06:58:17 UTC
fontconfig-2.8.0-6.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/fontconfig-2.8.0-6.fc17

Comment 20 Fedora Update System 2012-04-12 02:16:27 UTC
fontconfig-2.8.0-6.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 David Woodhouse 2012-04-12 09:50:11 UTC
Installing this package on F16 fixes the issue with www.apple.com for me too; thanks.