Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1657479

Summary: freetype 2.8.0 hinting fails in monochrome mode
Product: Red Hat Enterprise Linux 7 Reporter: Theodric Young <redhatbugz>
Component: freetypeAssignee: Marek Kašík <mkasik>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: bgollahe, dbasant, mboisver
Target Milestone: rc   
Target Release: 7.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: freetype-2.8-14.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:02:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1656436    
Attachments:
Description Flags
C source code for rendering TrueType fonts with freetype and gd none

Description Theodric Young 2018-12-08 18:31:33 UTC
Created attachment 1512806 [details]
C source code for rendering TrueType fonts with freetype and gd

Description of problem:

I use FreeType in conjunction with the gd image libraries to draw maps. 
With the recent upgrade to RHEL 7.6, the font rendering on my maps 
started to look terrible.  Apparently, there is a bug in FreeType 
version 2.8.0 where hinting is not being applied properly when TrueType
fonts are rendered in monochrome mode.  This is documented in the 
release notes for FreeType version 2.8.1: 
https://sourceforge.net/projects/freetype/files/freetype2/2.8.1/

It seems that the previous version of FreeType on my system (2.4.11) 
did not have this issue, but as of Nov. 4, when FreeType was upgraded to
version 2.8.0, as part of the normal package update, the font rendering
broke and now looks terrible.

Please see http://theodric.com/freetype_bug to view images that 
show font rendering in monochrome mode using FreeType versions 
2.8.0 and 2.8.1.  Clearly the 2.8.1 fonts look much better.  I've 
attached the source code for creating these font images.

Version-Release number of selected component (if applicable):

FreeType 2.8.0

How reproducible:

Appears to be consistent when rendering TrueType fonts in monochrome (1-bit color) mode.

Steps to Reproduce:

1. Compile the attached file (test_ft.c) on a system running RHEL 7.6
with gcc.  Note that the freetype-devel, gd-devel and gcc packages
must be installed.  At least one TrueType font is needed.  It can be
compiled with:  

  gcc -g -Wall test_ft.c -I/usr/include/freetype2 -lfreetype -lgd -o test_ft

2. Run the program as "test_ft font.ttf imagename.png". The first parameter
is the path to a TrueType font file.  The second parameter is the path
to where a PNG image file will be created.  Note that the program will
print out the currently installed version of FreeType.

3. Observe the created image file and determine if the font hinting 
is working properly.  The "w" characters look particularly terrible 
if the hinting is not working.  There will also be inconsistencies 
in line widths.

Actual results:

See the images at http://theodric.com/freetype_bug , which were created with:
./test_ft arial.ttf ft_test_arial_2.8.0.png
./test_ft cour.ttf ft_test_cour_2.8.0.png
./test_ft pala.ttf ft_test_pala_2.8.0.png

Note that the rendered fonts in the attached images look pretty
bad; many of the characters appear deformed and lines are inconsistent
widths.

Expected results:

If you upgrade the FreeType library to version 2.8.1, the hinting
works properly.  Please observe the following images at
http://theodric.com/freetype_bug/ that were created with
FreeType version 2.8.1:

ft_test_arial_2.8.1.png
ft_test_cour_2.8.1.png
ft_test_pala_2.8.1.png

The characters in these images look pretty good, even at small font
sizes.  Lines are consistent widths, and characters look about as 
good as one can expect for each font size.

Additional info:

Comment 2 Marek Kašík 2018-12-10 17:53:39 UTC
Thank you for this report. It seems that we need to backport this commit to fix this issue:

http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=a0455468fdb8dd1959596d0c8c8a3ff07ee495a3

Maybe also this one:

http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=24e256ab005c68a3894845ef3b7764338f9442a4

I'm proposing to fix this in next update.

Comment 6 errata-xmlrpc 2019-08-06 12:02:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2021