[arch-commits] Commit in freetype2/repos/extra-x86_64 (15 files)

Jan Steffens heftig at archlinux.org
Mon Apr 22 06:00:02 UTC 2019


    Date: Monday, April 22, 2019 @ 06:00:00
  Author: heftig
Revision: 351866

archrelease: copy trunk to extra-x86_64

Added:
  freetype2/repos/extra-x86_64/0001-Enable-table-validation-modules.patch
    (from rev 351865, freetype2/trunk/0001-Enable-table-validation-modules.patch)
  freetype2/repos/extra-x86_64/0002-Enable-infinality-subpixel-hinting.patch
    (from rev 351865, freetype2/trunk/0002-Enable-infinality-subpixel-hinting.patch)
  freetype2/repos/extra-x86_64/0003-Enable-long-PCF-family-names.patch
    (from rev 351865, freetype2/trunk/0003-Enable-long-PCF-family-names.patch)
  freetype2/repos/extra-x86_64/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch
    (from rev 351865, freetype2/trunk/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch)
  freetype2/repos/extra-x86_64/0005-freetype-2.5.2-more-demos.patch
    (from rev 351865, freetype2/trunk/0005-freetype-2.5.2-more-demos.patch)
  freetype2/repos/extra-x86_64/PKGBUILD
    (from rev 351865, freetype2/trunk/PKGBUILD)
  freetype2/repos/extra-x86_64/freetype2.install
    (from rev 351865, freetype2/trunk/freetype2.install)
  freetype2/repos/extra-x86_64/freetype2.sh
    (from rev 351865, freetype2/trunk/freetype2.sh)
Deleted:
  freetype2/repos/extra-x86_64/0001-Enable-table-validation-modules.patch
  freetype2/repos/extra-x86_64/0002-Enable-infinality-subpixel-hinting.patch
  freetype2/repos/extra-x86_64/0003-Enable-long-PCF-family-names.patch
  freetype2/repos/extra-x86_64/0005-freetype-2.5.2-more-demos.patch
  freetype2/repos/extra-x86_64/PKGBUILD
  freetype2/repos/extra-x86_64/freetype2.install
  freetype2/repos/extra-x86_64/freetype2.sh

------------------------------------------------------+
 0001-Enable-table-validation-modules.patch           |   92 ++--
 0002-Enable-infinality-subpixel-hinting.patch        |   60 +-
 0003-Enable-long-PCF-family-names.patch              |   56 +-
 0004-pcf-Fix-handling-of-undefined-glyph-56067.patch |  353 +++++++++++++++++
 0005-freetype-2.5.2-more-demos.patch                 |   34 -
 PKGBUILD                                             |  203 +++++----
 freetype2.install                                    |   16 
 freetype2.sh                                         |   24 -
 8 files changed, 598 insertions(+), 240 deletions(-)

Deleted: 0001-Enable-table-validation-modules.patch
===================================================================
--- 0001-Enable-table-validation-modules.patch	2019-04-22 05:58:32 UTC (rev 351865)
+++ 0001-Enable-table-validation-modules.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,46 +0,0 @@
-From b609203df7333beea20dbfd604262a9486f01497 Mon Sep 17 00:00:00 2001
-Message-Id: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Tue, 23 Jun 2015 08:40:29 +0200
-Subject: [PATCH 1/4] Enable table validation modules
-
----
- modules.cfg | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules.cfg b/modules.cfg
-index dc6c8d42d..2ab145016 100644
---- a/modules.cfg
-+++ b/modules.cfg
-@@ -111,26 +111,26 @@ AUX_MODULES += cache
- 
- # TrueType GX/AAT table validation.  Needs `ftgxval.c' below.
- #
--# AUX_MODULES += gxvalid
-+AUX_MODULES += gxvalid
- 
- # Support for streams compressed with gzip (files with suffix .gz).
- #
- # See include/freetype/ftgzip.h for the API.
- AUX_MODULES += gzip
- 
- # Support for streams compressed with LZW (files with suffix .Z).
- #
- # See include/freetype/ftlzw.h for the API.
- AUX_MODULES += lzw
- 
- # Support for streams compressed with bzip2 (files with suffix .bz2).
- #
- # See include/freetype/ftbzip2.h for the API.
- AUX_MODULES += bzip2
- 
- # OpenType table validation.  Needs `ftotval.c' below.
- #
--# AUX_MODULES += otvalid
-+AUX_MODULES += otvalid
- 
- # Auxiliary PostScript driver component to share common code.
- #
--- 
-2.21.0
-

Copied: freetype2/repos/extra-x86_64/0001-Enable-table-validation-modules.patch (from rev 351865, freetype2/trunk/0001-Enable-table-validation-modules.patch)
===================================================================
--- 0001-Enable-table-validation-modules.patch	                        (rev 0)
+++ 0001-Enable-table-validation-modules.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,46 @@
+From b609203df7333beea20dbfd604262a9486f01497 Mon Sep 17 00:00:00 2001
+Message-Id: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Tue, 23 Jun 2015 08:40:29 +0200
+Subject: [PATCH 1/4] Enable table validation modules
+
+---
+ modules.cfg | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules.cfg b/modules.cfg
+index dc6c8d42d..2ab145016 100644
+--- a/modules.cfg
++++ b/modules.cfg
+@@ -111,26 +111,26 @@ AUX_MODULES += cache
+ 
+ # TrueType GX/AAT table validation.  Needs `ftgxval.c' below.
+ #
+-# AUX_MODULES += gxvalid
++AUX_MODULES += gxvalid
+ 
+ # Support for streams compressed with gzip (files with suffix .gz).
+ #
+ # See include/freetype/ftgzip.h for the API.
+ AUX_MODULES += gzip
+ 
+ # Support for streams compressed with LZW (files with suffix .Z).
+ #
+ # See include/freetype/ftlzw.h for the API.
+ AUX_MODULES += lzw
+ 
+ # Support for streams compressed with bzip2 (files with suffix .bz2).
+ #
+ # See include/freetype/ftbzip2.h for the API.
+ AUX_MODULES += bzip2
+ 
+ # OpenType table validation.  Needs `ftotval.c' below.
+ #
+-# AUX_MODULES += otvalid
++AUX_MODULES += otvalid
+ 
+ # Auxiliary PostScript driver component to share common code.
+ #
+-- 
+2.21.0
+

Deleted: 0002-Enable-infinality-subpixel-hinting.patch
===================================================================
--- 0002-Enable-infinality-subpixel-hinting.patch	2019-04-22 05:58:32 UTC (rev 351865)
+++ 0002-Enable-infinality-subpixel-hinting.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,30 +0,0 @@
-From fbeffd53c40de0932b1e9ef32ca4f30b7e1aeea2 Mon Sep 17 00:00:00 2001
-Message-Id: <fbeffd53c40de0932b1e9ef32ca4f30b7e1aeea2.1552648361.git.jan.steffens at gmail.com>
-In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
-References: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Mon, 29 Aug 2016 08:43:10 +0200
-Subject: [PATCH 2/4] Enable infinality subpixel hinting
-
----
- include/freetype/config/ftoption.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 12f47a82e..1d4469a99 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -658,8 +658,8 @@ FT_BEGIN_HEADER
-    * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
-    */
- /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  1         */
--#define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2
--/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  ( 1 | 2 ) */
-+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2         */
-+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING  ( 1 | 2 )
- 
- 
-   /**************************************************************************
--- 
-2.21.0
-

Copied: freetype2/repos/extra-x86_64/0002-Enable-infinality-subpixel-hinting.patch (from rev 351865, freetype2/trunk/0002-Enable-infinality-subpixel-hinting.patch)
===================================================================
--- 0002-Enable-infinality-subpixel-hinting.patch	                        (rev 0)
+++ 0002-Enable-infinality-subpixel-hinting.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,30 @@
+From fbeffd53c40de0932b1e9ef32ca4f30b7e1aeea2 Mon Sep 17 00:00:00 2001
+Message-Id: <fbeffd53c40de0932b1e9ef32ca4f30b7e1aeea2.1552648361.git.jan.steffens at gmail.com>
+In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
+References: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Mon, 29 Aug 2016 08:43:10 +0200
+Subject: [PATCH 2/4] Enable infinality subpixel hinting
+
+---
+ include/freetype/config/ftoption.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
+index 12f47a82e..1d4469a99 100644
+--- a/include/freetype/config/ftoption.h
++++ b/include/freetype/config/ftoption.h
+@@ -658,8 +658,8 @@ FT_BEGIN_HEADER
+    * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
+    */
+ /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  1         */
+-#define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2
+-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  ( 1 | 2 ) */
++/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2         */
++#define TT_CONFIG_OPTION_SUBPIXEL_HINTING  ( 1 | 2 )
+ 
+ 
+   /**************************************************************************
+-- 
+2.21.0
+

Deleted: 0003-Enable-long-PCF-family-names.patch
===================================================================
--- 0003-Enable-long-PCF-family-names.patch	2019-04-22 05:58:32 UTC (rev 351865)
+++ 0003-Enable-long-PCF-family-names.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,28 +0,0 @@
-From a7c04e60d28a0ad0420bb7a1943479a08a923d07 Mon Sep 17 00:00:00 2001
-Message-Id: <a7c04e60d28a0ad0420bb7a1943479a08a923d07.1552648361.git.jan.steffens at gmail.com>
-In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
-References: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Sun, 14 May 2017 18:09:31 +0200
-Subject: [PATCH 3/4] Enable long PCF family names
-
----
- include/freetype/config/ftoption.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 1d4469a99..4ff4e7821 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -847,7 +847,7 @@ FT_BEGIN_HEADER
-    * If this option is activated, it can be controlled with the
-    * `no-long-family-names` property of the 'pcf' driver module.
-    */
--/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
-+#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
- 
- 
-   /*************************************************************************/
--- 
-2.21.0
-

Copied: freetype2/repos/extra-x86_64/0003-Enable-long-PCF-family-names.patch (from rev 351865, freetype2/trunk/0003-Enable-long-PCF-family-names.patch)
===================================================================
--- 0003-Enable-long-PCF-family-names.patch	                        (rev 0)
+++ 0003-Enable-long-PCF-family-names.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,28 @@
+From a7c04e60d28a0ad0420bb7a1943479a08a923d07 Mon Sep 17 00:00:00 2001
+Message-Id: <a7c04e60d28a0ad0420bb7a1943479a08a923d07.1552648361.git.jan.steffens at gmail.com>
+In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
+References: <b609203df7333beea20dbfd604262a9486f01497.1552648361.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Sun, 14 May 2017 18:09:31 +0200
+Subject: [PATCH 3/4] Enable long PCF family names
+
+---
+ include/freetype/config/ftoption.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
+index 1d4469a99..4ff4e7821 100644
+--- a/include/freetype/config/ftoption.h
++++ b/include/freetype/config/ftoption.h
+@@ -847,7 +847,7 @@ FT_BEGIN_HEADER
+    * If this option is activated, it can be controlled with the
+    * `no-long-family-names` property of the 'pcf' driver module.
+    */
+-/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
++#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+ 
+ 
+   /*************************************************************************/
+-- 
+2.21.0
+

Copied: freetype2/repos/extra-x86_64/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch (from rev 351865, freetype2/trunk/0004-pcf-Fix-handling-of-undefined-glyph-56067.patch)
===================================================================
--- 0004-pcf-Fix-handling-of-undefined-glyph-56067.patch	                        (rev 0)
+++ 0004-pcf-Fix-handling-of-undefined-glyph-56067.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,353 @@
+From 5b6f9aa2fd4dadcf4c339014117f5d19b6878956 Mon Sep 17 00:00:00 2001
+Message-Id: <5b6f9aa2fd4dadcf4c339014117f5d19b6878956.1555912526.git.jan.steffens at gmail.com>
+In-Reply-To: <b609203df7333beea20dbfd604262a9486f01497.1555912526.git.jan.steffens at gmail.com>
+References: <b609203df7333beea20dbfd604262a9486f01497.1555912526.git.jan.steffens at gmail.com>
+From: Werner Lemberg <wl at 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
+

Deleted: 0005-freetype-2.5.2-more-demos.patch
===================================================================
--- 0005-freetype-2.5.2-more-demos.patch	2019-04-22 05:58:32 UTC (rev 351865)
+++ 0005-freetype-2.5.2-more-demos.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,17 +0,0 @@
---- ft2demos-2.5.2/Makefile
-+++ ft2demos-2.5.2/Makefile
-@@ -296,10 +296,10 @@ else
-   # The following programs are not compiled automatically; either comment
-   # out the affected line or use the program name as a Makefile target.
-   #
--  # EXES += ftchkwd
--  # EXES += ftmemchk
--  # EXES += ftpatchk
--  # EXES += fttimer
-+  EXES += ftchkwd
-+  EXES += ftmemchk
-+  EXES += ftpatchk
-+  EXES += fttimer
-   # EXES += testname
- 
-   exes: $(EXES:%=$(BIN_DIR_2)/%$E)

Copied: freetype2/repos/extra-x86_64/0005-freetype-2.5.2-more-demos.patch (from rev 351865, freetype2/trunk/0005-freetype-2.5.2-more-demos.patch)
===================================================================
--- 0005-freetype-2.5.2-more-demos.patch	                        (rev 0)
+++ 0005-freetype-2.5.2-more-demos.patch	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,17 @@
+--- ft2demos-2.5.2/Makefile
++++ ft2demos-2.5.2/Makefile
+@@ -296,10 +296,10 @@ else
+   # The following programs are not compiled automatically; either comment
+   # out the affected line or use the program name as a Makefile target.
+   #
+-  # EXES += ftchkwd
+-  # EXES += ftmemchk
+-  # EXES += ftpatchk
+-  # EXES += fttimer
++  EXES += ftchkwd
++  EXES += ftmemchk
++  EXES += ftpatchk
++  EXES += fttimer
+   # EXES += testname
+ 
+   exes: $(EXES:%=$(BIN_DIR_2)/%$E)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2019-04-22 05:58:32 UTC (rev 351865)
+++ PKGBUILD	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,99 +0,0 @@
-# Maintainer: Jan de Groot <jgc at archlinux.org>
-
-pkgbase=freetype2
-pkgname=('freetype2' 'freetype2-demos' 'freetype2-docs')
-pkgver=2.10.0
-pkgrel=1
-pkgdesc="Font rasterization library"
-arch=(x86_64)
-license=('GPL')
-url="https://www.freetype.org/"
-# adding harfbuzz for improved OpenType features auto-hinting
-# introduces a cycle dep to harfbuzz depending on freetype wanted by upstream
-depends=('zlib' 'bzip2' 'sh' 'libpng' 'harfbuzz')
-makedepends=('libx11')
-source=(https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${pkgver}.tar.bz2{,.sig}
-        https://download-mirror.savannah.gnu.org/releases/freetype/freetype-doc-${pkgver}.tar.bz2{,.sig}
-        https://download-mirror.savannah.gnu.org/releases/freetype/ft2demos-${pkgver}.tar.bz2{,.sig}
-        0001-Enable-table-validation-modules.patch
-        0002-Enable-infinality-subpixel-hinting.patch
-        0003-Enable-long-PCF-family-names.patch
-        0005-freetype-2.5.2-more-demos.patch
-        freetype2.sh)
-sha1sums=('f6abf03e0e3189a0de883981c57d3861b5d314f5'
-          'SKIP'
-          '44c66dd52e65f1ceeb5863803cf0273d19aa4219'
-          'SKIP'
-          'a06c7149637122c71eb77d1aa07b037589a07882'
-          'SKIP'
-          '46fd67e6a594f6c2c473b9321ba64913984ba42f'
-          '4bf0c0749db09878b918cc404300f0d3e9091607'
-          'af76172be8135e74391b7ad1b82c2124ae0ad86c'
-          '72cfecbe738085eec475e012617661ad0cc9b76f'
-          'bc6df1661c4c33e20f5ce30c2da8ad3c2083665f')
-validpgpkeys=('58E0C111E39F5408C5D3EC76C1A60EACE707FDA5')
-
-prepare() {
-  # Rename source dir to allow building the demos
-  mv freetype-${pkgver} freetype2
-  mv ft2demos-${pkgver} freetype2-demos
-
-  cd freetype2
-  patch -Np1 -i ../0001-Enable-table-validation-modules.patch
-  patch -Np1 -i ../0002-Enable-infinality-subpixel-hinting.patch
-  patch -Np1 -i ../0003-Enable-long-PCF-family-names.patch
-
-  cd ../freetype2-demos
-  # enable more demos
-  patch -Np1 -i ../0005-freetype-2.5.2-more-demos.patch
-
-  # Suppress RPATH
-  sed -i '/X11_LIB:%=-R%/d' graph/x11/rules.mk
-}
-
-build() {
-  cd freetype2
-  ./configure --prefix=/usr --disable-static
-  make
-
-  # Build demos
-  cd ../freetype2-demos
-  make
-}
-
-check() {
-  cd freetype2
-  make -k check
-}
-
-package_freetype2() {
-  provides=('libfreetype.so')
-  install=freetype2.install
-  backup=('etc/profile.d/freetype2.sh')
-
-  cd freetype2
-  make DESTDIR="${pkgdir}" install
-  install -Dt "${pkgdir}/etc/profile.d" -m644 ../freetype2.sh
-}
-
-package_freetype2-demos() {
-  pkgdesc="Freetype tools and demos"
-  depends=('freetype2' 'libx11')
-
-  cd freetype2-demos
-  install -d "${pkgdir}/usr/bin"
-  for _i in bin/{f,t}t*; do
-    libtool --mode=install install $_i "${pkgdir}/usr/bin"
-  done
-}
-
-package_freetype2-docs() {
-  pkgdesc="Freetype documentation"
-  depends=('freetype2')
-
-  cd freetype2
-  install -d "${pkgdir}/usr/share/doc"
-  cp -a docs "${pkgdir}/usr/share/doc/freetype2"
-}
-
-# vim:set ts=2 sw=2 et:

Copied: freetype2/repos/extra-x86_64/PKGBUILD (from rev 351865, freetype2/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,104 @@
+# Maintainer: Jan de Groot <jgc at archlinux.org>
+
+pkgbase=freetype2
+pkgname=('freetype2' 'freetype2-demos' 'freetype2-docs')
+pkgver=2.10.0
+pkgrel=2
+pkgdesc="Font rasterization library"
+arch=(x86_64)
+license=('GPL')
+url="https://www.freetype.org/"
+# adding harfbuzz for improved OpenType features auto-hinting
+# introduces a cycle dep to harfbuzz depending on freetype wanted by upstream
+depends=('zlib' 'bzip2' 'sh' 'libpng' 'harfbuzz')
+makedepends=('libx11')
+source=(https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${pkgver}.tar.bz2{,.sig}
+        https://download-mirror.savannah.gnu.org/releases/freetype/freetype-doc-${pkgver}.tar.bz2{,.sig}
+        https://download-mirror.savannah.gnu.org/releases/freetype/ft2demos-${pkgver}.tar.bz2{,.sig}
+        0001-Enable-table-validation-modules.patch
+        0002-Enable-infinality-subpixel-hinting.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
+        freetype2.sh)
+sha1sums=('f6abf03e0e3189a0de883981c57d3861b5d314f5'
+          'SKIP'
+          '44c66dd52e65f1ceeb5863803cf0273d19aa4219'
+          'SKIP'
+          'a06c7149637122c71eb77d1aa07b037589a07882'
+          'SKIP'
+          '46fd67e6a594f6c2c473b9321ba64913984ba42f'
+          '4bf0c0749db09878b918cc404300f0d3e9091607'
+          'af76172be8135e74391b7ad1b82c2124ae0ad86c'
+          '74d0ae26620a22c03002ecfffd7bd4c8130d6f6c'
+          '72cfecbe738085eec475e012617661ad0cc9b76f'
+          'bc6df1661c4c33e20f5ce30c2da8ad3c2083665f')
+validpgpkeys=('58E0C111E39F5408C5D3EC76C1A60EACE707FDA5')
+
+prepare() {
+  # Rename source dir to allow building the demos
+  mv freetype-${pkgver} freetype2
+  mv ft2demos-${pkgver} freetype2-demos
+
+  cd freetype2
+  patch -Np1 -i ../0001-Enable-table-validation-modules.patch
+  patch -Np1 -i ../0002-Enable-infinality-subpixel-hinting.patch
+  patch -Np1 -i ../0003-Enable-long-PCF-family-names.patch
+
+  # https://bugs.archlinux.org/task/62395
+  patch -Np1 -i ../0004-pcf-Fix-handling-of-undefined-glyph-56067.patch
+
+  cd ../freetype2-demos
+  # enable more demos
+  patch -Np1 -i ../0005-freetype-2.5.2-more-demos.patch
+
+  # Suppress RPATH
+  sed -i '/X11_LIB:%=-R%/d' graph/x11/rules.mk
+}
+
+build() {
+  cd freetype2
+  ./configure --prefix=/usr --disable-static
+  make
+
+  # Build demos
+  cd ../freetype2-demos
+  make
+}
+
+check() {
+  cd freetype2
+  make -k check
+}
+
+package_freetype2() {
+  provides=('libfreetype.so')
+  install=freetype2.install
+  backup=('etc/profile.d/freetype2.sh')
+
+  cd freetype2
+  make DESTDIR="${pkgdir}" install
+  install -Dt "${pkgdir}/etc/profile.d" -m644 ../freetype2.sh
+}
+
+package_freetype2-demos() {
+  pkgdesc="Freetype tools and demos"
+  depends=('freetype2' 'libx11')
+
+  cd freetype2-demos
+  install -d "${pkgdir}/usr/bin"
+  for _i in bin/{f,t}t*; do
+    libtool --mode=install install $_i "${pkgdir}/usr/bin"
+  done
+}
+
+package_freetype2-docs() {
+  pkgdesc="Freetype documentation"
+  depends=('freetype2')
+
+  cd freetype2
+  install -d "${pkgdir}/usr/share/doc"
+  cp -a docs "${pkgdir}/usr/share/doc/freetype2"
+}
+
+# vim:set ts=2 sw=2 et:

Deleted: freetype2.install
===================================================================
--- freetype2.install	2019-04-22 05:58:32 UTC (rev 351865)
+++ freetype2.install	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,8 +0,0 @@
-post_upgrade() {
-  if (( $(vercmp $2 2.7-1) < 0 )); then
-    cat <<MSG
-  The Arch-specific FT2_SUBPIXEL_HINTING has been removed.
-  Subpixel hinting is now configured in /etc/profile.d/freetype2.sh .
-MSG
-  fi
-}

Copied: freetype2/repos/extra-x86_64/freetype2.install (from rev 351865, freetype2/trunk/freetype2.install)
===================================================================
--- freetype2.install	                        (rev 0)
+++ freetype2.install	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,8 @@
+post_upgrade() {
+  if (( $(vercmp $2 2.7-1) < 0 )); then
+    cat <<MSG
+  The Arch-specific FT2_SUBPIXEL_HINTING has been removed.
+  Subpixel hinting is now configured in /etc/profile.d/freetype2.sh .
+MSG
+  fi
+}

Deleted: freetype2.sh
===================================================================
--- freetype2.sh	2019-04-22 05:58:32 UTC (rev 351865)
+++ freetype2.sh	2019-04-22 06:00:00 UTC (rev 351866)
@@ -1,12 +0,0 @@
-# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
-# version. The available settings are:
-#
-#     truetype:interpreter-version=35  # Classic mode (default in 2.6)
-#     truetype:interpreter-version=38  # Infinality mode
-#     truetype:interpreter-version=40  # Minimal mode (default in 2.7)
-#
-# There are more properties that can be set, separated by whitespace. Please
-# refer to the FreeType documentation for details.
-
-# Uncomment and configure below
-#export FREETYPE_PROPERTIES="truetype:interpreter-version=40"

Copied: freetype2/repos/extra-x86_64/freetype2.sh (from rev 351865, freetype2/trunk/freetype2.sh)
===================================================================
--- freetype2.sh	                        (rev 0)
+++ freetype2.sh	2019-04-22 06:00:00 UTC (rev 351866)
@@ -0,0 +1,12 @@
+# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
+# version. The available settings are:
+#
+#     truetype:interpreter-version=35  # Classic mode (default in 2.6)
+#     truetype:interpreter-version=38  # Infinality mode
+#     truetype:interpreter-version=40  # Minimal mode (default in 2.7)
+#
+# There are more properties that can be set, separated by whitespace. Please
+# refer to the FreeType documentation for details.
+
+# Uncomment and configure below
+#export FREETYPE_PROPERTIES="truetype:interpreter-version=40"



More information about the arch-commits mailing list