Description of problem: Currently we are changing default Chinese fonts for Fedora 28. URL: https://fedoraproject.org/wiki/Changes/ChineseDefaultFontsToNoto But we find a problem with hexchat rendering, some glyph in the end of the line can't be rendered. Actually we prepend "DejaVu Sans Mono" in fontconfig in the past, the problem can be work around. Maybe good to fix it in the hexchat without the work around in fontconfig. Version-Release number of selected component (if applicable): hexchat-2.12.4-8.fc27 How reproducible: Make the google-noto-cjk-fonts default Chinese fonts in Fedora 27 like below, or maybe test it in Fedora rawhide after the Changes landed in Fedora 28. Remove the following fonts: adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts adobe-source-han-sans-tw-fonts adobe-source-han-serif-tw-fonts Install the following fonts: google-noto-sans-cjk-sc-fonts google-noto-sans-cjk-tc-fonts google-noto-sans-mono-cjk-sc-fonts google-noto-sans-mono-cjk-tc-fonts google-noto-serif-cjk-sc-fonts google-noto-serif-cjk-tc-fonts Rename the below files in /etc/fonts/conf.d: 66-google-noto-sans-cjk-sc.conf 66-google-noto-sans-cjk-tc.conf 66-google-noto-sans-mono-cjk-sc.conf 66-google-noto-sans-mono-cjk-tc.conf 66-google-noto-serif-cjk-sc.conf 66-google-noto-serif-cjk-tc.conf To: 65-0-google-noto-sans-cjk-sc.conf 65-0-google-noto-sans-cjk-tc.conf 65-0-google-noto-sans-mono-cjk-sc.conf 65-0-google-noto-sans-mono-cjk-tc.conf 65-0-google-noto-serif-cjk-sc.conf 65-0-google-noto-serif-cjk-tc.conf Steps to Reproduce: 1. make google-noto-cjk-fonts default Chinese fonts as above 2. run fc-cache 3. launch hexchat Actual results: Some glyph can't be displayed at the end of the line. Expected results: All glyph are displayed correctly. Additional info:
Created attachment 1383132 [details] screenshot of the bounding box problem
Created attachment 1383133 [details] screenshot after the patch applied
Created attachment 1383134 [details] draft patch for fixing the bounding box problem
Created attachment 1383135 [details] after applied the previous patch, the fontwidths variable seems can be removed
That is a very significant decrease in performance, the better question is why would the width of a glyph ever change at runtime?
The simple answer for that is, the targeted characters to render is changed at runtime and pango uses proper fonts against it which may has different width. pango do the right thing even though they takes disadvantage in performance. xchat/hexchat do something faster but behaves wrongly because of wrong assumption. that's it.
Comment on attachment 1383134 [details] draft patch for fixing the bounding box problem This causes a new warning: (hexchat:17070): Gdk-CRITICAL **: _gdk_pixmap_new: assertion '(width != 0) && (height != 0)' failed This is in `gtk_xtext_render_flush` where `str_width` is now `0`.
I think pango support multiple languages in one document. I suspect that the fontwidths is computed with Chinese font, but when pango detect English words, it will switch to use English font. I applied both patches for testing, and launched hexchat from gnome-terminal, but not find the warning. How to reproduce that warning?
(In reply to Peng Wu from comment #8) > I applied both patches for testing, and launched hexchat from gnome-terminal, > but not find the warning. > How to reproduce that warning? Scrolling up and down an active channel.
Sorry, I still can't reproduce that warning on Fedora 27. I tried Fedora 27 rpm and github hexchat repo. Could you help me on reproducing it?
Ok so in trying to reproduce it today I cannot so it seems the problematic line is out of my history sadly. Testing this patch on Windows the performance of the application is unusable and it takes over a minute to open the application so as-is this cannot make it upstream. A simple `#ifdef G_OS_WIN32` around the changed logic could perhaps be acceptable.
Created attachment 1386477 [details] updated patch for fixing the bounding box problem
Thanks for the review! :) I updated the patch to only change the code on non-Windows. BTW, it seems the fontwidths variable is only used on Windows. Is it okay to also use `#ifdef G_OS_WIN32` for the fontwidths variable?
Created attachment 1386506 [details] updated patch for fixing the bounding box problem
(In reply to Peng Wu from comment #13) > Thanks for the review! :) > > I updated the patch to only change the code on non-Windows. > > BTW, it seems the fontwidths variable is only used on Windows. > Is it okay to also use `#ifdef G_OS_WIN32` for the fontwidths variable? Yes please do to avoid compiler warnings.
Created attachment 1389369 [details] updated patch for fixing the bounding box problem
I have commited this upstream: https://github.com/hexchat/hexchat/commit/d3f1ab78138a1f9256ec02842799ed6cd1e3ec1e I will try to get around to adding it to the Fedora package soon.
Thanks for the review! :)
hexchat-2.14.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-30b9e6c8c9
hexchat-2.14.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2d8ce03c84
hexchat-2.14.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-30b9e6c8c9
hexchat-2.14.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2d8ce03c84
So this patch ended up being reverted as bug 1554263 shows the performance impact is just to much to be usable.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.