Bug 198990

Summary: Arabic letters are always displayed disjoined
Product: [Fedora] Fedora Reporter: Pavel Rosenboim <pavel1r>
Component: pangoAssignee: Behdad Esfahbod <behdad>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: sig, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://ar.wikipedia.org/wiki
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-29 03:26:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
page as displayed in FC5 firefox
none
Same page as displayed (correctly) in firefox by mozilla.org
none
pmap <pid of firefox-bin> none

Description Pavel Rosenboim 2006-07-15 11:47:26 UTC
Description of problem:
Arabic letters in some fonts are not joined as they should. Firefox 1.5.0.4 from
mozilla.org displays same pages correctly.

Version-Release number of selected component (if applicable):
firefox-1.5.0.4-1.2.fc5

How reproducible:
Always

Steps to Reproduce:
1. Open ar.wikipedia.org/wiki
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Pavel Rosenboim 2006-07-15 11:47:26 UTC
Created attachment 132483 [details]
page as displayed in FC5 firefox

Comment 2 Pavel Rosenboim 2006-07-15 11:49:49 UTC
Created attachment 132484 [details]
Same page as displayed (correctly) in firefox by mozilla.org

Comment 3 Aaron VanDevender 2006-07-31 22:11:04 UTC
I believe this is really a pango bug, rather than a firefox bug. gedit shows the
same behavior. (gedit-2.14.3-1, pango-1.12.3-1)

Comment 4 Pavel Rosenboim 2006-08-01 05:46:35 UTC
You are probably right, other applications have same problem. I'll change the
component.

Comment 5 Aaron VanDevender 2006-08-01 16:34:27 UTC
Shaping of Arabic words can be forced in Firefox by placing the arabic text in a
span which has a style with the attribute: "font-variant: small-caps"

I have no idea why this works, but perhaps it causes pango to switch font
families, to one for which word shaping has been activated. The "small-caps"
arabic script looks like a different font, in addition to being shaped.

This in a refression in FC5. I believe may have been introduced by pango 1.12.3,
since it wasn't present when FC5 was released with 1.12.0, however I can't check
this sice you can't revert to 1.12.0 without breaking about a dozen other deps
(cairo, gtk2, ...). Anybody know if this bug is present in the FC6 test releases?

Comment 6 Pavel Rosenboim 2006-08-01 18:30:56 UTC
No, firefox and other apps I tried are fine in FC6 test1 with current
development updates. I'll try to rebuild its pango for FC5 and see if it is better.

Comment 7 Pavel Rosenboim 2006-08-02 17:04:22 UTC
I rebuilt pango and cairo (requirement) on FC5, but it did't solve the problem
neither in firefox nor in other apps.

Comment 8 Behdad Esfahbod 2006-08-02 17:12:27 UTC
Yes, this is the most annoying problem with Fedora for me too.
There are a few points here, all adding up and causig what you see:

  1) Lack of good Arabic fonts AND existance of some fonts (Japanese I guess) in
Fedora that include broken Arabic section.  Most probably Arabic glyphs but no
OpenType tables for them.

  2) Fedora's Firefox has Pango enabled.

  3) Pango doesn't render Arabic fonts without OpenType tables correctly, and we
don't see enough reason to fix that.

  4) There was this other bug in Pango+Firefox that justified Arabic text was
not shaped.  That is probably fixed by now, but you /may/ be hitting that too.


So, solutions as I see:

  1) Include proper Arabic fonts in Fedora.  That probably happens in the FC7
timeframe by adopting the FarsiWeb fonts.

  2) Chop Arabic glyphs from any other font in Fedora.

  3) Fontconfig also is going to add support for blacklisting certain glyphs in
fonts.  This can be done instead or in excess of 2).

  4) Make Pango render Arabic fonts without OpenType tables.  We have a bug open
about it but I don't see myself doing that anytime soon.  Not for FC6 definitely.


So, what you can do is to test and figure out which fonts you are using (try
pmap on the firefox process and see which fonts it's got open), and whether your
firefox is using Pango (check the firefox About).

Comment 9 Aaron VanDevender 2006-08-02 19:10:43 UTC
I tried removing Japanese fonts by doing rpm -e fonts-japapnese and restarting
xfs, but that didn't seem to change anything. Not only are the Arabic words
still not shaped, but Japanese text still displays. Is there a way I can
determine which fonts are advertising the Arabic section, and therefor might be
broken?

Also, it seems like all of the conditions that you list (bad and broken fonts,
pango and OpenType, justification) have been long standing, and yet shaping
worked for me not too long ago, with a fresh install of FC5. What has changed
between now and then to break it?

Comment 10 Pavel Rosenboim 2006-08-02 19:23:12 UTC
I don't have and never had japanese-fonts installed, but still see the problem.
Also, FC6 test handles Arabic correctly with default setup. The only difference
with font setup between my FC5 and FC6 installations is that I copied windows
fonts to FC5 but not FC6.

Comment 11 Behdad Esfahbod 2006-08-03 00:30:06 UTC
As I said, you should do "pmap `/sbin/pidof firefox-bin` and for example paste
the output here.

Comment 12 Aaron VanDevender 2006-08-03 14:41:15 UTC
Created attachment 133560 [details]
pmap <pid of firefox-bin>

Output of pmap on the firefox process. pango-arabic-fc.so is included, but none
of the Kacst fonts are.

Comment 13 Behdad Esfahbod 2006-08-03 17:52:04 UTC
(In reply to comment #12)
> Created an attachment (id=133560) [edit]
> pmap <pid of firefox-bin>
> 
> Output of pmap on the firefox process. pango-arabic-fc.so is included, but none
> of the Kacst fonts are.

/usr/share/fonts/chinese/TrueType/uming.ttf
/usr/share/fonts/java/LucidaTypewriterRegular.ttf
/usr/share/fonts/bitmap-fonts/9x15.pcf
/usr/share/fonts/java/LucidaSansRegular.ttf
/usr/share/fonts/java/LucidaSansDemiBold.ttf

I suspect the chinese-fonts (uming), but won't be surprised if its the java
ones.  Remove them one by one and see which one makes the rendering change.

Comment 14 Aaron VanDevender 2006-08-04 05:37:03 UTC
It seems the java fonts were the key. The japanese and chinese fonts weren't
causing problems, but I had to remove:
/usr/share/fonts/java/LucidaBrightRegular.ttf
/usr/share/fonts/java/LucidaSansRegular.ttf
/usr/share/fonts/java/LucidaTypewriterRegular.ttf
/usr/share/fonts/java/LucidaSansDemiBold.ttf
/usr/share/fonts/java/LucidaTypewriterBold.ttf
in order to get it to display ar.wikipedia.org

The one glitch was that the arabic characters in the title bar were never
shaped. However, the site was usable, and the words in the pages were shaped if
I removed the above fonts.

Comment 15 Behdad Esfahbod 2006-08-04 14:25:03 UTC
So, which package do those fonts belong to?  Is it Fedora Core java packages?

Comment 16 Aaron VanDevender 2006-08-04 14:42:24 UTC
They are not from a core package. They're from Sun's JRE. I built the RPMS from
the jpackage.org .spec files. See: http://www.fedorafaq.org/#java

So since these fonts are distributed by Sun, there is probably little we can do
about them. Removing them works around most of the Arabic problem, but I don't
know how the JRE will respond to missing fonts.

Would it help if Sun included OpenType tables with their fonts? Can we verify
that this is in fact the problem?

In the long term I guess we'll need one of your other solutions 1-4, but for now
this seems to work.

Comment 17 Behdad Esfahbod 2006-08-04 16:17:32 UTC
I cannot thik of any solution at this time either.  Blacklisting their fonts is
not going to help.

Comment 18 Liang Zhang 2007-09-28 08:22:26 UTC
The upstream bug:
http://bugzilla.gnome.org/show_bug.cgi?id=481195

Comment 19 Liang Zhang 2007-09-29 03:24:15 UTC
 Comment #1 from Behdad Esfahbod    (pango developer, points: 23)
2007-09-28 23:42 UTC [reply]

Uninstall broken fonts, or blacklist its arabic range in fontconfig.