Bug 87535 - Styles-dropdown preview always uses “Western” font
Summary: Styles-dropdown preview always uses “Western” font
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
4.3.4.1 release
Hardware: Other All
: medium normal
Assignee: خالد حسني
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-20 20:33 UTC by خالد حسني
Modified: 2022-09-22 09:55 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Test document (10.30 KB, application/vnd.oasis.opendocument.text)
2014-12-20 20:33 UTC, خالد حسني
Details

Note You need to log in before you can comment on or make changes to this bug.
Description خالد حسني 2014-12-20 20:33:24 UTC
Created attachment 111087 [details]
Test document

The Styles-dropdown preview always uses the “Western” font even if the previwed text is CTL text. For example, the attached document have a single word set in a style that uses “DejaVu Serif” for Western text and “DejaVu Sans” for CTL text, the preview contains Arabic text (when using Arabic interface) but it will use “DejaVu Serif” not “DejaVu Sans” and thus does not reflect the actual effect of applying this style to Arabic text.
Comment 1 Adolfo Jayme Barrientos 2014-12-20 21:40:57 UTC
Thanks, marking as NEW.
Comment 2 خالد حسني 2014-12-20 22:14:33 UTC
This is apparently because in https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=svx/source/tbxctrls/tbcontrl.cxx;hb=HEAD#l589 only SID_ATTR_CHAR_FONT is used, bit not SID_ATTR_CHAR_CTL_FONT nor SID_ATTR_CHAR_CJK_FONT. Apparently OutputDevice takes only one font, so it probably does not do script itemization, but I’m not sure what is the proper way to handle the itemization.
Comment 3 QA Administrators 2016-01-17 20:03:24 UTC Comment hidden (noise)
Comment 4 Jan Holesovsky 2016-01-18 06:57:32 UTC
Khaled: IIRC there is now some style preview in the sidebar too.  Please does the style preview in the sidebar render this correctly?  If yes, I suppose we should just share the code here with what is in the sidebar :-)
Comment 5 خالد حسني 2016-01-28 17:02:49 UTC
(In reply to Jan Holesovsky from comment #4)
> Khaled: IIRC there is now some style preview in the sidebar too.  Please
> does the style preview in the sidebar render this correctly?  If yes, I
> suppose we should just share the code here with what is in the sidebar :-)

The sidebar in 5.0 shows the same behaviour reported here, I can’t test on master right now. I suspect the same problem in comment 2 is the cause here.
Comment 6 QA Administrators 2017-03-06 14:08:35 UTC Comment hidden (noise, obsolete)
Comment 7 QA Administrators 2019-12-03 14:27:52 UTC Comment hidden (noise)
Comment 8 QA Administrators 2021-12-03 04:33:27 UTC Comment hidden (noise)
Comment 9 Commit Notification 2022-08-22 13:45:23 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/044fc5c8b225732d57970d3bf0720c13a5a9e0a4

tdf#87535: Preview styles using CTL/CJK fonts in the styles menu

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2022-08-22 13:45:31 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0483fbd1d05d74c394d9274bdee77b3b2aebb495

tdf#87535: Preview styles using CTL/CJK fonts in the sidebar

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.