summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Bos2018-02-02 15:21:53 +0000
committerCharles Bos2018-02-02 15:21:53 +0000
commit969a06dfe1e2c67d8b00738181dbf45adeaa7a89 (patch)
tree39ce36a50a5f6ed31775e2b69953b6e0f05300ce
parentf0d87f1652f8e8972f016eeb06d5a30565f3b7cd (diff)
downloadaur-969a06dfe1e2c67d8b00738181dbf45adeaa7a89.tar.gz
Replace revert_allow_linear_scaling.patch with an equivalent patch from freebsd. this fixes crashes with mpv
-rw-r--r--.SRCINFO6
-rw-r--r--0002-ttf-assign-ttf-metrics-to-face-metrics.patch30
-rw-r--r--PKGBUILD12
-rw-r--r--fix_metrics_on_size_request.patch41
-rw-r--r--revert_allow_linear_scaling.patch55
5 files changed, 82 insertions, 62 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 77f88f54b975..786d962670aa 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = freetype2-ttmetrics
pkgdesc = Font rasterization library with TrueType metrics enabled
pkgver = 2.9
- pkgrel = 2
+ pkgrel = 3
url = https://www.freetype.org/
install = freetype2.install
arch = i686
@@ -24,7 +24,7 @@ pkgbase = freetype2-ttmetrics
source = 0001-psaux-Correctly-handle-Flex-features-52846.patch
source = freetype2.sh
source = enable_truetype_like_size_metrics.patch
- source = revert_allow_linear_scaling.patch
+ source = fix_metrics_on_size_request.patch
sha1sums = 94c4399b1a55c5892812e732843fcb4a7c2fe657
sha1sums = b69531770c343d403be294b7e4d25ac45738c833
sha1sums = 3d26a569f0cb94c28a550577f5dcaadb4e193d91
@@ -32,7 +32,7 @@ pkgbase = freetype2-ttmetrics
sha1sums = 21ad7dd31e16adb5b39adfa5671018a736626562
sha1sums = bc6df1661c4c33e20f5ce30c2da8ad3c2083665f
sha1sums = 833a8622bc61fc6f41c0e87c3614dec73490c9b1
- sha1sums = f2cc372aedce56b387ee0c5403745d642bd44fe8
+ sha1sums = fcb6e379591f06793d4e081f8a9ea7731b484478
pkgname = freetype2-ttmetrics
diff --git a/0002-ttf-assign-ttf-metrics-to-face-metrics.patch b/0002-ttf-assign-ttf-metrics-to-face-metrics.patch
new file mode 100644
index 000000000000..a1651b6b0dbb
--- /dev/null
+++ b/0002-ttf-assign-ttf-metrics-to-face-metrics.patch
@@ -0,0 +1,30 @@
+From ef93a2bd34c1e569897303b5858d4f39c037d75b Mon Sep 17 00:00:00 2001
+From: Daniel Hirt <hirt.danny@gmail.com>
+Date: Tue, 11 Jul 2017 21:50:35 +0300
+Subject: [PATCH 2/2] [ttf] assign ttf metrics to face metrics
+
+This got dropped by bcc74f4dafee25ea89f1d3144646cba7e30f9908.
+It has caused a regression with when doing basic reading of metrics,
+for example with the following:
+ft.face->size->metrics.ascender
+
+Values calculated from v2.8 and up are different than previous versions.
+---
+ src/truetype/ttdriver.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
+index a1653b24..5d8ece46 100644
+--- a/src/truetype/ttdriver.c
++++ b/src/truetype/ttdriver.c
+@@ -357,6 +357,7 @@
+ if ( FT_IS_SCALABLE( size->face ) )
+ {
+ error = tt_size_reset( ttsize, 0 );
++ ttsize->root.metrics = *ttsize->metrics;
+
+ #ifdef TT_USE_BYTECODE_INTERPRETER
+ /* for the `MPS' bytecode instruction we need the point size */
+--
+2.13.2
+
diff --git a/PKGBUILD b/PKGBUILD
index 561e170131df..356c05023fff 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=freetype2-ttmetrics
_srcname=freetype
pkgver=2.9
-pkgrel=2
+pkgrel=3
pkgdesc="Font rasterization library with TrueType metrics enabled"
arch=(i686 x86_64)
license=('GPL')
@@ -24,7 +24,7 @@ source=(https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${pk
0001-psaux-Correctly-handle-Flex-features-52846.patch
freetype2.sh
enable_truetype_like_size_metrics.patch
- revert_allow_linear_scaling.patch)
+ fix_metrics_on_size_request.patch)
sha1sums=('94c4399b1a55c5892812e732843fcb4a7c2fe657'
'b69531770c343d403be294b7e4d25ac45738c833'
'3d26a569f0cb94c28a550577f5dcaadb4e193d91'
@@ -32,7 +32,7 @@ sha1sums=('94c4399b1a55c5892812e732843fcb4a7c2fe657'
'21ad7dd31e16adb5b39adfa5671018a736626562'
'bc6df1661c4c33e20f5ce30c2da8ad3c2083665f'
'833a8622bc61fc6f41c0e87c3614dec73490c9b1'
- 'f2cc372aedce56b387ee0c5403745d642bd44fe8')
+ 'fcb6e379591f06793d4e081f8a9ea7731b484478')
prepare() {
cd ${_srcname}-${pkgver}
@@ -48,8 +48,12 @@ prepare() {
# ttmetrics patches
# see https://bbs.archlinux.org/viewtopic.php?id=226380
+ #
+ # with thanks to the freebsd developers for the second patch,
+ # see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219608 and
+ # https://bugs.freebsd.org/bugzilla/attachment.cgi?id=183997&action=diff
patch -Np1 -i ../enable_truetype_like_size_metrics.patch
- patch -Np1 -i ../revert_allow_linear_scaling.patch
+ patch -Np1 -i ../fix_metrics_on_size_request.patch
}
build() {
diff --git a/fix_metrics_on_size_request.patch b/fix_metrics_on_size_request.patch
new file mode 100644
index 000000000000..6999f88ec101
--- /dev/null
+++ b/fix_metrics_on_size_request.patch
@@ -0,0 +1,41 @@
+--- a/src/truetype/ttdriver.c 2017-04-29 04:38:17 UTC
++++ b/src/truetype/ttdriver.c
+@@ -357,6 +357,8 @@
+ if ( FT_IS_SCALABLE( size->face ) )
+ {
+ error = tt_size_reset( ttsize, 0 );
++ if ( !error )
++ ttsize->root.metrics = *ttsize->metrics;
+
+ #ifdef TT_USE_BYTECODE_INTERPRETER
+ /* for the `MPS' bytecode instruction we need the point size */
+--- a/src/truetype/ttobjs.c 2017-05-07 11:05:56 UTC
++++ b/src/truetype/ttobjs.c
+@@ -1262,6 +1262,13 @@
+ /* */
+ if ( face->header.Flags & 8 )
+ {
++ if ( !only_height )
++ {
++ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
++ face->root.units_per_EM );
++ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
++ face->root.units_per_EM );
++ }
+ /* the TT spec always asks for ROUND, not FLOOR or CEIL */
+ size_metrics->ascender = FT_PIX_ROUND(
+ FT_MulFix( face->root.ascender,
+@@ -1283,11 +1290,12 @@
+ {
+ /* base scaling values on integer ppem values, */
+ /* as mandated by the TrueType specification */
++/*
+ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
+ face->root.units_per_EM );
+ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
+ face->root.units_per_EM );
+-
++*/
+ size_metrics->max_advance = FT_PIX_ROUND(
+ FT_MulFix( face->root.max_advance_width,
+ size_metrics->x_scale ) );
diff --git a/revert_allow_linear_scaling.patch b/revert_allow_linear_scaling.patch
deleted file mode 100644
index 6a12364bb6e7..000000000000
--- a/revert_allow_linear_scaling.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -Nur original/src/truetype/ttdriver.c modified/src/truetype/ttdriver.c
---- original/src/truetype/ttdriver.c 2017-04-29 05:38:17.000000000 +0100
-+++ modified/src/truetype/ttdriver.c 2017-06-11 15:11:59.313798025 +0100
-@@ -357,6 +357,7 @@
- if ( FT_IS_SCALABLE( size->face ) )
- {
- error = tt_size_reset( ttsize, 0 );
-+ ttsize->root.metrics = *ttsize->metrics;
-
- #ifdef TT_USE_BYTECODE_INTERPRETER
- /* for the `MPS' bytecode instruction we need the point size */
-diff -Nur original/src/truetype/ttgload.c modified/src/truetype/ttgload.c
---- original/src/truetype/ttgload.c 2017-05-03 22:40:41.000000000 +0100
-+++ modified/src/truetype/ttgload.c 2017-06-11 15:17:43.758145947 +0100
-@@ -2038,7 +2038,7 @@
-
- y_scale = 0x10000L;
- if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-- y_scale = size->metrics->y_scale;
-+ y_scale = size->root.metrics.y_scale;
-
- if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE )
- FT_Outline_Get_CBox( &glyph->outline, &bbox );
-@@ -2070,7 +2070,7 @@
-
-
- widthp = tt_face_get_device_metrics( face,
-- size->metrics->x_ppem,
-+ size->root.metrics.x_ppem,
- glyph_index );
-
- #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-@@ -2637,11 +2637,11 @@
- if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
- glyph->metrics.horiAdvance =
- FT_MulFix( glyph->linearHoriAdvance,
-- size->metrics->x_scale );
-+ size->root.metrics.x_scale );
- if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
- glyph->metrics.vertAdvance =
- FT_MulFix( glyph->linearVertAdvance,
-- size->metrics->y_scale );
-+ size->root.metrics.y_scale );
- }
-
- return FT_Err_Ok;
-@@ -2737,7 +2737,7 @@
- /* TrueType glyphs at all sizes using the bytecode interpreter. */
- /* */
- if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
-- size->metrics->y_ppem < 24 )
-+ size->root.metrics.y_ppem < 24 )
- glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
- Exit: