Last modified: 2014-10-03 08:07:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 32317 - PDF export extension fails to render Arabic characters in monospace font
PDF export extension fails to render Arabic characters in monospace font
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Collection (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on: ubuntu-trusty
Blocks: 31552
  Show dependency treegraph
 
Reported: 2011-11-09 15:53 UTC by reza1615
Modified: 2014-10-03 08:07 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
GNU Fonts with arabic characters (545.22 KB, application/x-zip-compressed)
2011-11-15 14:30 UTC, reza1615
Details
Sans (908.73 KB, application/x-zip-compressed)
2011-11-15 14:31 UTC, reza1615
Details
serif (1.49 MB, application/x-zip-compressed)
2011-11-15 14:31 UTC, reza1615
Details

Description reza1615 2011-11-09 15:53:22 UTC
PDF export extension has problem with <cod></cod> when we have Unicode characters
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf3#problem_with_unicode

also when we have space in first of Unicode text line
Comment 1 Brion Vibber 2011-11-09 18:40:15 UTC
What specific "Unicode" issue are you talking about? All the text is Unicode, and all the characters in the title and the "direction" section appear offhand to render.

Are the characters in the "problem with unicode" section different? Are they Farsi-specific letters perhaps? (bug 30326)

The section with space at start will be showing as a preformatted text section, which it appears to correctly set off but is laying out left-justified; on the web however these appear to start as right-aligned.

(I'm not sure if right-aligned ever really makes sense for preformatted text sections though; is that something that gets used in RTL scripts? They're not generally fixed-width...)
Comment 2 reza1615 2011-11-09 18:57:39 UTC
1-I mean None Latin Characters (Arabic) characters when they are inside <code> or they have space at the first of line they will render in rectangle shape at the normal case they are rendered correctly.

I added Latin characters to have better comparison.

2-as you said The section with space at start have to be Right-justified.
Comment 3 Brion Vibber 2011-11-11 01:52:30 UTC
Ah that makes sense -- <code> would typically trigger a fixed-width (monospaced) font, as would the preformatted sections (starting with space).

Probably the PDFs are rendering with a monospaced font that doesn't include Arabic characters and doesn't fall back to other fonts.
Comment 4 reza1615 2011-11-11 10:14:11 UTC
Thanks Brion, Now I can understand why it has problem also in first page (cover of book that uses higher height font).


as I understood for each language we needs more that 6 fonts (4 fonts for Normal,Bold,Italic,Bold-Italic) 2 fonts(monospaced,High Height Font).

To have better result in general for languages that they didn't define correct font,In my opinion it is better to define Normal-Font as default-Font for each cases doesn't have font definition.
Comment 5 Volker Haas 2011-11-14 09:14:56 UTC
(In reply to comment #4)
> Thanks Brion, Now I can understand why it has problem also in first page (cover
> of book that uses higher height font).

That problem was unrelated. I fixed it with https://github.com/pediapress/mwlib.rl/commit/4adfadd716af1e04f0631883a7dc8569a2294c09


> 
> 
> as I understood for each language we needs more that 6 fonts (4 fonts for
> Normal,Bold,Italic,Bold-Italic) 2 fonts(monospaced,High Height Font).

Currently font switching isn't done for monospaced fonts. Since we use GNU Freefont arabic glyphs can't be displayed: http://www.gnu.org/s/freefont/coverage.html

The easiest way to fix the monospace problem for arabic would probably be to add it to GNU Freefont.

> 
> To have better result in general for languages that they didn't define correct
> font,In my opinion it is better to define Normal-Font as default-Font for each
> cases doesn't have font definition.
Comment 6 reza1615 2011-11-15 14:30:47 UTC
Created attachment 9457 [details]
GNU Fonts with arabic characters

I uploaded GNU FreeFont with Arabic characters. I hope it will be useful.
I imported 
Nazli to mono (normal,Bold,Italic,BoldItalic)
Roya to Sans (normal,Bold,Italic,BoldItalic)
Roya to Serif (normal,Bold,Italic,BoldItalic)
Nazli and Roya both of the are under GNU LICENSE 
http://www.farsiweb.ir/wiki/Persian_fonts
Comment 7 reza1615 2011-11-15 14:31:33 UTC
Created attachment 9458 [details]
Sans
Comment 8 reza1615 2011-11-15 14:31:50 UTC
Created attachment 9459 [details]
serif
Comment 9 reza1615 2011-11-15 14:34:38 UTC
if that fonts are not useful in https://github.com/pediapress/mwlib.rl/commit/4adfadd716af1e04f0631883a7dc8569a2294c09 is it possible to add

pdfstyles.mono_font = arabic_font
Comment 10 Volker Haas 2012-02-29 13:19:12 UTC
I tried the above hack, but it doesn't help: the glyphs will be visible but the directionality remains broken.
Comment 11 reza1615 2012-06-13 19:56:28 UTC
for farsi and other languages that they have this bug is it possible to switch them to fonts that they use in <source>?
example
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf4
Comment 12 reza1615 2013-06-19 16:27:35 UTC
> Currently font switching isn't done for monospaced fonts. Since we use GNU
> Freefont arabic glyphs can't be displayed:
> http://www.gnu.org/s/freefont/coverage.html
> 
> The easiest way to fix the monospace problem for arabic would probably be to
> add it to GNU fonts
Please update font now it supports arabic for monospace
Comment 13 Andre Klapper 2013-09-20 15:25:08 UTC
(In reply to comment #12)
> Please update font now it supports arabic for monospace

reza1615: Comment 10 implied that there are problems with directionality. Could you elaborate who this is related (if it is)?
Comment 14 reza1615 2013-09-20 17:20:57 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Please update font now it supports arabic for monospace
> 
> reza1615: Comment 10 implied that there are problems with directionality.
> Could
> you elaborate who this is related (if it is)?

It was for  Comment 9 which was hack according to  Comment 5 it should work because Now freefont supports Arabic and Farsi.
Comment 15 reza1615 2014-01-10 08:55:34 UTC
Please update monospace Freefont. Now it supports Arabic font and this bug will solve! I asked this request many times in IRC and personal emails but no one care :(
Comment 16 Andre Klapper 2014-01-10 13:14:27 UTC
(In reply to comment #15)
> Please update monospace Freefont.

Please provide information about the "update", at least a link to download and ChangeLog.
Comment 17 reza1615 2014-01-10 13:24:37 UTC
here is the main_page
http://savannah.gnu.org/projects/freefont/

here is the coverage
http://www.gnu.org/software/freefont/coverage.html

here is the last release links (2012-05-03)
http://ftp.gnu.org/gnu/freefont/

It should update on the server which runs collection extension
Comment 18 Ralf Schmitt 2014-01-10 13:41:06 UTC
the pdf servers are going to be decomissioned in a few days and the pdf rendering software will be replaced. 

It's not going to happen.
Comment 19 Antoine "hashar" Musso (WMF) 2014-01-10 13:45:16 UTC
We can still get the new PDF servers to include the updated font.  The GNU Freefont is most probably installed using Ubuntu package ttf-freefont which is from 2010:

 $ apt-cache policy ttf-freefont
 ttf-freefont:
  Installed: (none)
  Candidate: 20100919-1
  Version table:
     20100919-1 0
        500 http://ubuntu.wikimedia.org/ubuntu/ precise/main amd64 Packages
 $


Ubuntu updated the package to 20120503 in their version Quantal. We could backport it to Precise and thus update the fonts.  Not sure whether the free font version 20120503 supports Arabic though :(
Comment 20 reza1615 2014-01-10 14:05:42 UTC
> Not sure whether the free
> font version 20120503 supports Arabic though :(

http://www.gnu.org/software/freefont/coverage.html

says that Freefonts  supports 212 Mono Arabic (character ranges)
Comment 21 Andre Klapper 2014-01-10 14:50:25 UTC
Comment 19 is about Ubuntu packages from Ubuntu, hence gnu.org does not matter in this case.
Comment 22 Antoine "hashar" Musso (WMF) 2014-01-10 14:53:03 UTC
The page at http://www.gnu.org/software/freefont/coverage.html list Arabic has being supported and has been generated on 02:14:54 PM 04/29/2012 CEST.

So I guess we can get the package backported.
Comment 23 reza1615 2014-10-03 03:55:55 UTC
Thanks for new version.
Comment 24 Andre Klapper 2014-10-03 08:07:17 UTC
reza1615: Please do state explicitly what you have retested a bug report and if the new OCG setup works for you and does not expose the problem anymore. 
"Thanks for new version" is a bit too interpretable and reading this comment in one year, people won't understand what "new version" you meant. Thanks :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links