Hello community, here is the log from the commit of package fonttosfnt for openSUSE:Factory checked in at 2020-01-07 23:53:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fonttosfnt (Old) and /work/SRC/openSUSE:Factory/.fonttosfnt.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fonttosfnt" Tue Jan 7 23:53:46 2020 rev:8 rq:761498 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/fonttosfnt/fonttosfnt.changes 2018-08-18 00:06:33.063515046 +0200 +++ /work/SRC/openSUSE:Factory/.fonttosfnt.new.6675/fonttosfnt.changes 2020-01-07 23:54:11.144057232 +0100 @@ -1,0 +2,16 @@ +Tue Jan 7 09:38:28 UTC 2020 - Stefan Dirsch <[email protected]> + +- Update to version 1.1.0 + * Update README for gitlab migration + * Update configure.ac bug URL for gitlab migration + * Correct a string literal + * Mention .otb as an extension + * Accept a BDF font on stdin + * Avoid undefined behaviour + * Round font size to integer value when reading bitmap font + * Mark vsprintf_alloc as printf-like function + * check for freetype NULL atoms + * let freetype handle ISO-8859-1 mapping + * allow ISO-646.1991-IRV as well, adobe standard for bdf + +------------------------------------------------------------------- Old: ---- fonttosfnt-1.0.5.tar.bz2 New: ---- fonttosfnt-1.1.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fonttosfnt.spec ++++++ --- /var/tmp/diff_new_pack.MbkLo6/_old 2020-01-07 23:54:12.000057676 +0100 +++ /var/tmp/diff_new_pack.MbkLo6/_new 2020-01-07 23:54:12.004057678 +0100 @@ -1,7 +1,7 @@ # # spec file for package fonttosfnt # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: fonttosfnt -Version: 1.0.5 +Version: 1.1.0 Release: 0 Summary: Utility to wrap a bitmap font in a sfnt (TrueType) wrapper License: MIT @@ -49,7 +49,7 @@ %files %defattr(-,root,root) -%doc COPYING README +%doc COPYING README.md %{_bindir}/fonttosfnt %{_mandir}/man1/fonttosfnt.1%{?ext_man} ++++++ fonttosfnt-1.0.5.tar.bz2 -> fonttosfnt-1.1.0.tar.bz2 ++++++ ++++ 6464 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/ChangeLog new/fonttosfnt-1.1.0/ChangeLog --- old/fonttosfnt-1.0.5/ChangeLog 2018-08-01 00:45:58.000000000 +0200 +++ new/fonttosfnt-1.1.0/ChangeLog 2020-01-06 03:57:56.000000000 +0100 @@ -1,3 +1,116 @@ +commit 1d757ff6fa30079790fc44b141f6d0e4d5411f13 +Author: Peter Hutterer <[email protected]> +Date: Mon Jan 6 12:55:31 2020 +1000 + + Bump to 1.1.0 + + Signed-off-by: Peter Hutterer <[email protected]> + +commit bdcb892975de167b3d4258859234f0abe375f236 +Author: Jouke Witteveen <[email protected]> +Date: Fri Aug 2 14:03:15 2019 +0200 + + Accept a BDF font on stdin + + This makes it easier to transition from bdftopcf. + Although an OTB file could include fonts from multiple BDF sources, that + functionality is not currently implemented for fonts read from stdin. + + Signed-off-by: Jouke Witteveen <[email protected]> + +commit 0006f577898129c0c5d5e0996026641605705e08 +Author: Jouke Witteveen <[email protected]> +Date: Fri Aug 2 11:43:56 2019 +0200 + + Mention .otb as an extension + + The OTB (OpenType Bitmap) extension has found some traction, so suggest + that. + + Signed-off-by: Jouke Witteveen <[email protected]> + +commit cb4b8760f829040eb4b2fb314df5b6194230a237 +Author: Jouke Witteveen <[email protected]> +Date: Fri Aug 2 11:41:59 2019 +0200 + + Correct a string literal + + Signed-off-by: Jouke Witteveen <[email protected]> + +commit d06059ef2a85df3c70f3c0b77364b4c49837f331 +Author: Peng Wu <[email protected]> +Date: Wed Oct 9 14:20:22 2019 +0800 + + Round font size to integer value when reading bitmap font + + Some fonts have a ppem value like 11.9, this patch adds integer rounding to + convert those ppem value to 12 instead of 11. + +commit cfb4d64e1b90a28693fd700f4abf0f55d969f4f6 +Author: Ryan Farley <[email protected]> +Date: Sat Aug 31 06:42:24 2019 -0500 + + 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. + +commit 5d446a02a7422d3a61f74b8d1c28b7b551ea06fd +Author: Ryan Farley <[email protected]> +Date: Tue Aug 20 03:16:22 2019 -0500 + + 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. + +commit 6fc84fb2c0d4ac0b3b66330057bb90418cc1eb28 +Author: Ryan Farley <[email protected]> +Date: Fri Aug 30 09:43:50 2019 -0500 + + 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 + +commit c214ab0d7deae30acdf90933ed14b223118dcf67 +Author: Maya Rashish <[email protected]> +Date: Thu Jan 10 20:49:28 2019 +0200 + + Avoid undefined behaviour + + Left shifting a negative is undefined. + For consistency, use the equivalent form of multiplication for the + positive numbers as well. + +commit 8e34a2aa7c4dea5aa07dc08a40dacd90e2148a89 +Author: Alan Coopersmith <[email protected]> +Date: Wed Nov 21 16:46:19 2018 -0800 + + Update configure.ac bug URL for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 46d4900c2dbed1c7a632dc34a4ef952a9cdda8eb +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 16 19:53:06 2018 -0800 + + Update README for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit ec6f334152badff475d2a8c465dfdbf740f148d0 +Author: Peter Hutterer <[email protected]> +Date: Wed Oct 31 14:37:24 2018 +1000 + + Mark vsprintf_alloc as printf-like function + + Signed-off-by: Peter Hutterer <[email protected]> + Reviewed-by: Eric Anholt <[email protected]> + commit 7f8d7ecf0379ebc5386ee27f385a2ca564d6decb Author: Peter Hutterer <[email protected]> Date: Tue Jul 31 11:36:54 2018 +1000 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/Makefile.am new/fonttosfnt-1.1.0/Makefile.am --- old/fonttosfnt-1.0.5/Makefile.am 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/Makefile.am 2020-01-06 03:57:50.000000000 +0100 @@ -49,3 +49,5 @@ $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL + +EXTRA_DIST = README.md diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/README new/fonttosfnt-1.1.0/README --- old/fonttosfnt-1.0.5/README 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -fonttosfnt wraps a set of bdf or pcf bitmap fonts in a sfnt (TrueType or -OpenType) wrapper. - -All questions regarding this software should be directed at the -Xorg mailing list: - - http://lists.freedesktop.org/mailman/listinfo/xorg - -Please submit bug reports to the Xorg bugzilla: - - https://bugs.freedesktop.org/enter_bug.cgi?product=xorg - -The master development code repository can be found at: - - https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git - -For patch submission instructions, see: - - http://www.x.org/wiki/Development/Documentation/SubmittingPatches - -For more information on the git code manager, see: - - http://wiki.x.org/wiki/GitPage - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/README.md new/fonttosfnt-1.1.0/README.md --- old/fonttosfnt-1.0.5/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/fonttosfnt-1.1.0/README.md 2020-01-06 03:57:50.000000000 +0100 @@ -0,0 +1,16 @@ +fonttosfnt wraps a set of bdf or pcf bitmap fonts in a sfnt (TrueType or +OpenType) wrapper. + +All questions regarding this software should be directed at the +Xorg mailing list: + + https://lists.x.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git + +For patch submission instructions, see: + + https://www.x.org/wiki/Development/Documentation/SubmittingPatches + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/compile new/fonttosfnt-1.1.0/compile --- old/fonttosfnt-1.0.5/compile 2018-08-01 00:45:55.000000000 +0200 +++ new/fonttosfnt-1.1.0/compile 2020-01-06 03:57:53.000000000 +0100 @@ -1,9 +1,9 @@ -#!/bin/sh +#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -340,7 +340,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/configure.ac new/fonttosfnt-1.1.0/configure.ac --- old/fonttosfnt-1.0.5/configure.ac 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/configure.ac 2020-01-06 03:57:50.000000000 +0100 @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT(fonttosfnt,[1.0.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],fonttosfnt) +AC_INIT(fonttosfnt,[1.1.0], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/fonttosfnt.c new/fonttosfnt-1.1.0/fonttosfnt.c --- old/fonttosfnt-1.0.5/fonttosfnt.c 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/fonttosfnt.c 2020-01-06 03:57:50.000000000 +0100 @@ -39,8 +39,8 @@ { fprintf(stderr, "Usage:\n"); fprintf(stderr, - "fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.ttf " - "[ -- ] font ...\n"); + "fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.otb " + "[ -- ] [ font ] ...\n"); } int @@ -106,7 +106,11 @@ font = makeFont(); - while(i < argc) { + if(i == argc) { + rc = readFile(NULL, font); + if(rc != 0) + exit(1); + } else while(i < argc) { rc = readFile(argv[i], font); if(rc != 0) exit(1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/man/fonttosfnt.man new/fonttosfnt-1.1.0/man/fonttosfnt.man --- old/fonttosfnt-1.0.5/man/fonttosfnt.man 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/man/fonttosfnt.man 2020-01-06 03:57:50.000000000 +0100 @@ -1,21 +1,23 @@ .\" $XFree86$ .TH FONTTOSFNT 1 __vendorversion__ .SH NAME -fonttosfnt \- Wrap a bitmap font in a sfnt (TrueType) wrapper +fonttosfnt \- Wrap a bitmap font in a sfnt (OpenType) wrapper .SH SYNOPSIS .B fonttosfnt [ .I options ] .B \-o -.I file.ttf +.I file.otb [ .B \-\- -] -.IR font ... +] [ +.IR font +] ... .SH DESCRIPTION Wrap a bitmap font or a set of bitmap fonts in a sfnt (TrueType or OpenType) wrapper. +If no font is specified, a BDF font is read from standard input (stdin). .SH OPTIONS .TP .B \-v diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/missing new/fonttosfnt-1.1.0/missing --- old/fonttosfnt-1.0.5/missing 2018-08-01 00:45:55.000000000 +0200 +++ new/fonttosfnt-1.1.0/missing 2020-01-06 03:57:53.000000000 +0100 @@ -1,9 +1,9 @@ -#!/bin/sh +#! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/read.c new/fonttosfnt-1.1.0/read.c --- old/fonttosfnt-1.0.5/read.c 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/read.c 2020-01-06 03:57:50.000000000 +0100 @@ -27,6 +27,7 @@ #include <ft2build.h> #include FT_FREETYPE_H +#include FT_MODULE_H #include FT_BDF_H #include "X11/Xos.h" #include "fonttosfnt.h" @@ -36,6 +37,8 @@ #define CEIL2(x, y) (FLOOR2((x) + (y) - 1, (y))) #define FT_Pos_DOWN(x) (FLOOR2((x),64)) #define FT_Pos_UP(x) (CEIL2((x), 64)) +#define MIN(x, y) (((x) <= (y)) ? (x) : (y)) +#define STREAM_FILE(stream) ((FILE*)stream->descriptor.pointer) static int ft_inited = 0; static FT_Library ft_library; @@ -55,15 +58,50 @@ return 0; } +static unsigned long +forwardRead(FT_Stream stream, unsigned long offset, unsigned char *buffer, + unsigned long count) { + unsigned char skip_buffer[BUFSIZ]; + unsigned long skip_count; + FILE *file = STREAM_FILE(stream); + + /* We may be asked to skip forward, but by not doing so we increase our + chance of survival. */ + if(count == 0) + return ferror(file) == 0 ? 0 : 1; + + if(offset < stream->pos) { + fprintf(stderr, "Cannot move backward in input stream.\n"); + return 0; + } + while((skip_count = MIN(BUFSIZ, offset - stream->pos))) { + if(fread(skip_buffer, sizeof(*skip_buffer), skip_count, file) < + skip_count) + return 0; + stream->pos += sizeof(*skip_buffer) * skip_count; + } + + return (unsigned long)fread(buffer, sizeof(*buffer), count, file); +} + +static void +streamClose(FT_Stream stream) { + fclose(STREAM_FILE(stream)); + stream->descriptor.pointer = NULL; + stream->size = 0; +} + int readFile(char *filename, FontPtr font) { int j, k, index; int rc; + FT_Open_Args input = { 0 }; FT_Face face; StrikePtr strike; BitmapPtr bitmap; int symbol = 0; + int force_unicode = 1; char *encoding_name = NULL; FontMapPtr mapping = NULL; FontMapReversePtr reverse = NULL; @@ -73,12 +111,38 @@ if(rc != 0) return rc; - rc = FT_New_Face(ft_library, filename, 0, &face); + if(filename != NULL) { + input.pathname = filename; + input.flags = FT_OPEN_PATHNAME; + } else { + input.flags = FT_OPEN_STREAM | FT_OPEN_DRIVER; + input.driver = FT_Get_Module(ft_library, "bdf"); + input.stream = calloc(1, sizeof(FT_StreamRec)); + if(input.stream == NULL) + return -1; + + input.stream->size = 0x7FFFFFFF; + input.stream->descriptor.pointer = stdin; + input.stream->read = forwardRead; + input.stream->close = streamClose; + } + rc = FT_Open_Face(ft_library, &input, 0, &face); if(rc != 0) { - fprintf(stderr, "Couldn't open face %s.\n", filename); + fprintf(stderr, "Couldn't open face %s.\n", + filename ? filename : "<stdin>"); return -1; } + /* 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; @@ -99,8 +163,8 @@ if(verbose_flag) { fprintf(stderr, "%s %s %s: %d sizes%s\n", - filename, face->family_name, face->style_name, - face->num_fixed_sizes, + filename ? filename : "<stdin>", + face->family_name, face->style_name, face->num_fixed_sizes, symbol ? " (symbol)" : ""); } @@ -185,7 +249,7 @@ font->names[i].size = 2 * strlen(XVENDORNAMESHORT " converted bitmap font"); font->names[i].value = makeUTF16(XVENDORNAMESHORT - "X converted bitmap font"); + " converted bitmap font"); i++; #ifdef __VENDORWEBSUPPORT__ font->names[i].nid = 11; @@ -225,10 +289,16 @@ 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; @@ -238,20 +308,20 @@ 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; @@ -292,6 +362,7 @@ } FT_Done_Face(face); + free(input.stream); j = 0; for(int i = 0; i < FONT_CODES; i++) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/struct.c new/fonttosfnt-1.1.0/struct.c --- old/fonttosfnt-1.0.5/struct.c 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/struct.c 2020-01-06 03:57:50.000000000 +0100 @@ -491,8 +491,8 @@ { int i, rc; int max_awidth = 0; - int min_x = 10000 << 16, min_y = 10000 << 16; - int max_x = -10000 << 16, max_y = -10000 << 16; + int min_x = 10000 * 65536, min_y = 10000 * 65536; + int max_x = -10000 * 65536, max_y = -10000 * 65536; for(i = 0; i < FONT_CODES; i++) { int awidth, x0, y0, x1, y1; rc = glyphMetrics(font, i, &awidth, &x0, &y0, &x1, &y1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/fonttosfnt-1.0.5/util.c new/fonttosfnt-1.1.0/util.c --- old/fonttosfnt-1.0.5/util.c 2018-08-01 00:45:52.000000000 +0200 +++ new/fonttosfnt-1.1.0/util.c 2020-01-06 03:57:50.000000000 +0100 @@ -37,6 +37,7 @@ #include FT_FREETYPE_H #include FT_BDF_H #include "X11/Xos.h" +#include "X11/Xfuncproto.h" /* for _X_ATTRIBUTE_PRINTF */ #include "fonttosfnt.h" #ifdef NEED_SNPRINTF @@ -80,6 +81,7 @@ } #if HAVE_VASPRINTF +_X_ATTRIBUTE_PRINTF(1, 0) char* vsprintf_alloc(const char *f, va_list args) { @@ -92,6 +94,7 @@ return r; } #else +_X_ATTRIBUTE_PRINTF(1, 0) char* vsprintf_alloc(const char *f, va_list args) { @@ -124,7 +127,7 @@ } #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) @@ -238,7 +241,7 @@ 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) @@ -283,7 +286,7 @@ /* For now */ return makeName("UNKN"); } - + int faceWeight(FT_Face face) @@ -291,7 +294,7 @@ 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) @@ -320,7 +323,7 @@ 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) @@ -357,7 +360,7 @@ } 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; @@ -377,7 +380,7 @@ 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; @@ -397,10 +400,12 @@ 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) {
