diff options
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 0001-let-freetype-handle-ISO-8859-1-mapping.patch | 35 | ||||
-rw-r--r-- | 0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch | 72 | ||||
-rw-r--r-- | 0003-check-for-freetype-NULL-atoms.patch | 95 | ||||
-rw-r--r-- | 0004-improve-guess-font-size.patch | 43 | ||||
-rw-r--r-- | PKGBUILD | 23 |
6 files changed, 6 insertions, 274 deletions
@@ -1,6 +1,6 @@ pkgbase = fonttosfnt-git pkgdesc = Convert a set of bdf or pcf fonts into a bitmap only sfnt (otb) - pkgver = r83.c214ab0 + pkgver = r87.d06059e pkgrel = 1 url = https://gitlab.freedesktop.org/xorg/app/fonttosfnt arch = x86_64 @@ -9,22 +9,14 @@ pkgbase = fonttosfnt-git makedepends = make makedepends = autoconf makedepends = automake - makedepends = xproto + makedepends = xorgproto makedepends = xorg-util-macros depends = libfontenc depends = freetype2 provides = fonttosfnt conflicts = fonttosfnt source = git+https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git - source = 0001-let-freetype-handle-ISO-8859-1-mapping.patch - source = 0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch - source = 0003-check-for-freetype-NULL-atoms.patch - source = 0004-improve-guess-font-size.patch md5sums = SKIP - md5sums = c9a2934334f46681f1a6131d4fd13077 - md5sums = 1b542636d9a95d9bb6095c12aa20eb3a - md5sums = 9ba2b5498590e75859099cd57c970ac3 - md5sums = 1152c9c998813c003df379813aac2c7c pkgname = fonttosfnt-git diff --git a/0001-let-freetype-handle-ISO-8859-1-mapping.patch b/0001-let-freetype-handle-ISO-8859-1-mapping.patch deleted file mode 100644 index 24b7e587f351..000000000000 --- a/0001-let-freetype-handle-ISO-8859-1-mapping.patch +++ /dev/null @@ -1,35 +0,0 @@ -From ae7f143f7b8dd14fd720061922a5a5e03fa60218 Mon Sep 17 00:00:00 2001 -From: Ryan Farley <ryan.farley@gmx.com> -Date: Tue, 20 Aug 2019 03:16:22 -0500 -Subject: [PATCH app/fonttosfnt 1/2] let freetype handle ISO-8859-1 mapping - -https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_encoding -indicates that ISO-8859-1 is automatically mapped to Unicode for BDF and -PCF fonts -- trying to use FT_Select_Charmap() with FT_ENCODING_NONE -leads to an error for such fonts. ---- - read.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/read.c b/read.c -index 632c7e7..5e80cc5 100644 ---- a/read.c -+++ b/read.c -@@ -79,10 +79,13 @@ readFile(char *filename, FontPtr font) - return -1; - } - -+ /* FreeType will handle Unicode and automatically map ISO-8859-1 to -+ * Unicode for us -- everything else needs a mapping */ - encoding_name = faceEncoding(face); - if(encoding_name == NULL) { - symbol = 1; -- } else if(strcasecmp(encoding_name, "iso10646-1") != 0) { -+ } else if((strcasecmp(encoding_name, "iso10646-1") != 0) && -+ (strcasecmp(encoding_name, "iso8859-1") != 0)) { - if(reencode_flag) - mapping = FontEncMapFind(encoding_name, - FONT_ENCODING_UNICODE, 0, 0, NULL); --- -2.23.0 - diff --git a/0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch b/0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch deleted file mode 100644 index 2a4e0875de96..000000000000 --- a/0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 07230480293018e2f5a7fa7c2ddb7aaebd567897 Mon Sep 17 00:00:00 2001 -From: Ryan Farley <ryan.farley@gmx.com> -Date: Sat, 31 Aug 2019 06:42:24 -0500 -Subject: [PATCH app/fonttosfnt 2/2] allow ISO-646.1991-IRV as well, adobe - standard for bdf - -Allow for BDF file with no specified encoding to be read as Adobe -Standard (per freetype's BDF driver), and handle any Unicode-equivalent -encoding without changing the encoding name. ---- - read.c | 26 ++++++++++++++++++++------ - 1 file changed, 20 insertions(+), 6 deletions(-) - -diff --git a/read.c b/read.c -index 5e80cc5..05f7b4f 100644 ---- a/read.c -+++ b/read.c -@@ -64,6 +64,7 @@ readFile(char *filename, FontPtr font) - StrikePtr strike; - BitmapPtr bitmap; - int symbol = 0; -+ int force_unicode = 1; - char *encoding_name = NULL; - FontMapPtr mapping = NULL; - FontMapReversePtr reverse = NULL; -@@ -79,13 +80,20 @@ readFile(char *filename, FontPtr font) - return -1; - } - -- /* FreeType will handle Unicode and automatically map ISO-8859-1 to -- * Unicode for us -- everything else needs a mapping */ -+ /* FreeType will insist on encodings which are simple subsets of unicode -+ * to be read as unicode regardless of what we call them. */ -+ for(j = 0; j < face->num_charmaps; ++j) { -+ if((face->charmaps[j]->encoding == ft_encoding_none) || -+ (face->charmaps[j]->encoding == ft_encoding_adobe_standard)) { -+ force_unicode = 0; -+ break; -+ } -+ } -+ - encoding_name = faceEncoding(face); - if(encoding_name == NULL) { - symbol = 1; -- } else if((strcasecmp(encoding_name, "iso10646-1") != 0) && -- (strcasecmp(encoding_name, "iso8859-1") != 0)) { -+ } else if(strcasecmp(encoding_name, "iso10646-1") != 0) { - if(reencode_flag) - mapping = FontEncMapFind(encoding_name, - FONT_ENCODING_UNICODE, 0, 0, NULL); -@@ -228,10 +236,16 @@ readFile(char *filename, FontPtr font) - return -1; - } - -- if(!symbol && !mapping) -+ if((!symbol && !mapping) || force_unicode) { - rc = FT_Select_Charmap(face, ft_encoding_unicode); -- else -+ } else { - rc = FT_Select_Charmap(face, ft_encoding_none); -+ if(rc != 0) { -+ /* BDF will default to Adobe Standard even for nonstandard -+ * encodings, so try that as a last resort. */ -+ rc = FT_Select_Charmap(face, ft_encoding_adobe_standard); -+ } -+ } - if(rc != 0) { - fprintf(stderr, "Couldn't select character map: %x.\n", rc); - return -1; --- -2.23.0 - diff --git a/0003-check-for-freetype-NULL-atoms.patch b/0003-check-for-freetype-NULL-atoms.patch deleted file mode 100644 index 7c28748beeed..000000000000 --- a/0003-check-for-freetype-NULL-atoms.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 6fc84fb2c0d4ac0b3b66330057bb90418cc1eb28 Mon Sep 17 00:00:00 2001 -From: Ryan Farley <ryan.farley@gmx.com> -Date: Fri, 30 Aug 2019 09:43:50 -0500 -Subject: [PATCH app/fonttosfnt] check for freetype NULL atoms - -Freetype uses NULL to represent an empty string when retrieving a BDF -property -- check for this in addition to an actual error ---- - util.c | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/util.c b/util.c -index 5a23eeb..bcbfa2f 100644 ---- a/util.c -+++ b/util.c -@@ -127,7 +127,7 @@ vsprintf_alloc(const char *f, va_list args) - } - #endif - --/* Build a UTF-16 string from a Latin-1 string. -+/* Build a UTF-16 string from a Latin-1 string. - Result is not NUL-terminated. */ - char * - makeUTF16(const char *string) -@@ -241,7 +241,7 @@ faceFoundry(FT_Face face) - BDF_PropertyRec prop; - - rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop); -- if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { -+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) { - if(strcasecmp(prop.u.atom, "adobe") == 0) - return makeName("ADBE"); - else if(strcasecmp(prop.u.atom, "agfa") == 0) -@@ -286,7 +286,7 @@ faceFoundry(FT_Face face) - /* For now */ - return makeName("UNKN"); - } -- -+ - - int - faceWeight(FT_Face face) -@@ -294,7 +294,7 @@ faceWeight(FT_Face face) - int rc; - BDF_PropertyRec prop; - rc = FT_Get_BDF_Property(face, "WEIGHT_NAME", &prop); -- if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { -+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) { - if(strcasecmp(prop.u.atom, "thin") == 0) - return 100; - else if(strcasecmp(prop.u.atom, "extralight") == 0) -@@ -323,7 +323,7 @@ faceWidth(FT_Face face) - int rc; - BDF_PropertyRec prop; - rc = FT_Get_BDF_Property(face, "SETWIDTH_NAME", &prop); -- if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { -+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) { - if(strcasecmp(prop.u.atom, "ultracondensed") == 0) - return 1; - else if(strcasecmp(prop.u.atom, "extracondensed") == 0) -@@ -360,7 +360,7 @@ faceItalicAngle(FT_Face face) - } - - rc = FT_Get_BDF_Property(face, "SLANT", &prop); -- if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { -+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) { - if(strcasecmp(prop.u.atom, "i") == 0 || - strcasecmp(prop.u.atom, "s") == 0) - return -30 * TWO_SIXTEENTH; -@@ -380,7 +380,7 @@ faceFlags(FT_Face face) - if(faceWeight(face) >= 650) - flags |= FACE_BOLD; - rc = FT_Get_BDF_Property(face, "SLANT", &prop); -- if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { -+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) { - if(strcasecmp(prop.u.atom, "i") == 0 || - strcasecmp(prop.u.atom, "s") == 0) - flags |= FACE_ITALIC; -@@ -400,10 +400,12 @@ faceEncoding(FT_Face face) - rc = FT_Get_BDF_Property(face, "CHARSET_ENCODING", &p2); - if(rc != 0 || p2.type != BDF_PROPERTY_TYPE_ATOM) - return NULL; -+ if(!(p1.u.atom && p2.u.atom)) -+ return NULL; - - return sprintf_alloc("%s-%s", p1.u.atom, p2.u.atom); - } -- -+ - int - degreesToFraction(int deg, int *num, int *den) - { --- -2.23.0 - diff --git a/0004-improve-guess-font-size.patch b/0004-improve-guess-font-size.patch deleted file mode 100644 index 4c4a16008360..000000000000 --- a/0004-improve-guess-font-size.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 060c2bb9f84071246a69af49ee3dee90f8524cba Mon Sep 17 00:00:00 2001 -From: Peng Wu <alexepico@gmail.com> -Date: Wed, 9 Oct 2019 14:20:22 +0800 -Subject: [PATCH] Improve guess font size when read bitmap font - ---- - read.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/read.c b/read.c -index 632c7e7..915fa86 100644 ---- a/read.c -+++ b/read.c -@@ -238,20 +238,20 @@ readFile(char *filename, FontPtr font) - if(verbose_flag) - fprintf(stderr, "size %d: %dx%d\n", - i, -- (int)(face->available_sizes[i].x_ppem >> 6), -- (int)(face->available_sizes[i].y_ppem >> 6)); -+ (int)((face->available_sizes[i].x_ppem + 32) >> 6), -+ (int)((face->available_sizes[i].y_ppem + 32) >> 6)); - - rc = FT_Set_Pixel_Sizes(face, -- face->available_sizes[i].x_ppem >> 6, -- face->available_sizes[i].y_ppem >> 6); -+ (face->available_sizes[i].x_ppem + 32) >> 6, -+ (face->available_sizes[i].y_ppem + 32) >> 6); - if(rc != 0) { - fprintf(stderr, "Couldn't set size.\n"); - return -1; - } - - strike = makeStrike(font, -- face->available_sizes[i].x_ppem >> 6, -- face->available_sizes[i].y_ppem >> 6); -+ (face->available_sizes[i].x_ppem + 32) >> 6, -+ (face->available_sizes[i].y_ppem + 32) >> 6); - if(strike == NULL) { - fprintf(stderr, "Couldn't allocate strike.\n"); - return -1; --- -2.22.0 - @@ -1,26 +1,18 @@ # Maintainer: Ryan Farley <ryan.farley@gmx.com> # Contributor: Andreas Bosch (progandy) <linux+aur@progandy.de> pkgname=fonttosfnt-git -pkgver=r83.c214ab0 +pkgver=r87.d06059e pkgrel=1 pkgdesc="Convert a set of bdf or pcf fonts into a bitmap only sfnt (otb)" arch=(x86_64) url="https://gitlab.freedesktop.org/xorg/app/fonttosfnt" license=('MIT') depends=(libfontenc freetype2) -makedepends=(git make autoconf automake xproto xorg-util-macros) +makedepends=(git make autoconf automake xorgproto xorg-util-macros) provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") -source=('git+https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git' - '0001-let-freetype-handle-ISO-8859-1-mapping.patch' - '0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch' - '0003-check-for-freetype-NULL-atoms.patch' - '0004-improve-guess-font-size.patch') -md5sums=('SKIP' - 'c9a2934334f46681f1a6131d4fd13077' - '1b542636d9a95d9bb6095c12aa20eb3a' - '9ba2b5498590e75859099cd57c970ac3' - '1152c9c998813c003df379813aac2c7c') +source=('git+https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git') +md5sums=('SKIP') pkgver() { cd "$srcdir/${pkgname%-git}" @@ -28,13 +20,6 @@ pkgver() { printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -prepare() { - cd "$srcdir/${pkgname%-git}" - patch --forward --strip=1 --input="$srcdir/0001-let-freetype-handle-ISO-8859-1-mapping.patch" - patch --forward --strip=1 --input="$srcdir/0002-allow-ISO-646.1991-IRV-as-well-adobe-standard-for-bd.patch" - patch --forward --strip=1 --input="$srcdir/0003-check-for-freetype-NULL-atoms.patch" -} - build() { cd "$srcdir/${pkgname%-git}" ./autogen.sh |