Bug 92461 - Font fallback does not work with GTK3
Summary: Font fallback does not work with GTK3
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-30 20:16 UTC by Khaled Hosny (inactive)
Modified: 2016-10-25 19:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document (9.00 KB, application/vnd.oasis.opendocument.text)
2015-06-30 20:16 UTC, Khaled Hosny (inactive)
Details
GTK2 rendering (32.48 KB, image/png)
2015-06-30 20:27 UTC, Khaled Hosny (inactive)
Details
GTK3 rendering (31.67 KB, image/png)
2015-06-30 20:33 UTC, Khaled Hosny (inactive)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khaled Hosny (inactive) 2015-06-30 20:16:40 UTC
Created attachment 116956 [details]
Test document

The font fallback for characters not supported by the current font does not seem to work with GTK3 VCL “plugin” (I didn’t even know that the choice of the graphics toolkit has effect on this). Font fallback works again when forcing GTK2 plugin (by setting SAL_USE_VCLPLUGIN=gtk).
Comment 1 Khaled Hosny (inactive) 2015-06-30 20:27:53 UTC
Created attachment 116957 [details]
GTK2 rendering
Comment 2 Khaled Hosny (inactive) 2015-06-30 20:33:26 UTC
Created attachment 116958 [details]
GTK3 rendering

Notice how the Arabic characters in the middle of the are renders as random Latin glyphs, and how the English in the status bar is rendered as random Arabic characters (my UI font is an Arabic fonts with no Latin support so font fallback is happening here, too).

My guess is that font fallback is happening but at the time of rendering the original font is used for the drawing the glyphs and the random glyphs are result from using glyph ids from the fallback font with the original one. This can possibly lead to crashes as well when using a glyph id from from the fallback font that is bigger than the number of glyphs in the original font.
Comment 3 Commit Notification 2015-07-01 16:05:28 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f4f844952f1213283133fc848b0781bb0ce3bb53

Resolves: tdf#92461 fix font fallback in headless text renderer

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2015-07-01 16:06:59 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=77552ecfb6501e856b4a400f19f4e25cfd2b63c4&h=libreoffice-5-0

Resolves: tdf#92461 fix font fallback in headless text renderer

It will be available in 5.0.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.