Closed Bug 1081514 Opened 10 years ago Closed 10 years ago

Replace Arial with Segoe UI for Arabic text on Windows

Categories

(Core :: Graphics: Text, defect)

32 Branch
x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: ebrahim, Assigned: ebrahim)

Details

(Whiteboard: [parity-IE][parity-chrome])

Attachments

(4 files, 1 obsolete file)

Attached file dataurl.html
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2184.0 Safari/537.36

Steps to reproduce:

1. Open dataurl.html on Firefox and IE11 and compare


Actual results:

IE11 is using Segoe UI for Arabic text while Chrome use Arial


Expected results:

IMO it would be nice to replace default font for Arabic with Segoe UI for Blink also. Currently Chrome UI is also using Segoe for Arabic text on Windows (not intentionally perhaps, due system settings for fonts) which actually is highly more legible at small sizes and better for Arabic text overall.

Cross filled on Chrome also: http://crbug.com/422681
Component: General → Graphics: Text
Copypaste error on bug desc :) however you should replace Blink with Gecko and Chrome UI with Firefox UI
Whiteboard: parity-IE
Attached image A.png
Note that (unlike IE11), Firefox runs on Windows XP systems, and such systems are very unlikely to have the Segoe UI font. I don't think we currently have a good mechanism to specify default fonts that depend on the OS version (we have per-platform defaults, but WinXP through Win81 are all "Windows platform" as far as that is concerned).
Attached image Segoe UI, Tahoma, Arial
Just as an idea, Segoe UI for Arabic can be pollyfilled/fallbacked with Tahoma for Windows XP, both fonts have similar style and good for Arabic sans-serif unlike Arial which can not be considered sans-serif and is current Sans-serif
(In reply to Jonathan Kew (:jfkthame) from comment #3)
> Note that (unlike IE11), Firefox runs on Windows XP systems, and such
> systems are very unlikely to have the Segoe UI font. I don't think we
> currently have a good mechanism to specify default fonts that depend on the
> OS version (we have per-platform defaults, but WinXP through Win81 are all
> "Windows platform" as far as that is concerned).

Can't we use a font list as in bug 998777?
(In reply to Simon Montagu :smontagu from comment #5)
> (In reply to Jonathan Kew (:jfkthame) from comment #3)
> > Note that (unlike IE11), Firefox runs on Windows XP systems, and such
> > systems are very unlikely to have the Segoe UI font. I don't think we
> > currently have a good mechanism to specify default fonts that depend on the
> > OS version (we have per-platform defaults, but WinXP through Win81 are all
> > "Windows platform" as far as that is concerned).
> 
> Can't we use a font list as in bug 998777?

Yes, that's a possibility. It does come with a downside, I think, in that the Preferences dialog can't properly reflect (or restore) the default settings on versions where the "primary" font named in the non-list pref isn't actually available, but maybe that's not very important.
(In reply to Jonathan Kew (:jfkthame) from comment #6)

> Yes, that's a possibility. It does come with a downside, I think, in that
> the Preferences dialog can't properly reflect (or restore) the default
> settings on versions where the "primary" font named in the non-list pref
> isn't actually available, but maybe that's not very important.

This should do what you want:

font.name.sans-serif.ar           Segoe UI
font.name-list.sans-serif.ar      Segoe UI, Arial

On systems without Segoe UI, Arial will be used and Arial will show as the default font for sans-serif Arabic in Preferences > Content > Advanced...
Google guys also support the idea, https://code.google.com/p/chromium/issues/detail?id=422681#c4

This would be very good, for example currently Persian Wikipedia[1], Central Kurdish Wikipedia[2], Gilaki Wikipedia[3], Mazandarani Wikipedia[4], Pashton Wikipedia[5], Panjabi Wikipedia[6], Egyptian Arabic Wikipedia[7] are modifying default sans-serif font to Tahoma which is a better aans-serif font (and Segoe UI is also better than that), also Arabic Wikipedia wanted to do the same which due some technical problems of Tahoma (not even the later released improved Segoe UI) didn't that currently[8]. So the idea of changing Arabic sans-serif to something better, the thing that IE done already, is supported across different Arabic script languages.

[1]: http://fa.wikipedia.org/
[2]: http://ckb.wikipdeia.org/
[3]: http://glk.wikipedia.org/
[4]: http://mzn.wikipedia.org/
[5]: http://ps.wikipedia.org/
[6]: http://pnb.wikipedia.org/
[7]: http://arz.wikipedia.org/
[8]: http://ar.wikipedia.org/wiki/%D9%88%D9%8A%D9%83%D9%8A%D8%A8%D9%8A%D8%AF%D9%8A%D8%A7:%D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86/%D8%A3%D8%B1%D8%B4%D9%8A%D9%81/%D8%A7%D9%82%D8%AA%D8%B1%D8%A7%D8%AD%D8%A7%D8%AA/04/2011#.D8.AA.D8.BA.D9.8A.D9.8A.D8.B1_.D8.AE.D8.B7_.D9.88.D9.8A.D9.83.D9.8A.D8.A8.D9.8A.D8.AF.D9.8A.D8.A7
Please note that,
* Falling back to a sans font is not something unexpected, actually Blink is doing that https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp&l=111
* Because of same weight, Segoe UI is fall backed with Tahoma, same weight and actually popular font face across from http://www.smashingmagazine.com/2010/09/19/showcase-of-web-design-in-the-arab-world/ "most of the time the font used is Tahoma because it is the most legible on the web"
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8508584 - Flags: review?(jfkthame)
Chrome is fixed https://codereview.chromium.org/663363004/ waiting here for a review.
I think applying this bug at the same time span with fix of https://code.google.com/p/chromium/issues/detail?id=422681 would prevent confusion of webdevs, any one can help on the review or to replace the patch if it is under your expectations?
Whiteboard: parity-IE → parity-IE, parity-
Whiteboard: parity-IE, parity- → parity-IE
Whiteboard: parity-IE → [parity-IE][parity-chrome]
Comment on attachment 8508584 [details] [diff] [review]
Use Segoe UI by default for Arabic sans text on Windows

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

::: gfx/thebes/gfxWindowsPlatform.cpp
@@ +906,5 @@
>              aFontList.AppendElement(kFontTraditionalArabic);
>              aFontList.AppendElement(kFontArabicTypesetting);
>              break;
>          case 0xfe:
> +            aFontList.AppendElement(kFontSegoeUI);

Should you prepend kFontSegoeUI in "case 0x06" as well?
Attached patch patch.txtSplinter Review
> Should you prepend kFontSegoeUI in "case 0x06" as well?
I think 0x06 is about Uighur which as their Wikipedia http://ug.wikipedia.org/ I see they have a bit different preference of fonts. As I can not explain 0xfe and am not aware of 0xfc and 0xfd difference, I think it would be better to drop the fallback font change from this patch as it is unnecessary change in current situation for Firefox.
Attachment #8508584 - Attachment is obsolete: true
Attachment #8508584 - Flags: review?(jfkthame)
Attachment #8517586 - Flags: review?(jfkthame)
Comment on attachment 8517586 [details] [diff] [review]
patch.txt

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

OK, we can just do this for now, and see how things go.
Attachment #8517586 - Flags: review?(jfkthame) → review+
(In reply to ebrahim from comment #13)
> Created attachment 8517586 [details] [diff] [review]
> patch.txt
> 
> > Should you prepend kFontSegoeUI in "case 0x06" as well?
> I think 0x06 is about Uighur...

There are plenty of other languages besides Uighur (e.g. Pakistani languages such as Sindhi, Pashto, and many more) that use characters from the U+06xx block and that might not be present in many mainstream Arabic fonts. I think the reason MS Uighur got into the list there is because it has particularly complete coverage of the block, but that doesn't necessarily equate to being a desirable style.
> There are plenty of other languages besides Uighur (e.g. Pakistani languages
> ...
Thank you. I am also more or less aware of such differences.

What should be done next for merge of this? FWIW Chrome 40 just got branch out.
I've pushed a tryserver job to check whether this has any unexpected effects on unit tests -- it's possible that we have testcases that are a bit fragile with respect to the font that's being used.

https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=d5ed63326ba8

Once we see how that goes, we should be able to land this and have it appear in Nightly builds soon.
Try run looks good; landed on inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b293b8a12dfd
Target Milestone: --- → mozilla36
https://hg.mozilla.org/mozilla-central/rev/b293b8a12dfd
Assignee: nobody → ebrahim
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.