diff options
author | Solomon Choina | 2020-04-20 17:12:43 -0400 |
---|---|---|
committer | Solomon Choina | 2020-04-20 17:12:43 -0400 |
commit | 8db31f96af748122852fc671a01495dc8255e7f2 (patch) | |
tree | a34a44377412e3ba3546e9cce5ba822f74b059e3 | |
parent | 1bb084beca6690713e3e9bb31d68f0a069343816 (diff) | |
download | aur-freetype2-infinality.tar.gz |
removing a uneeded patch
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0004-freetype-2.5.2-more-demos.patch (renamed from 0005-freetype-2.5.2-more-demos.patch) | 0 | ||||
-rw-r--r-- | 0004-pcf-Fix-handling-of-undefined-glyph-56067.patch | 353 | ||||
-rw-r--r-- | PKGBUILD | 11 |
4 files changed, 5 insertions, 365 deletions
@@ -1,7 +1,7 @@ pkgbase = freetype2-infinality pkgdesc = Font rasterization library with Infinality patches and custom settings. pkgver = 2.10.1 - pkgrel = 4 + pkgrel = 1 url = http://www.freetype.org/ arch = armv7h arch = i686 @@ -27,8 +27,7 @@ pkgbase = freetype2-infinality source = 0001-Enable-table-validation-modules.patch source = 0002-infinality-2.10.1-2019.08.21.patch source = 0003-Enable-long-PCF-family-names.patch - source = 0004-pcf-Fix-handling-of-undefined-glyph-56067.patch - source = 0005-freetype-2.5.2-more-demos.patch + source = 0004-freetype-2.5.2-more-demos.patch source = freetype2.sh validpgpkeys = 58E0C111E39F5408C5D3EC76C1A60EACE707FDA5 sha256sums = 3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110 @@ -40,7 +39,6 @@ pkgbase = freetype2-infinality sha256sums = 739a67083b810c04e5cb87fa7e5a7819983410307e3d38d8f2a334c23085a5c2 sha256sums = afdc909def9d7e839f227a83a4e3b58d4060a28861739f9e1ab5540e60929cc8 sha256sums = 778a084b84215fbe62dafaed1dd7ebcdbd35c5c7af681d2789b5fe37764ceadd - sha256sums = a964981ca456a7a4fc54b95fd082a0d5d33358c15292328af7bdc66bc2d68a82 sha256sums = 36484db4b926ed026e7f32570573493b5a9793a129f08d54383a26d65a6af89b sha256sums = f7f8e09c44f7552c883846e9a6a1efc50377c4932234e74adc4a8ff750606467 diff --git a/0005-freetype-2.5.2-more-demos.patch b/0004-freetype-2.5.2-more-demos.patch index e737cb7dafe7..e737cb7dafe7 100644 --- a/0005-freetype-2.5.2-more-demos.patch +++ b/0004-freetype-2.5.2-more-demos.patch diff --git a/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch b/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch deleted file mode 100644 index 2b1e0e1d6ca3..000000000000 --- a/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch +++ /dev/null @@ -1,353 +0,0 @@ -From 5b6f9aa2fd4dadcf4c339014117f5d19b6878956 Mon Sep 17 00:00:00 2001 -Message-Id: <5b6f9aa2fd4dadcf4c339014117f5d19b6878956.1555912526.git.jan.steffens@gmail.com> -In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1555912526.git.jan.steffens@gmail.com> -References: <b609203df7333beea20dbfd604262a9486f01497.1555912526.git.jan.steffens@gmail.com> -From: Werner Lemberg <wl@gnu.org> -Date: Wed, 17 Apr 2019 07:49:17 +0200 -Subject: [PATCH 4/4] [pcf] Fix handling of undefined glyph (#56067). - -This commit fixes the changes from 2018-07-21, which broke charmap -iteration. We now add the default character as a new glyph with -index 0, thus increasing the number of glyphs by one (as before). - -* src/pcf/pcfread.c (pcf_get_metrics): Adjust to new artificial -glyph with index 0. -Limit number of elements to 65534. -(pcf_get_bitmaps): Ditto. -Unify two loops into one; this avoids allocation of an intermediate -array. -(pcf_get_encodings): Don't flip indices but copy glyph metrics of -default character to index 0. -Also handle invalid default character. - -* docs/CHANGES: Updated. ---- - src/pcf/pcf.h | 3 +- - src/pcf/pcfdrivr.c | 12 ++-- - src/pcf/pcfread.c | 161 ++++++++++++++++++++++++--------------------- - 3 files changed, 93 insertions(+), 83 deletions(-) - -diff --git a/src/pcf/pcf.h b/src/pcf/pcf.h -index 529dd3adf..33be4bcd8 100644 ---- a/src/pcf/pcf.h -+++ b/src/pcf/pcf.h -@@ -99,7 +99,8 @@ FT_BEGIN_HEADER - FT_Short ascent; - FT_Short descent; - FT_Short attributes; -- FT_ULong bits; -+ -+ FT_ULong bits; /* offset into the PCF_BITMAPS table */ - - } PCF_MetricRec, *PCF_Metric; - -diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c -index 54bbb9d11..b39592c79 100644 ---- a/src/pcf/pcfdrivr.c -+++ b/src/pcf/pcfdrivr.c -@@ -122,9 +122,9 @@ THE SOFTWARE. - charcodeCol > enc->lastCol ) - return 0; - -- return (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) * -- ( enc->lastCol - enc->firstCol + 1 ) + -- charcodeCol - enc->firstCol ]; -+ return (FT_UInt)enc->offset[( charcodeRow - enc->firstRow ) * -+ ( enc->lastCol - enc->firstCol + 1 ) + -+ charcodeCol - enc->firstCol]; - } - - -@@ -160,9 +160,9 @@ THE SOFTWARE. - - charcode = (FT_UInt32)( charcodeRow * 256 + charcodeCol ); - -- result = (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) * -- ( enc->lastCol - enc->firstCol + 1 ) + -- charcodeCol - enc->firstCol ]; -+ result = (FT_UInt)enc->offset[( charcodeRow - enc->firstRow ) * -+ ( enc->lastCol - enc->firstCol + 1 ) + -+ charcodeCol - enc->firstCol]; - if ( result != 0xFFFFU ) - break; - } -diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c -index 71143ecfb..3692eeff1 100644 ---- a/src/pcf/pcfread.c -+++ b/src/pcf/pcfread.c -@@ -743,33 +743,39 @@ THE SOFTWARE. - if ( !orig_nmetrics ) - return FT_THROW( Invalid_Table ); - -- /* PCF is a format from ancient times; Unicode was in its */ -- /* infancy, and widely used two-byte character sets for CJK */ -- /* scripts (Big 5, GB 2312, JIS X 0208, etc.) did have at most */ -- /* 15000 characters. Even the more exotic CNS 11643 and CCCII */ -- /* standards, which were essentially three-byte character sets, */ -- /* provided less then 65536 assigned characters. */ -- /* */ -- /* While technically possible to have a larger number of glyphs */ -- /* in PCF files, we thus limit the number to 65536. */ -- if ( orig_nmetrics > 65536 ) -+ /* -+ * PCF is a format from ancient times; Unicode was in its infancy, and -+ * widely used two-byte character sets for CJK scripts (Big 5, GB 2312, -+ * JIS X 0208, etc.) did have at most 15000 characters. Even the more -+ * exotic CNS 11643 and CCCII standards, which were essentially -+ * three-byte character sets, provided less then 65536 assigned -+ * characters. -+ * -+ * While technically possible to have a larger number of glyphs in PCF -+ * files, we thus limit the number to 65535, taking into account that we -+ * synthesize the metrics of glyph 0 to be a copy of the `default -+ * character', and that 0xFFFF in the encodings array indicates a -+ * missing glyph. -+ */ -+ if ( orig_nmetrics > 65534 ) - { - FT_TRACE0(( "pcf_get_metrics:" -- " only loading first 65536 metrics\n" )); -- nmetrics = 65536; -+ " only loading first 65534 metrics\n" )); -+ nmetrics = 65534; - } - else - nmetrics = orig_nmetrics; - -- face->nmetrics = nmetrics; -+ face->nmetrics = nmetrics + 1; - -- if ( FT_NEW_ARRAY( face->metrics, nmetrics ) ) -+ if ( FT_NEW_ARRAY( face->metrics, face->nmetrics ) ) - return error; - -- metrics = face->metrics; -+ /* we handle glyph index 0 later on */ -+ metrics = face->metrics + 1; - - FT_TRACE4(( "\n" )); -- for ( i = 0; i < nmetrics; i++, metrics++ ) -+ for ( i = 1; i < face->nmetrics; i++, metrics++ ) - { - FT_TRACE5(( " idx %ld:", i )); - error = pcf_get_metric( stream, format, metrics ); -@@ -808,12 +814,10 @@ THE SOFTWARE. - pcf_get_bitmaps( FT_Stream stream, - PCF_Face face ) - { -- FT_Error error; -- FT_Memory memory = FT_FACE( face )->memory; -- FT_ULong* offsets = NULL; -- FT_ULong bitmapSizes[GLYPHPADOPTIONS]; -- FT_ULong format, size; -- FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0; -+ FT_Error error; -+ FT_ULong bitmapSizes[GLYPHPADOPTIONS]; -+ FT_ULong format, size, pos; -+ FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0; - - - error = pcf_seek_to_table_type( stream, -@@ -859,75 +863,75 @@ THE SOFTWARE. - FT_TRACE4(( " number of bitmaps: %ld\n", orig_nbitmaps )); - - /* see comment in `pcf_get_metrics' */ -- if ( orig_nbitmaps > 65536 ) -+ if ( orig_nbitmaps > 65534 ) - { - FT_TRACE0(( "pcf_get_bitmaps:" -- " only loading first 65536 bitmaps\n" )); -- nbitmaps = 65536; -+ " only loading first 65534 bitmaps\n" )); -+ nbitmaps = 65534; - } - else - nbitmaps = orig_nbitmaps; - -- if ( nbitmaps != face->nmetrics ) -+ /* no extra bitmap for glyph 0 */ -+ if ( nbitmaps != face->nmetrics - 1 ) - return FT_THROW( Invalid_File_Format ); - -- if ( FT_NEW_ARRAY( offsets, nbitmaps ) ) -- return error; -+ /* start position of bitmap data */ -+ pos = stream->pos + nbitmaps * 4 + 4 * 4; - - FT_TRACE5(( "\n" )); -- for ( i = 0; i < nbitmaps; i++ ) -+ for ( i = 1; i <= nbitmaps; i++ ) - { -+ FT_ULong offset; -+ -+ - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) -- (void)FT_READ_ULONG( offsets[i] ); -+ (void)FT_READ_ULONG( offset ); - else -- (void)FT_READ_ULONG_LE( offsets[i] ); -+ (void)FT_READ_ULONG_LE( offset ); - - FT_TRACE5(( " bitmap %lu: offset %lu (0x%lX)\n", -- i, offsets[i], offsets[i] )); -+ i, offset, offset )); -+ -+ /* right now, we only check the offset with a rough estimate; */ -+ /* actual bitmaps are only loaded on demand */ -+ if ( offset > size ) -+ { -+ FT_TRACE0(( "pcf_get_bitmaps:" -+ " invalid offset to bitmap data of glyph %lu\n", i )); -+ face->metrics[i].bits = pos; -+ } -+ else -+ face->metrics[i].bits = pos + offset; - } - if ( error ) - goto Bail; - - for ( i = 0; i < GLYPHPADOPTIONS; i++ ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_ULONG( bitmapSizes[i] ); - else - (void)FT_READ_ULONG_LE( bitmapSizes[i] ); - if ( error ) - goto Bail; - - sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )]; - - FT_TRACE4(( " %ld-bit padding implies a size of %lu\n", - 8 << i, bitmapSizes[i] )); - } - - FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n", - nbitmaps, - 8 << PCF_GLYPH_PAD_INDEX( format ) )); - FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps )); - - FT_UNUSED( sizebitmaps ); /* only used for debugging */ - -- /* right now, we only check the bitmap offsets; */ -- /* actual bitmaps are only loaded on demand */ -- for ( i = 0; i < nbitmaps; i++ ) -- { -- /* rough estimate */ -- if ( offsets[i] > size ) -- { -- FT_TRACE0(( "pcf_get_bitmaps:" -- " invalid offset to bitmap data of glyph %lu\n", i )); -- } -- else -- face->metrics[i].bits = stream->pos + offsets[i]; -- } -- - face->bitmapsFormat = format; - - Bail: -- FT_FREE( offsets ); - return error; - } - -@@ -1062,64 +1066,69 @@ THE SOFTWARE. - defaultCharCol = enc->firstCol; - } - -- /* FreeType mandates that glyph index 0 is the `undefined glyph', */ -- /* which PCF calls the `default character'. For this reason, we */ -- /* swap the positions of glyph index 0 and the index corresponding */ -- /* to `defaultChar' in case they are different. */ -- -- /* `stream->cursor' still points at the beginning of the frame; */ -- /* we can thus easily get the offset to the default character */ -+ /* -+ * FreeType mandates that glyph index 0 is the `undefined glyph', which -+ * PCF calls the `default character'. However, FreeType needs glyph -+ * index 0 to be used for the undefined glyph only, which is is not the -+ * case for PCF. For this reason, we add one slot for glyph index 0 and -+ * simply copy the default character to it. -+ * -+ * `stream->cursor' still points to the beginning of the frame; we can -+ * thus easily get the offset to the default character. -+ */ - pos = stream->cursor + - 2 * ( ( defaultCharRow - enc->firstRow ) * -- ( enc->lastCol - enc->firstCol + 1 ) + -- defaultCharCol - enc->firstCol ); -+ ( enc->lastCol - enc->firstCol + 1 ) + -+ defaultCharCol - enc->firstCol ); - - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - defaultCharEncodingOffset = FT_PEEK_USHORT( pos ); - else - defaultCharEncodingOffset = FT_PEEK_USHORT_LE( pos ); - -- if ( defaultCharEncodingOffset >= face->nmetrics ) -+ if ( defaultCharEncodingOffset == 0xFFFF ) - { - FT_TRACE0(( "pcf_get_encodings:" -- " Invalid glyph index for default character," -- " setting to zero\n" )); -- defaultCharEncodingOffset = 0; -+ " No glyph for default character,\n" -+ " " -+ " setting it to the first glyph of the font\n" )); -+ defaultCharEncodingOffset = 1; - } -- -- if ( defaultCharEncodingOffset ) -+ else - { -- /* do the swapping */ -- PCF_MetricRec tmp = face->metrics[defaultCharEncodingOffset]; -+ defaultCharEncodingOffset++; - -- -- face->metrics[defaultCharEncodingOffset] = face->metrics[0]; -- face->metrics[0] = tmp; -+ if ( defaultCharEncodingOffset >= face->nmetrics ) -+ { -+ FT_TRACE0(( "pcf_get_encodings:" -+ " Invalid glyph index for default character,\n" -+ " " -+ " setting it to the first glyph of the font\n" )); -+ defaultCharEncodingOffset = 1; -+ } - } - -+ /* copy metrics of default character to index 0 */ -+ face->metrics[0] = face->metrics[defaultCharEncodingOffset]; -+ -+ /* now loop over all values */ - offset = enc->offset; - for ( i = enc->firstRow; i <= enc->lastRow; i++ ) - { - for ( j = enc->firstCol; j <= enc->lastCol; j++ ) - { - /* X11's reference implementation uses the equivalent to */ - /* `FT_GET_SHORT', however PCF fonts with more than 32768 */ - /* characters (e.g., `unifont.pcf') clearly show that an */ - /* unsigned value is needed. */ - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - encodingOffset = FT_GET_USHORT(); - else - encodingOffset = FT_GET_USHORT_LE(); - -- if ( encodingOffset != 0xFFFFU ) -- { -- if ( encodingOffset == defaultCharEncodingOffset ) -- encodingOffset = 0; -- else if ( encodingOffset == 0 ) -- encodingOffset = defaultCharEncodingOffset; -- } -- -- *offset++ = encodingOffset; -+ /* everything is off by 1 due to the artificial glyph 0 */ -+ *offset++ = encodingOffset == 0xFFFF ? 0xFFFF -+ : encodingOffset + 1; - } - } - FT_Stream_ExitFrame( stream ); --- -2.21.0 - @@ -7,7 +7,7 @@ pkgbase="freetype2-infinality" pkgname=("${pkgbase}" "${pkgbase/-/-demos-}" "${pkgbase/-/-docs-}") pkgver=2.10.1 -pkgrel=4 +pkgrel=1 _patchrel=2019.08.21 pkgdesc="Font rasterization library with Infinality patches and custom settings." arch=("armv7h" "i686" "x86_64") @@ -25,8 +25,7 @@ source=("https://download-mirror.savannah.gnu.org/releases/${pkgbase%2-infinalit "0001-Enable-table-validation-modules.patch" "0002-infinality-${pkgver}-${_patchrel}.patch" "0003-Enable-long-PCF-family-names.patch" - "0004-pcf-Fix-handling-of-undefined-glyph-56067.patch" - "0005-freetype-2.5.2-more-demos.patch" + "0004-freetype-2.5.2-more-demos.patch" freetype2.sh ) sha256sums=('3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110' @@ -38,7 +37,6 @@ sha256sums=('3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110' '739a67083b810c04e5cb87fa7e5a7819983410307e3d38d8f2a334c23085a5c2' 'afdc909def9d7e839f227a83a4e3b58d4060a28861739f9e1ab5540e60929cc8' '778a084b84215fbe62dafaed1dd7ebcdbd35c5c7af681d2789b5fe37764ceadd' - 'a964981ca456a7a4fc54b95fd082a0d5d33358c15292328af7bdc66bc2d68a82' '36484db4b926ed026e7f32570573493b5a9793a129f08d54383a26d65a6af89b' 'f7f8e09c44f7552c883846e9a6a1efc50377c4932234e74adc4a8ff750606467') validpgpkeys=("58E0C111E39F5408C5D3EC76C1A60EACE707FDA5") @@ -53,12 +51,9 @@ prepare() { patch -Np1 -i "${srcdir}/0002-infinality-${pkgver}-${_patchrel}.patch" patch -Np1 -i "${srcdir}/0003-Enable-long-PCF-family-names.patch" - # https://bugs.archlinux.org/task/62395 - patch -Np1 -i "${srcdir}/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch" - cd "${srcdir}/${pkgbase%-infinality}-demos" # Enable more demos - patch -Np1 -i "${srcdir}/0005-${pkgbase%2-infinality}-2.5.2-more-demos.patch" + patch -Np1 -i "${srcdir}/0004-${pkgbase%2-infinality}-2.5.2-more-demos.patch" # Suppress RPATH sed -i "/X11_LIB:%=-R%/d" "graph/x11/rules.mk" |