Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1536298 - Draft patch for the hexchat bounding box issue
Summary: Draft patch for the hexchat bounding box issue
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: hexchat
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Patrick Griffis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-19 04:48 UTC by Peng Wu
Modified: 2018-11-30 20:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 20:25:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot of the bounding box problem (deleted)
2018-01-19 04:57 UTC, Peng Wu
no flags Details
screenshot after the patch applied (deleted)
2018-01-19 04:59 UTC, Peng Wu
no flags Details
draft patch for fixing the bounding box problem (deleted)
2018-01-19 05:00 UTC, Peng Wu
no flags Details | Diff
after applied the previous patch, the fontwidths variable seems can be removed (deleted)
2018-01-19 05:04 UTC, Peng Wu
no flags Details | Diff
updated patch for fixing the bounding box problem (deleted)
2018-01-26 06:26 UTC, Peng Wu
no flags Details | Diff
updated patch for fixing the bounding box problem (deleted)
2018-01-26 08:55 UTC, Peng Wu
no flags Details | Diff
updated patch for fixing the bounding box problem (deleted)
2018-02-01 07:32 UTC, Peng Wu
no flags Details | Diff

Description Peng Wu 2018-01-19 04:48:58 UTC
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:

Comment 1 Peng Wu 2018-01-19 04:57:57 UTC
Created attachment 1383132 [details]
screenshot of the bounding box problem

Comment 2 Peng Wu 2018-01-19 04:59:18 UTC
Created attachment 1383133 [details]
screenshot after the patch applied

Comment 3 Peng Wu 2018-01-19 05:00:27 UTC
Created attachment 1383134 [details]
draft patch for fixing the bounding box problem

Comment 4 Peng Wu 2018-01-19 05:04:52 UTC
Created attachment 1383135 [details]
after applied the previous patch, the fontwidths variable seems can be removed

Comment 5 Patrick Griffis 2018-01-19 08:46:46 UTC
That is a very significant decrease in performance, the better question is why would the width of a glyph ever change at runtime?

Comment 6 Akira TAGOH 2018-01-19 09:18:58 UTC
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 7 Patrick Griffis 2018-01-19 09:40:03 UTC
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`.

Comment 8 Peng Wu 2018-01-22 07:00:37 UTC
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?

Comment 9 Patrick Griffis 2018-01-22 21:09:16 UTC
(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.

Comment 10 Peng Wu 2018-01-23 06:23:44 UTC
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?

Comment 11 Patrick Griffis 2018-01-25 18:46:18 UTC
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.

Comment 12 Peng Wu 2018-01-26 06:26:58 UTC
Created attachment 1386477 [details]
updated patch for fixing the bounding box problem

Comment 13 Peng Wu 2018-01-26 06:30:51 UTC
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?

Comment 14 Peng Wu 2018-01-26 08:55:51 UTC
Created attachment 1386506 [details]
updated patch for fixing the bounding box problem

Comment 15 Patrick Griffis 2018-01-31 23:18:54 UTC
(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.

Comment 16 Peng Wu 2018-02-01 07:32:08 UTC
Created attachment 1389369 [details]
updated patch for fixing the bounding box problem

Comment 17 Patrick Griffis 2018-02-06 22:08:35 UTC
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.

Comment 18 Peng Wu 2018-02-07 04:49:14 UTC
Thanks for the review! :)

Comment 19 Fedora Update System 2018-03-11 16:34:48 UTC
hexchat-2.14.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-30b9e6c8c9

Comment 20 Fedora Update System 2018-03-11 16:35:03 UTC
hexchat-2.14.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2d8ce03c84

Comment 21 Fedora Update System 2018-03-11 18:48:35 UTC
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

Comment 22 Fedora Update System 2018-03-11 21:00:42 UTC
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

Comment 23 Patrick Griffis 2018-03-15 22:55:50 UTC
So this patch ended up being reverted as bug 1554263 shows the performance impact is just to much to be usable.

Comment 24 Ben Cotton 2018-11-27 16:37:26 UTC
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.

Comment 25 Ben Cotton 2018-11-30 20:25:54 UTC
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.


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