Bug 93168

Summary: Some math symbols are rendered incorrectly
Product: poppler Reporter: antti <antti.niemi>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Sample PDF file
Add SymbolMT as an alias for the Symbol font

Description antti 2015-11-29 22:13:42 UTC
Created attachment 120200 [details]
Sample PDF file

Some math symbols are rendered incorrectly. Sample PDF file attached, see page 15, for example.

Tested on:

Okular 0.23.2 + poppler 0.37.0-1 on Arch Linux
Okular 0.19.13 + unknown poppler version on Ubuntu
Evince 3.10.3 + unknown poppler version on Ubuntu


PDF X-Change Viewer on Windows renders everything correctly.
Comment 1 Jason Crain 2016-01-19 04:30:31 UTC
Created attachment 121126 [details]
Add SymbolMT as an alias for the Symbol font

The document uses a font named SymbolMT that, as far as I can tell, is just another name for the Symbol font.  Patch adds SymbolMT as an alias for Symbol.
Comment 2 Albert Astals Cid 2016-01-24 12:23:59 UTC
SymbolMT is a different font, I'm really not very happy of adding things here, this is something people should configure in their fontconfigs, no?
Comment 3 Jason Crain 2016-01-28 08:34:31 UTC
(In reply to Albert Astals Cid from comment #2)
> SymbolMT is a different font, I'm really not very happy of adding things
> here, this is something people should configure in their fontconfigs, no?

I don't think it's a different font, because
  * The rendering in Adobe Reader, mupdf, and Sumatra are exactly the same for Symbol vs. SymbolMT, despite me not having any font called SymbolMT installed.
  * There are already MT aliases for a few other fonts in the base14FontMap array.
  * There's also some code in SysFontList::find which removes a trailing MT from the font name for looking up cached font info.
Comment 4 Carlos Garcia Campos 2016-02-27 08:29:35 UTC
This looks good to me, Albert, any objection to push this patch?
Comment 5 Albert Astals Cid 2016-02-27 11:34:34 UTC
I personally don't like patches for non embedded fonts much, but if you think it makes sense, i won't block you commiting it :)
Comment 6 Jason Crain 2016-03-20 23:13:46 UTC
I just realized I should have mentioned that a fontconfig change wouldn't fix this.  An important point of this patch is that it makes the font use the symbol encoding.  If just fontconfig is changed to match SymbolMT to Symbol, it would still use the wrong encoding and would draw a wrong character.
Comment 7 Carlos Garcia Campos 2016-04-02 10:46:33 UTC
I think it's definitely worth it, it's a simple patch that fixes the rendering and doesn't seem to introduce any regression, so I've just pushed it.
Comment 8 Stephen E. 2016-06-08 19:00:33 UTC
Since fontconfig can't address this, is there a recommended workaround for afflicted users stuck on older Poppler versions for a while? Thanks!
Comment 9 Jason Crain 2016-06-08 19:20:54 UTC
(In reply to Stephen E. from comment #8)
> Since fontconfig can't address this, is there a recommended workaround for
> afflicted users stuck on older Poppler versions for a while? Thanks!

Apply the patch and recompile.  Or pester your distro to do that for you.

Though honestly, since I don't know what document you're having a problem with, I wouldn't bet on this patch fixing it.  There's a lot that can go wrong with PDFs.  Does running "pdffonts" on your PDF show it using a SymbolMT font?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.