Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 809611 - x11-terms/zutty incompatibility with freetype-2.11.0
Summary: x11-terms/zutty incompatibility with freetype-2.11.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Smith
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2021-08-22 17:40 UTC by Matthew Smith
Modified: 2021-08-29 18:33 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info x11-terms/zutty media-libs/freetype (emerge-info.txt,6.74 KB, text/plain)
2021-08-22 17:40 UTC, Matthew Smith
Details
freetype 2.11 patch (zutty-0.9-freetype-2.11.patch,795 bytes, patch)
2021-08-29 16:53 UTC, Stephan Hartmann (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Smith gentoo-dev 2021-08-22 17:40:27 UTC
Created attachment 735094 [details]
emerge --info x11-terms/zutty media-libs/freetype

With media-libs/freetype-2.11.0, Zutty fails to launch:

    terminate called after throwing an instance of 'std::runtime_error'
      what():  FreeType: Failed to render glyph for char 32
    Aborted

Seems to happen with any font.
Comment 1 Stephan Hartmann (RETIRED) gentoo-dev 2021-08-29 16:53:34 UTC
Created attachment 736663 [details, diff]
freetype 2.11 patch

The problem seems to be that the glyph format is already a bitmap. Attached patch checks this before calling FT_Render_Glyph(). zutty doesn't crash anymore, but I'm not sure if it is correct.
Comment 2 Stephan Hartmann (RETIRED) gentoo-dev 2021-08-29 17:18:06 UTC
This also seems to solve the referenced upstream issue ;)
Comment 3 Matthew Smith gentoo-dev 2021-08-29 17:26:50 UTC
Hey, thank you very much for this!  It seems to be working great both with Freetype 2.10.4 and 2.11.0-r1.

Would you like to submit the patch upstream?
Comment 4 Stephan Hartmann (RETIRED) gentoo-dev 2021-08-29 18:01:15 UTC
I debugged a bit further: zutty loads the char with FT_LOAD_RENDER:
  https://github.com/tomszilagyi/zutty/blob/master/src/font.cc#L251
That means, FT_Render_Glyph is also called (https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_load_render). Therefore calling FT_Render_Glyph() within zutty is redundant.
Comment 5 Larry the Git Cow gentoo-dev 2021-08-29 18:33:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10cc462e684d5aa4b10e1f39d09849401e01f971

commit 10cc462e684d5aa4b10e1f39d09849401e01f971
Author:     Matt Smith <matt@offtopica.uk>
AuthorDate: 2021-08-29 17:26:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-08-29 18:33:07 +0000

    x11-terms/zutty: Compatibility with >=media-libs/freetype-2.11.0
    
    Closes: https://bugs.gentoo.org/809611
    Package-Manager: Portage-3.0.22, Repoman-3.0.3
    Signed-off-by: Matt Smith <matt@offtopica.uk>
    Closes: https://github.com/gentoo/gentoo/pull/22150
    Signed-off-by: Sam James <sam@gentoo.org>

 .../zutty/files/zutty-0.9-freetype-2.11.0.patch    | 35 ++++++++++++++++++++++
 x11-terms/zutty/zutty-0.9-r1.ebuild                | 35 ++++++++++++++++++++++
 2 files changed, 70 insertions(+)