Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 547870 - media-libs/freetype: remove "auto-hinter" USE flag
Summary: media-libs/freetype: remove "auto-hinter" USE flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-27 07:05 UTC by Ari Entlich
Modified: 2015-10-21 09:23 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ari Entlich 2015-04-27 07:05:36 UTC
In the freetype ebuild, the auto-hinter USE flag's primary effect is this:

if use auto-hinter; then
        disable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER
        enable_option TT_CONFIG_OPTION_UNPATENTED_HINTING
fi

There are multiple problems with this. First of all, TT_CONFIG_OPTION_UNPATENTED_HINTING does not control the autohinter. It enables a subset of the full truetype hinter that did not violate patents but was required for correct rendering of some fonts.[1] Freetype's actual autohinter is implemented in the src/autofit directory[2], and it does not appear to me that it can easily be fully disabled.

So, the flag is misnamed. In addition, the code that it enables has been obsolete and deprecated for almost 5 years.[1] It is irresponsible to give the user the ability to enable this crippled code, especially under a misleading name. I'm honestly confused why freetype still includes this code.

However, these two issues would only be annoyances if it were not for this third issue. When the harfbuzz USE flag was added to the ebuild, the following line was also added:

REQUIRED_USE="harfbuzz? ( auto-hinter )"

...presumably due to a note in the project's INSTALL.UNIX file[3]. Now, the first issue with this is that the maintainer presumably did not even check that enabling the harfbuzz flag without the auto-hinter flag would actually cause a failure. If they had checked this, they would have encountered no such failure. I guess they just read the INSTALL.UNIX file and made an assumption. Even if the auto-hinter flag did control freetype's autohinter, the most that this combinations of flags should have resulted in is a warning that the harfbuzz flag is a no-op.

However, the "auto-hinter" referred to in the INSTALL.UNIX file is freetype's ACTUAL autohinter, not the unpatented bytecode hinter. Therefore, the harfbuzz and "auto-hinter" USE flags are completely unrelated and should not be linked in this way. The above REQUIRED_USE line makes it impossible to enable harfbuzz support and disable the unpatented hinter, which is a valid configuration.

To conclude: the "auto-hinter" USE flag is misnamed, enables obsolete and deprecated behavior, and is a source of confusion for the maintainers of the freetype ebuild. It needs to go.

[1] http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/config/ftoption.h?id=VER-2-5-5#n610
[2] http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/autofit?id=VER-2-5-5
[3] http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/INSTALL.UNIX?id=VER-2-5-5#n85

Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2015-06-11 13:32:11 UTC
+*freetype-2.6 (11 Jun 2015)
+
+  11 Jun 2015; Lars Wendler <polynomial-c@gentoo.org> +freetype-2.6.ebuild:
+  Version bump. Removed auto-hinter USE flag as an attempt to fix bug #547870.
+
Comment 2 stshine 2015-07-05 11:53:09 UTC
God finally my font shape and layout seems reasonable. Thank you  Ari Entlich