Bug#932900: buster-pu: package freetype 2.9.1-4
Package: release.debian.org
Severity: normal
Tags: patch
Hello,
FreeType versions 2.9 to 2.10.1 have rendering problems with variable hinted
fonts. In specific cases, such as with the Oswald typeface, glyphs do not scale
correctly and end up appearing on top of each other.
This bug affects Chromium 76 and later versions, as that browser uses FreeType
for variable hinted fonts. Firefox is also affected.
Google Fonts states that Oswald is used on 8.3M websites.
Given that Chromium and Firefox are affected, and the significant presence of
variable hinted fonts in use on the internet and elsewhere, I am requesting
freetype 2.9.1-4 be considered for the next point release of Buster.
A debdiff is attached.
Hugh
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-5-amd64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru freetype-2.9.1/debian/changelog freetype-2.9.1/debian/changelog
--- freetype-2.9.1/debian/changelog 2018-11-22 21:15:00.000000000 +1100
+++ freetype-2.9.1/debian/changelog 2019-07-24 23:15:52.000000000 +1000
@@ -1,3 +1,13 @@
+freetype (2.9.1-4) stable; urgency=medium
+
+ * debian/control:
+ - Demote Recommends: freetype2-doc to Suggests (Closes: #919284).
+ * debian/patches:
+ - Add an upstream patch to properly handle phantom points for variable
+ hinted fonts (Closes: #932303).
+
+ -- Hugh McMaster <hugh.mcmaster@outlook.com> Wed, 24 Jul 2019 23:15:52 +1000
+
freetype (2.9.1-3) unstable; urgency=medium
* Release to unstable.
diff -Nru freetype-2.9.1/debian/control freetype-2.9.1/debian/control
--- freetype-2.9.1/debian/control 2018-09-24 23:32:42.000000000 +1000
+++ freetype-2.9.1/debian/control 2019-07-24 23:15:38.000000000 +1000
@@ -48,7 +48,7 @@
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: libfreetype6 (= ${binary:Version}), libc6-dev | libc-dev, zlib1g-dev | libz-dev, libpng-dev, ${misc:Depends}
-Recommends: freetype2-doc (= ${binary:Version})
+Suggests: freetype2-doc (= ${binary:Version})
Description: FreeType 2 font engine, development files
The FreeType project is a team of volunteers who develop free,
portable and high-quality software solutions for digital typography.
diff -Nru freetype-2.9.1/debian/patches/scale-phantom-points.patch freetype-2.9.1/debian/patches/scale-phantom-points.patch
--- freetype-2.9.1/debian/patches/scale-phantom-points.patch 1970-01-01 10:00:00.000000000 +1000
+++ freetype-2.9.1/debian/patches/scale-phantom-points.patch 2019-07-24 23:15:44.000000000 +1000
@@ -0,0 +1,50 @@
+Description: Properly handle phantom points for variable hinted fonts
+ Scale phantom points if HVAR and/or VVAR is present.
+Author: Ben Wagner <bungeman@google.com>
+Bug-Debian: http://bugs.debian.org/932303
+Forwarded: not-needed
+Last-Update: 2019-07-22
+
+--- a/src/truetype/ttgload.c
++++ b/src/truetype/ttgload.c
+@@ -1040,9 +1040,16 @@
+ }
+
+ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+- /* if we have a HVAR table, `pp1' and/or `pp2' are already adjusted */
+- if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ||
+- !IS_HINTED( loader->load_flags ) )
++ /* if we have a HVAR table, `pp1' and/or `pp2' */
++ /* are already adjusted but unscaled */
++ if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) &&
++ IS_HINTED( loader->load_flags ) )
++ {
++ loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
++ loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
++ /* pp1.y and pp2.y are always zero */
++ }
++ else
+ #endif
+ {
+ loader->pp1 = outline->points[n_points - 4];
+@@ -1050,9 +1057,17 @@
+ }
+
+ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+- /* if we have a VVAR table, `pp3' and/or `pp4' are already adjusted */
+- if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ||
+- !IS_HINTED( loader->load_flags ) )
++ /* if we have a VVAR table, `pp3' and/or `pp4' */
++ /* are already adjusted but unscaled */
++ if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) &&
++ IS_HINTED( loader->load_flags ) )
++ {
++ loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );
++ loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
++ loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );
++ loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
++ }
++ else
+ #endif
+ {
+ loader->pp3 = outline->points[n_points - 2];
diff -Nru freetype-2.9.1/debian/patches/series freetype-2.9.1/debian/patches/series
--- freetype-2.9.1/debian/patches/series 2018-09-24 23:32:42.000000000 +1000
+++ freetype-2.9.1/debian/patches/series 2019-07-24 23:15:44.000000000 +1000
@@ -1,3 +1,4 @@
+scale-phantom-points.patch
no-uninitialized-bbox.patch
enable-subpixel-rendering.patch
enable-gxvalid-otvalid.patch
Reply to: