Hello community, here is the log from the commit of package mkfontscale for openSUSE:Factory checked in at 2019-03-21 09:50:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mkfontscale (Old) and /work/SRC/openSUSE:Factory/.mkfontscale.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mkfontscale" Thu Mar 21 09:50:54 2019 rev:11 rq:681129 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/mkfontscale/mkfontscale.changes 2018-09-20 11:39:59.360908302 +0200 +++ /work/SRC/openSUSE:Factory/.mkfontscale.new.28833/mkfontscale.changes 2019-03-21 09:50:55.926827281 +0100 @@ -1,0 +2,9 @@ +Sun Mar 3 09:54:43 UTC 2019 - Stefan Dirsch <[email protected]> + +- Update to version 1.2.0 + * Starting with this release, 1.2.0, it now includes the + mkfontdir script previously distributed separately for + compatibility with older X11 versions. +- provide/obsolete mkfontdir package + +------------------------------------------------------------------- Old: ---- mkfontscale-1.1.3.tar.bz2 New: ---- mkfontscale-1.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkfontscale.spec ++++++ --- /var/tmp/diff_new_pack.omApgd/_old 2019-03-21 09:50:57.226826930 +0100 +++ /var/tmp/diff_new_pack.omApgd/_new 2019-03-21 09:50:57.250826923 +0100 @@ -1,7 +1,7 @@ # # spec file for package mkfontscale # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 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 @@ -17,7 +17,7 @@ Name: mkfontscale -Version: 1.1.3 +Version: 1.2.0 Release: 0 Summary: Utility to create index of scalable font files for X License: MIT @@ -33,6 +33,8 @@ # This was part of the xorg-x11 package up to version 7.6 Conflicts: xorg-x11 <= 7.6 Recommends: xorg-x11-fonts-core +Provides: mkfontdir = 1.0.7 +Obsoletes: mkfontdir <= 1.0.7 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -51,8 +53,10 @@ %files %defattr(-,root,root) -%doc ChangeLog COPYING README +%doc ChangeLog COPYING README.md +%{_bindir}/mkfontdir %{_bindir}/mkfontscale +%{_mandir}/man1/mkfontdir.1%{?ext_man} %{_mandir}/man1/mkfontscale.1%{?ext_man} %changelog ++++++ mkfontscale-1.1.3.tar.bz2 -> mkfontscale-1.2.0.tar.bz2 ++++++ ++++ 4243 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/mkfontscale-1.1.3/COPYING new/mkfontscale-1.2.0/COPYING --- old/mkfontscale-1.1.3/COPYING 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/COPYING 2019-03-02 23:21:39.000000000 +0100 @@ -38,3 +38,51 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----------------------------------------------------------------------------- + +Copyright 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +----------------------------------------------------------------------------- + +Copyright 2005 Red Hat, Inc. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Red Hat not be used in +advertising or publicity pertaining to distribution of the software +without specific, written prior permission. Red Hat makes no +representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. + +RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. 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/mkfontscale-1.1.3/ChangeLog new/mkfontscale-1.2.0/ChangeLog --- old/mkfontscale-1.1.3/ChangeLog 2018-03-07 08:00:35.000000000 +0100 +++ new/mkfontscale-1.2.0/ChangeLog 2019-03-02 23:21:50.000000000 +0100 @@ -1,3 +1,419 @@ +commit 8fbafcfe7e5ef4a2030e3963f31143bba2c8786f +Author: Alan Coopersmith <[email protected]> +Date: Sat Mar 2 14:16:48 2019 -0800 + + mkfontscale 1.2.0 + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit bef1c614465f2c8546a7d946a75d8f10c5f3ca40 +Author: Alan Coopersmith <[email protected]> +Date: Tue Feb 19 11:45:29 2019 -0800 + + Add mkfontdir to .gitignore + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 1f9d14bec07092d62da29a5a233cefbf84d47289 +Author: Alan Coopersmith <[email protected]> +Date: Mon Feb 18 18:27:31 2019 -0800 + + Use autoconf instead of sed to substitute @bindir@ in mkfontdir.in + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit d3b0f267bd25ab888efc0417f62d525afa32208a +Author: Alan Coopersmith <[email protected]> +Date: Mon Feb 18 18:23:50 2019 -0800 + + Add mkfontdir to README.md + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 270540bb11914ea92436e251b14bc39d6b5df589 +Author: Jeremy Huddleston <[email protected]> +Date: Thu Oct 6 10:29:42 2011 -0700 + + mkfontdir: Fix issues where mkfontscale and mkfontdir are installed in different locations or bindir contains a space + + https://bugs.freedesktop.org/show_bug.cgi?id=24465 + + Signed-off-by: Jeremy Huddleston <[email protected]> + +commit cfbeaa0b99944ab887b4854baa63eadd4e5481f5 +Author: Jon TURNEY <[email protected]> +Date: Tue Mar 15 11:55:11 2011 +0000 + + mkfontdir: Fix for non-srcdir builds + + Fix commit ad5fefcc7a0a0beb1c02270d9f28c8b28da61199 for non-srcdir builds + + Signed-off-by: Jon TURNEY <[email protected]> + Reviewed-by: Alan Coopersmith <[email protected]> + +commit 758df83c5825b77f338e44c1fcc4c5070d3c3516 +Author: Alan Coopersmith <[email protected]> +Date: Fri Mar 11 14:10:19 2011 -0800 + + mkfontdir: Make Makefile.am compatible with Solaris make + + Solaris make won't substitute $< in explicit rules, only implicit ones + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 8290027e067ffd0a3f37eeafbd27121e2884cea4 +Author: Gaetan Nadon <[email protected]> +Date: Sat Jan 22 09:27:09 2011 -0500 + + mkfontdir: config: substitute bindir in mkfontdir using Autoconf @bindir@ + + Use the Autoconf recommended way of substituting bindir, see + http://www.gnu.org/software/autoconf/manual/autoconf.html + + Use # sign for comment in script. + Only sed is used, drop the cpp terminology. + + Reviewed-by: Rémi Cardona <[email protected]> + Signed-off-by: Gaetan Nadon <[email protected]> + +commit 07d71396a502515a02bd12c5b01cdd98a7a30dab +Author: Gaetan Nadon <[email protected]> +Date: Wed Jan 19 10:06:55 2011 -0500 + + mkfontdir: config: move man pages into their own directory + + Use services provided by XORG_MANPAGE_SECTIONS. + Use standard Makefile for man pages. + + Signed-off-by: Gaetan Nadon <[email protected]> + +commit 91cae6761d1a1eb9e5e2eba9eea8d7be6e3993d1 +Author: Gaetan Nadon <[email protected]> +Date: Thu Jan 13 11:15:47 2011 -0500 + + mkfontdir: man: remove trailing spaces and tabs + + Using s/[ \t]*$// + + Signed-off-by: Gaetan Nadon <[email protected]> + +commit 7bb2d75a9f00546178f16fd536946fe1bdabdebb +Author: Alan Coopersmith <[email protected]> +Date: Sun Nov 7 11:14:14 2010 -0800 + + mkfontdir: Drop CVS version tag from mkfontdir.cpp too + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit b1e80a29150c90c39915e5e758262815c2c4da05 +Author: Alan Coopersmith <[email protected]> +Date: Sun Nov 7 11:10:09 2010 -0800 + + mkfontdir: config: Remove unnecessary calls from configure.ac + + AC_PROG_SED & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit daee1aa67b7b11b2d4f9e38ddc39603e9206557a +Author: Jesse Adkins <[email protected]> +Date: Tue Sep 28 13:29:49 2010 -0700 + + mkfontdir: Purge cvs tags. + + Signed-off-by: Jesse Adkins <[email protected]> + +commit 43d1aae1b0e1f9f759fe3439aa2079a88dab03af +Author: Alan Coopersmith <[email protected]> +Date: Sat Oct 10 22:47:09 2009 -0700 + + mkfontdir: Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 2dac61a84d474e533df29b5874ce6ca5e68d4ddd +Author: Alan Coopersmith <[email protected]> +Date: Fri Jan 11 12:40:52 2008 -0800 + + mkfontdir: Fix formatting of man page so ellipsis are shown with Solaris nroff + +commit 8609ad731b9c9c670a815c915055ae416d2396d8 +Author: Alan Coopersmith <[email protected]> +Date: Fri Jan 11 12:39:00 2008 -0800 + + mkfontdir: Fill in COPYING file with copyright/license notices + +commit 18654870df3e8c65abc4443a0f510abd46c5fbaa +Author: Alan Coopersmith <[email protected]> +Date: Mon Jan 7 14:16:07 2008 -0800 + + mkfontdir: Add references to mkfontscale to man page + + Also convert (1) to (__appmansuffix__) + +commit 1d15009075c3d316bd54c5861ac2859330ab2e64 +Author: Matthieu Herrb <[email protected]> +Date: Sun Mar 5 19:52:51 2006 +0000 + + mkfontdir: Let BSD make find mkfontdir.cpp when building in a separate obj dir + +commit 1cb06c20467030fddf6a0a7be855f6849cadf7b4 +Author: Adam Jackson <[email protected]> +Date: Tue Aug 2 01:58:09 2005 +0000 + + mkfontdir: Find mkfontscale through @bindir@ rather than AC_PATH_PROG, since the one in the path could be from an old install that doesn't support all the needed flags. + +commit a8341c3f17050b253a9f55aba76f1d8437165c26 +Author: Matthieu Herrb <[email protected]> +Date: Thu Jul 14 20:59:48 2005 +0000 + + mkfontdir: build fix for non-GNU make + +commit fa554ab53809943cb141e07687c96364d91e3f9c +Author: Kevin E Martin <[email protected]> +Date: Sat Jul 2 21:42:05 2005 +0000 + + mkfontdir: Add build system for bdftopcf, mkfontdir and mkfontscale + +commit c40a94766668aad01ef57eea181752a370762cd0 +Author: Egbert Eich <[email protected]> +Date: Fri Apr 23 19:54:36 2004 +0000 + + mkfontdir: Merging XORG-CURRENT into trunk + +commit 1a302e07687403c0be7452d865d20e4cb0761770 +Author: Egbert Eich <[email protected]> +Date: Sun Mar 14 08:34:54 2004 +0000 + + mkfontdir: Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit c01032201686db5622b4f997d5294d724800c694 +Author: Egbert Eich <[email protected]> +Date: Wed Mar 3 12:12:53 2004 +0000 + + mkfontdir: Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit 3a6aebdfeb88dd8501d715117990af646f687555 +Author: Egbert Eich <[email protected]> +Date: Thu Feb 26 13:36:15 2004 +0000 + + mkfontdir: readding XFree86's cvs IDs + +commit fa75fa1a5d7c1599692d4e309c39fca34b2a0f84 +Author: Egbert Eich <[email protected]> +Date: Thu Feb 26 09:23:56 2004 +0000 + + mkfontdir: Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit 9b6d7d062c91a86e110eea7ed38d44e104463fba +Author: Kaleb Keithley <[email protected]> +Date: Tue Nov 25 19:29:02 2003 +0000 + + mkfontdir: Initial revision + +commit 2247072a89b7b9da8ed22d0aaec100cef3adb62d +Author: Kaleb Keithley <[email protected]> +Date: Fri Nov 14 16:48:57 2003 +0000 + + mkfontdir: XFree86 4.3.0.1 + +commit 1b920768b5122bac7368860fd6fc7e4f5275ed8f +Author: Kaleb Keithley <[email protected]> +Date: Fri Nov 14 15:54:53 2003 +0000 + + mkfontdir: R6.6 is the Xorg base-line + +commit 0a20abea3ec9742f0982e043e725cdadf0fc493e +Author: Alan Coopersmith <[email protected]> +Date: Sun Jan 6 14:26:00 2019 -0800 + + Clear some -Wshorten-64-to-32 warnings from clang 6 + + ident.c:84:13: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + int n = strlen(filename); + ~ ^~~~~~~~~~~~~~~~ + ident.c:130:9: warning: implicit conversion loses integer precision: + 'off64_t' (aka 'long') to 'int' [-Wshorten-64-to-32] + return gzseek(ff->f.gz, offset, whence); + ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ident.c:140:17: warning: implicit conversion loses integer precision: + 'long' to 'int' [-Wshorten-64-to-32] + n = offset - ff->pos; + ~ ~~~~~~~^~~~~~~~~ + ident.c:143:10: warning: implicit conversion loses integer precision: + 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] + n = offset; + ~ ^~~~~~ + ident.c:156:12: warning: implicit conversion loses integer precision: + 'off_t' (aka 'long') to 'unsigned int' [-Wshorten-64-to-32] + ff->pos = offset; + ~ ^~~~~~ + ident.c:157:9: warning: implicit conversion loses integer precision: + 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] + return offset; + ~~~~~~ ^~~~~~ + mkfontscale.c:704:13: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + int n = strlen(dirname); + ~ ^~~~~~~~~~~~~~~ + mkfontscale.c:748:13: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + int n = strlen(filename); + ~ ^~~~~~~~~~~~~~~~ + mkfontscale.c:794:14: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + xl = strlen (exclusionSuffix); + ~ ^~~~~~~~~~~~~~~~~~~~~~~~ + mkfontscale.c:796:9: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + i = strlen(dirname_given); + ~ ^~~~~~~~~~~~~~~~~~~~~ + mkfontscale.c:858:15: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + int dl = strlen (entry->d_name); + ~~ ^~~~~~~~~~~~~~~~~~~~~~ + mkfontscale.c:930:21: warning: implicit conversion loses integer precision: + 'unsigned long' to 'int' [-Wshorten-64-to-32] + int l = strlen(xlfd_name); + ~ ^~~~~~~~~~~~~~~~~ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit a311033403730db56bbbd0c56977e6c49a6b5519 +Author: Alan Coopersmith <[email protected]> +Date: Sun Jan 6 13:33:42 2019 -0800 + + Clear some -Wsign-compare warnings from gcc 7 + + mkfontscale.c: In function ‘getName’: + mkfontscale.c:336:22: warning: comparison between signed and unsigned + integer expressions [-Wsign-compare] + for(i = 0; i < name.string_len / 2; i++) { + ^ + mkfontscale.c: In function ‘nameWidth’: + mkfontscale.c:427:18: warning: comparison between signed and unsigned + integer expressions [-Wsign-compare] + for(i = 0; i < NUMWIDTHS; i++) + ^ + mkfontscale.c: In function ‘notice_foundry’: + mkfontscale.c:1261:18: warning: comparison between signed and unsigned + integer expressions [-Wsign-compare] + for(i = 0; i < countof(notice_foundries); i++) + ^ + mkfontscale.c: In function ‘vendor_foundry’: + mkfontscale.c:1285:18: warning: comparison between signed and unsigned + integer expressions [-Wsign-compare] + for(i = 0; i < countof(vendor_foundries); i++) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit d971bb62c6d2a35eccfdcd0c3c6c65c4f841f556 +Author: Thomas Klausner <[email protected]> +Date: Mon Jul 27 23:16:45 2015 +0200 + + Add new ConstList functions and use them. + + Gets rid of lots of const warnings. + + Signed-off-by: Thomas Klausner <[email protected]> + +commit bd8ff8a513d928878c877ea7b448baf7aee003a3 +Author: Alan Coopersmith <[email protected]> +Date: Wed Nov 21 16:49:31 2018 -0800 + + Update configure.ac bug URL for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 17dec8c3c2805707767a2e416358db860b2b2427 +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 16 20:25:32 2018 -0800 + + Update README for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit eac885fa5ebff24e0839144863872443a010d7c2 +Author: Alan Coopersmith <[email protected]> +Date: Mon Oct 1 21:24:45 2018 -0700 + + Stop shadowing 'found' in checkExtraEncoding() + + mkfontscale.c: In function ‘checkExtraEncoding’: + mkfontscale.c:1220:17: warning: declaration of ‘found’ shadows a parameter [-Wshadow] + int found = 0; + ^~~~~ + mkfontscale.c:1214:59: note: shadowed declaration is here + checkExtraEncoding(FT_Face face, char *encoding_name, int found) + ^~~~~ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 325621bd083236567bd861d41ff161313fc96e96 +Author: Alan Coopersmith <[email protected]> +Date: Mon Oct 1 21:19:58 2018 -0700 + + Rename variable 'n' to avoid shadowing another 'n' in doDirectory + + mkfontscale.c: In function ‘doDirectory’: + mkfontscale.c:928:17: warning: declaration of ‘n’ shadows a previous local [-Wshadow] + int n = strlen(xlfd_name); + ^ + mkfontscale.c:788:12: note: shadowed declaration is here + int i, n, dirn, diri, found, rc; + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 0faf882de6de6c1ec26aace9a9939914b40e7b89 +Author: Alan Coopersmith <[email protected]> +Date: Mon Oct 1 21:10:59 2018 -0700 + + Use vasprintf(), if available, to implement dsprintf() + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 3b747cc5d2981c44ff517f64c355e76d70194f24 +Author: Alan Coopersmith <[email protected]> +Date: Mon Oct 1 20:52:18 2018 -0700 + + Replace dsprintf("%s", s) with strdup(s) + + dsprintf is an allocating sprintf. With a format string of "%s", it + reduces to just being a more complicated version of strdup, so lets + just use strdup instead to save time and reduce complexity. + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 65fe4ef6f5674b0b52e797924990b090dbbd52af +Author: Alan Coopersmith <[email protected]> +Date: Mon Oct 1 20:48:21 2018 -0700 + + Remove last use of strcat + + If getcwd returned a string that exactly filled the prefix buffer, + it could write the null terminator byte out of bounds. + + Instead, since the prefix is copied to a newly allocated string and + never used again, just let the dsprintf() call take care of it. + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 7b4203577af4b835ef069e0cd2bd9510b599789c +Author: Bernhard M. Wiedemann <[email protected]> +Date: Mon Sep 10 10:17:52 2018 +0200 + + Sort input file list + + so that openSUSE's installation-images builds in a reproducible way + in spite of indeterministic filesystem readdir order + + See https://reproducible-builds.org/ for why this is good. + + Signed-off-by: Bernhard M. Wiedemann <[email protected]> + commit 4b1d7d3af1c1bc1586b2e9a780aea0dee7df5a14 Author: Alan Coopersmith <[email protected]> Date: Tue Mar 6 22:57:01 2018 -0800 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/mkfontscale-1.1.3/Makefile.am new/mkfontscale-1.2.0/Makefile.am --- old/mkfontscale-1.1.3/Makefile.am 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/Makefile.am 2019-03-02 23:21:39.000000000 +0100 @@ -21,12 +21,15 @@ SUBDIRS = man bin_PROGRAMS = mkfontscale +bin_SCRIPTS = mkfontdir AM_CPPFLAGS = @MKFONTSCALE_CFLAGS@ @X11_CFLAGS@ -D_BSD_SOURCE AM_CFLAGS = $(CWARNFLAGS) mkfontscale_LDADD = @MKFONTSCALE_LIBS@ mkfontscale_SOURCES = \ + constlist.c \ + constlist.h \ data.h \ hash.c \ hash.h \ @@ -55,3 +58,5 @@ lint: $(LINT) $(ALL_LINT_FLAGS) $(mkfontscale_SOURCES) endif LINT + +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/mkfontscale-1.1.3/README new/mkfontscale-1.2.0/README --- old/mkfontscale-1.1.3/README 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -mkfontscale creates the fonts.scale and fonts.dir index files used by the -legacy X11 font system. - -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: - - git://anongit.freedesktop.org/git/xorg/app/mkfontscale - - http://cgit.freedesktop.org/xorg/app/mkfontscale - -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/mkfontscale-1.1.3/README.md new/mkfontscale-1.2.0/README.md --- old/mkfontscale-1.1.3/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/mkfontscale-1.2.0/README.md 2019-03-02 23:21:39.000000000 +0100 @@ -0,0 +1,19 @@ +mkfontscale creates the fonts.scale and fonts.dir index files used by the +legacy X11 font system. It now includes the mkfontdir script previously +distributed separately for compatibility with older X11 versions. + +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/mkfontscale + +Please submit bug reports and requests to merge patches there. + +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/mkfontscale-1.1.3/config.h.in new/mkfontscale-1.2.0/config.h.in --- old/mkfontscale-1.1.3/config.h.in 2018-03-07 08:00:28.000000000 +0100 +++ new/mkfontscale-1.2.0/config.h.in 2019-03-02 23:21:43.000000000 +0100 @@ -33,6 +33,9 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + /* Name of package */ #undef PACKAGE 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/mkfontscale-1.1.3/configure.ac new/mkfontscale-1.2.0/configure.ac --- old/mkfontscale-1.1.3/configure.ac 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/configure.ac 2019-03-02 23:21:39.000000000 +0100 @@ -22,8 +22,8 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([mkfontscale], [1.1.3], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], +AC_INIT([mkfontscale], [1.2.0], + [https://gitlab.freedesktop.org/xorg/app/mkfontscale/issues], [mkfontscale]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) @@ -51,6 +51,9 @@ AC_DEFINE(X_BZIP2_FONT_COMPRESSION,1,[Support bzip2 for bitmap fonts]) fi +# Checks for system functions / libraries +AC_CHECK_FUNCS([vasprintf]) + # Checks for pkg-config packages PKG_CHECK_MODULES(MKFONTSCALE, fontenc freetype2) PKG_CHECK_MODULES(X11, [xproto >= 7.0.25]) @@ -60,5 +63,6 @@ AC_CONFIG_FILES([ Makefile + mkfontdir man/Makefile]) AC_OUTPUT 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/mkfontscale-1.1.3/constlist.c new/mkfontscale-1.2.0/constlist.c --- old/mkfontscale-1.1.3/constlist.c 1970-01-01 01:00:00.000000000 +0100 +++ new/mkfontscale-1.2.0/constlist.c 2019-03-02 23:21:39.000000000 +0100 @@ -0,0 +1,93 @@ +/* + Copyright (c) 2002-2003 by Juliusz Chroboczek + Copyright (c) 2015 by Thomas Klausner + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#include <stdlib.h> +#include "constlist.h" + +ConstListPtr +appendConstList(ConstListPtr first, ConstListPtr second) +{ + ConstListPtr current; + + if(second == NULL) + return first; + + if(first == NULL) + return second; + + for(current = first; current->next; current = current->next) + ; + + current->next = second; + return first; +} + +ConstListPtr +makeConstList(const char **a, int n, ConstListPtr old, int begin) +{ + ConstListPtr first, current, next; + int i; + + if(n == 0) + return old; + + first = malloc(sizeof(ConstListRec)); + if(!first) + return NULL; + + first->value = a[0]; + first->next = NULL; + + current = first; + for(i = 1; i < n; i++) { + next = malloc(sizeof(ConstListRec)); + if(!next) { + destroyConstList(first); + return NULL; + } + next->value = a[i]; + next->next = NULL; + + current->next = next; + current = next; + } + if(begin) { + current->next = old; + return first; + } else { + return appendConstList(old, first); + } +} + +void +destroyConstList(ConstListPtr old) +{ + ConstListPtr next; + if(!old) + return; + while(old) { + next = old->next; + free(old); + old = next; + } +} 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/mkfontscale-1.1.3/constlist.h new/mkfontscale-1.2.0/constlist.h --- old/mkfontscale-1.1.3/constlist.h 1970-01-01 01:00:00.000000000 +0100 +++ new/mkfontscale-1.2.0/constlist.h 2019-03-02 23:21:39.000000000 +0100 @@ -0,0 +1,35 @@ +/* + Copyright (c) 2015 Thomas Klausner + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef _MKS_CONSTLIST_H_ +#define _MKS_CONSTLIST_H_ 1 + +typedef struct _ConstList { + const char *value; + struct _ConstList *next; +} ConstListRec, *ConstListPtr; + +ConstListPtr appendConstList(ConstListPtr first, ConstListPtr second); +ConstListPtr makeConstList(const char **a, int n, ConstListPtr old, int begin); +void destroyConstList(ConstListPtr old); + +#endif /* _MKS_CONSTLIST_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/mkfontscale-1.1.3/ident.c new/mkfontscale-1.2.0/ident.c --- old/mkfontscale-1.1.3/ident.c 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/ident.c 2019-03-02 23:21:39.000000000 +0100 @@ -76,12 +76,12 @@ gzFile gz; BZFILE *bz2; } f; - unsigned pos; + unsigned long pos; } fontFile; static inline void * fontFileOpen(fontFile *ff, const char *filename) { - int n = strlen(filename); + size_t n = strlen(filename); if (n > 4 && strcmp(filename + n - 4, ".bz2") == 0) { ff->type = bz2FontFile; @@ -123,7 +123,7 @@ } } -static int +static long fontFileSeek(fontFile *ff, z_off_t offset, int whence) { if (ff->type == gzFontFile) { @@ -132,7 +132,7 @@ /* bzlib has no easy equivalent so we have to fake it, * fortunately, we only have to handle a couple of cases */ - int n; + z_off_t n; char buf[BUFSIZ]; switch (whence) { @@ -151,7 +151,7 @@ return -1; n -= BUFSIZ; } - if (BZ2_bzread(ff->f.bz2, buf, n) != n) + if (BZ2_bzread(ff->f.bz2, buf, (int) n) != n) return -1; ff->pos = offset; return offset; @@ -247,7 +247,8 @@ { int prop_position; PropPtr props = NULL; - int format, count, nprops, i, string_size, rc; + int format, count, nprops, i, string_size; + long rc; char *strings = NULL, *s; count = getLSB32(f); 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/mkfontscale-1.1.3/list.c new/mkfontscale-1.2.0/list.c --- old/mkfontscale-1.1.3/list.c 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/list.c 2019-03-02 23:21:39.000000000 +0100 @@ -20,6 +20,8 @@ THE SOFTWARE. */ +#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <stdarg.h> @@ -63,6 +65,13 @@ { va_list args; char *string; +#ifdef HAVE_VASPRINTF + va_start(args, f); + if (vasprintf(&string, f, args) == -1) + string = NULL; + va_end(args); + return string; +#else { int n, size = 20; while(1) { @@ -83,6 +92,7 @@ free(string); } } +#endif } 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/mkfontscale-1.1.3/man/Makefile.am new/mkfontscale-1.2.0/man/Makefile.am --- old/mkfontscale-1.1.3/man/Makefile.am 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/man/Makefile.am 2019-03-02 23:21:39.000000000 +0100 @@ -1,6 +1,6 @@ appmandir = $(APP_MAN_DIR) -appman_PRE = mkfontscale.man +appman_PRE = mkfontdir.man mkfontscale.man appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) EXTRA_DIST = $(appman_PRE) 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/mkfontscale-1.1.3/man/mkfontdir.man new/mkfontscale-1.2.0/man/mkfontdir.man --- old/mkfontscale-1.1.3/man/mkfontdir.man 1970-01-01 01:00:00.000000000 +0100 +++ new/mkfontscale-1.2.0/man/mkfontdir.man 2019-03-02 23:21:39.000000000 +0100 @@ -0,0 +1,175 @@ +.\" Copyright 1993, 1994, 1998 The Open Group +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from The Open Group. +.\" +.TH MKFONTDIR __appmansuffix__ __xorgversion__ +.SH NAME +mkfontdir \- create an index of X font files in a directory +.SH SYNOPSIS +.B "mkfontdir" +.RB [ \-n ] +.RB [ \-x +.IR suffix ] +.RB [ \-r ] +.RB [ \-p +.IR prefix ] +.RB [ \-e +.IR encoding-directory-name ] +\&\|.\|.\|. +.RB [ \-\- ] +.RI [ directory-name +\&\|.\|.\|. ] +.SH DESCRIPTION +For each directory argument, +.I mkfontdir +reads all of the font files in the +directory searching for properties named "FONT", or (failing that) the name +of the file stripped of its suffix. These are converted to lower case and +used as font names, and, +along with the name of the font file, are +written out to the file "fonts.dir" in the directory. +The X server and font server use "fonts.dir" to find font files. +.PP +The kinds of font files read by +.I mkfontdir +depend on configuration +parameters, but typically include PCF (suffix ".pcf"), SNF (suffix ".snf") +and BDF (suffix ".bdf"). If a font exists in multiple formats, +.I mkfontdir +will first choose PCF, then SNF and finally BDF. +.PP +The first line of fonts.dir gives the number of fonts in the file. +The remaining lines list the fonts themselves, one per line, in two +fields. First is the name of the font file, followed by a space and +the name of the font. +.SH "SCALABLE FONTS" +Because scalable font files do not usually include the X font name, the +file "fonts.scale" can be used to name the scalable fonts in the +directory. +The fonts listed in it are copied to fonts.dir by +.IR mkfontdir . +"fonts.scale" has the same format as the "fonts.dir" file, and can be +created with the +.IR mkfontscale (__appmansuffix__) +program. +.SH "FONT NAME ALIASES" +The file "fonts.alias", which can be put in any directory of the font-path, is +used to map new names to existing fonts, and should be edited by hand. The +format is two white-space separated columns, the +first containing aliases and the second containing font-name patterns. +Lines beginning with "!" are comment lines and are ignored. +.PP +If neither the alias nor the value specifies the size fields of the +font name, this is a scalable alias. A font name of any size that +matches this alias will be mapped to the same size of the font that +the alias resolves to. +.PP +When a font alias is used, the name it references is searched for in the normal +manner, looking through each font directory in turn. This means that the +aliases need not mention fonts in the same directory as the alias file. +.PP +To embed white space in either name, simply enclose it in double-quote +marks; to embed double-quote marks (or any other character), precede them +with back-slash: +.PP +.nf +"magic-alias with spaces" "\\"font name\\" with quotes" +regular-alias fixed +.fi +.PP +If the string "FILE_NAMES_ALIASES" stands alone on a line, each file-name +in the directory (stripped of its suffix) will be used as an alias for +that font. +.SH ENCODING FILES +The option +.B -e +can be used to specify a directory with encoding files. Every such +directory is scanned for encoding files, the list of which is then +written to an "encodings.dir" file in every font directory. The +"encodings.dir" file is used by the server to find encoding +information. +.PP +The "encodings.dir" file has the same format as "fonts.dir". +It maps encoding names (strings of the form +.BI CHARSET_REGISTRY \- CHARSET_ENCODING +) to encoding file names. +.SH OPTIONS +The following options are supported: +.TP +.B \-e +Specify a directory containing encoding files. The +.B \-e +option may be specified multiple times, and all the specified +directories will be read. The order of the entries is significant, as +encodings found in earlier directories override those in later ones; +encoding files in the same directory are discriminated by preferring +compressed versions. +.TP +.B \-n +do not scan for fonts, do not write font directory files. This option +is useful when generating encoding directories only. +.TP +.B \-p +Specify a prefix that is prepended to the encoding file path names +when they are written to the "encodings.dir" file. The prefix is +prepended as-is. If a `/' is required between the prefix and the path +names, it must be supplied explicitly as part of the prefix. +.TP +.B \-r +Keep non-absolute encoding directories in their relative form when +writing the "encodings.dir" file. The default is to convert relative +encoding directories to absolute directories by prepending the current +directory. The positioning of this options is significant, as this +option only applies to subsequent +.B \-e +options. +.TP +.BI "\-x " suffix +Ignore fonts files of type +.IR suffix . +.TP +.B \-\- +End options. +.SH FILES +.TP 15 +.B fonts.dir +List of fonts in the directory and the files they are stored in. +Created by \fImkfontdir\fP. Read by the X server and font server each +time the font path is set (see xset(__appmansuffix__)). +.TP 15 +.B fonts.scale +List of scalable fonts in the directory. Contents are copied to +fonts.dir by \fImkfontdir\fP. Can be created with +.IR mkfontscale (__appmansuffix__). +.TP 15 +.B fonts.alias +List of font name aliases. +Read by the X server and font server each +time the font path is set (see xset(__appmansuffix__)). +.TP 15 +.B encodings.dir +List of known encodings and the files they are stored in. +Created by \fImkfontdir\fP. Read by the X server and font server each +time a font with an unknown charset is opened. +.SH "SEE ALSO" +X(__miscmansuffix__), Xserver(__appmansuffix__), mkfontscale(__appmansuffix__), xfs(__appmansuffix__), xset(__appmansuffix__) 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/mkfontscale-1.1.3/mkfontdir.in new/mkfontscale-1.2.0/mkfontdir.in --- old/mkfontscale-1.1.3/mkfontdir.in 1970-01-01 01:00:00.000000000 +0100 +++ new/mkfontscale-1.2.0/mkfontdir.in 2019-03-02 23:21:39.000000000 +0100 @@ -0,0 +1,5 @@ +#!/bin/sh + +PATH="@bindir@:$PATH" + +exec mkfontscale -b -s -l "$@" 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/mkfontscale-1.1.3/mkfontscale.c new/mkfontscale-1.2.0/mkfontscale.c --- old/mkfontscale-1.1.3/mkfontscale.c 2018-03-07 08:00:24.000000000 +0100 +++ new/mkfontscale-1.2.0/mkfontscale.c 2019-03-02 23:21:39.000000000 +0100 @@ -48,6 +48,7 @@ #include FT_XFREE86_H #include "list.h" +#include "constlist.h" #include "hash.h" #include "data.h" #include "ident.h" @@ -88,14 +89,14 @@ static const char *extra_encodings_array[] = { "iso10646-1", "adobe-fontspecific", "microsoft-symbol" }; -static ListPtr encodings, extra_encodings; +static ConstListPtr encodings, extra_encodings; static const char *outfilename; #define countof(_a) (sizeof(_a)/sizeof((_a)[0])) static int doDirectory(const char*, int, ListPtr); -static int checkEncoding(FT_Face face, char *encoding_name); -static int checkExtraEncoding(FT_Face face, char *encoding_name, int found); +static int checkEncoding(FT_Face face, const char *encoding_name); +static int checkExtraEncoding(FT_Face face, const char *encoding_name, int found); static int find_cmap(int type, int pid, int eid, FT_Face face); static const char* notice_foundry(const char *notice); static const char* vendor_foundry(const signed char *vendor); @@ -152,16 +153,17 @@ exit(1); } if(prefix[strlen(prefix) - 1] != '/') - strcat(prefix, "/"); - encodingPrefix = dsprintf("%s", prefix); + encodingPrefix = dsprintf("%s/", prefix); + else + encodingPrefix = strdup(prefix); outfilename = NULL; - encodings = makeList(encodings_array, countof(encodings_array), NULL, 0); + encodings = makeConstList(encodings_array, countof(encodings_array), NULL, 0); - extra_encodings = makeList(extra_encodings_array, - countof(extra_encodings_array), - NULL, 0); + extra_encodings = makeConstList(extra_encodings_array, + countof(extra_encodings_array), + NULL, 0); doBitmaps = 0; doISO10646_1_encoding = 1; doScalable = 1; @@ -187,7 +189,7 @@ if(argn >= argc - 1) { missing_arg("-a"); } - makeList(&argv[argn + 1], 1, encodings, 0); + makeConstList((const char **)&argv[argn + 1], 1, encodings, 0); argn += 2; } else if(strcmp(argv[argn], "-p") == 0) { if(argn >= argc - 1) { @@ -199,7 +201,7 @@ usage(); } free(encodingPrefix); - encodingPrefix = dsprintf("%s", argv[argn + 1]); + encodingPrefix = strdup(argv[argn + 1]); argn += 2; } else if(strcmp(argv[argn], "-e") == 0) { if(argn >= argc - 1) { @@ -320,7 +322,7 @@ { FT_SfntName name; char *string; - int i; + unsigned int i; if(getNameHelper(face, nid, TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, &name) || @@ -414,8 +416,8 @@ nameWidth(const char *name) { char buf[500]; - int i; - int n = strlen(name); + unsigned int i; + size_t n = strlen(name); if(n >= 499) return NULL; for(i = 0; i < n; i++) @@ -699,7 +701,7 @@ static int readFontScale(HashTablePtr entries, char *dirname) { - int n = strlen(dirname); + size_t n = strlen(dirname); char *filename; FILE *in; int rc, count, i; @@ -743,7 +745,7 @@ static int filePrio(char *filename) { - int n = strlen(filename); + size_t n = strlen(filename); if(n < 4) return 0; if(strcmp(filename + n - 4, ".otf") == 0) @@ -778,26 +780,27 @@ { char *dirname, *fontscale_name, *filename, *encdir; FILE *fontscale, *encfile; - DIR *dirp; - struct dirent *entry; + struct dirent** namelist; FT_Error ftrc; FT_Face face; - ListPtr encoding, xlfd, lp; + ConstListPtr encoding; + ListPtr xlfd, lp; HashTablePtr entries; HashBucketPtr *array; - int i, n, found, rc; - int isBitmap=0,xl=0; + int i, n, dirn, diri, found, rc; + int isBitmap=0; + size_t d, xl=0; if (exclusionSuffix) xl = strlen (exclusionSuffix); - i = strlen(dirname_given); - if(i == 0) + d = strlen(dirname_given); + if(d == 0) dirname = dsprintf("./"); - else if(dirname_given[i - 1] != '/') + else if(dirname_given[d - 1] != '/') dirname = dsprintf("%s/", dirname_given); else - dirname = dsprintf("%s", dirname_given); + dirname = strdup(dirname_given); if(dirname == NULL) { perror("dirname"); @@ -816,7 +819,7 @@ fontscale_name = NULL; else { if(outfilename[0] == '/') - fontscale_name = dsprintf("%s", outfilename); + fontscale_name = strdup(outfilename); else fontscale_name = dsprintf("%s%s", dirname, outfilename); if(fontscale_name == NULL) { @@ -825,10 +828,10 @@ } } - dirp = opendir(dirname); - if(dirp == NULL) { + dirn = scandir(dirname, &namelist, NULL, alphasort); + if(dirn < 0) { fprintf(stderr, "%s: ", dirname); - perror("opendir"); + perror("scandir"); return 0; } @@ -843,7 +846,8 @@ return 0; } - while((entry = readdir(dirp)) != NULL) { + for(diri = dirn - 1; diri >= 0; diri--) { + struct dirent *entry = namelist[diri]; int have_face = 0; char *xlfd_name = NULL; struct stat f_stat; @@ -852,7 +856,7 @@ xlfd = NULL; if (xl) { - int dl = strlen (entry->d_name); + size_t dl = strlen (entry->d_name); if (strcmp (entry->d_name + dl - xl, exclusionSuffix) == 0) continue; } @@ -924,14 +928,14 @@ if(xlfd_name) { /* We know it's a bitmap font, and we know its XLFD */ - int n = strlen(xlfd_name); + size_t l = strlen(xlfd_name); if(reencodeLegacy && - n >= 12 && strcasecmp(xlfd_name + n - 11, "-iso10646-1") == 0) { + l >= 12 && strcasecmp(xlfd_name + l - 11, "-iso10646-1") == 0) { char *s; - s = malloc(n - 10); - memcpy(s, xlfd_name, n - 11); - s[n - 11] = '\0'; + s = malloc(l - 10); + memcpy(s, xlfd_name, l - 11); + s[l - 11] = '\0'; xlfd = listCons(s, xlfd); } else { /* Not a reencodable font -- skip all the rest of the loop body */ @@ -991,7 +995,9 @@ #undef PRIO } - closedir(dirp); + while(dirn--) + free(namelist[dirn]); + free(namelist); n = hashElements(entries); fprintf(fontscale, "%d\n", n); array = hashArray(entries, 1); @@ -1036,7 +1042,7 @@ (c) == 0xAD || (c) == 0xF71B) static int -checkEncoding(FT_Face face, char *encoding_name) +checkEncoding(FT_Face face, const char *encoding_name) { FontEncPtr encoding; FontMapPtr mapping; @@ -1208,21 +1214,21 @@ } static int -checkExtraEncoding(FT_Face face, char *encoding_name, int found) +checkExtraEncoding(FT_Face face, const char *encoding_name, int found) { int c; if(strcasecmp(encoding_name, "iso10646-1") == 0) { if(doISO10646_1_encoding && find_cmap(FONT_ENCODING_UNICODE, -1, -1, face)) { - int found = 0; + int cfound = 0; /* Export as Unicode if there are at least 15 BMP characters that are not a space or ignored. */ for(c = 0x21; c < 0x10000; c++) { if(CODE_IGNORED(c)) continue; if(FT_Get_Char_Index(face, c) > 0) - found++; - if(found >= 15) + cfound++; + if(cfound >= 15) return 1; } return 0; @@ -1252,7 +1258,7 @@ static const char* notice_foundry(const char *notice) { - int i; + unsigned int i; for(i = 0; i < countof(notice_foundries); i++) if(notice && strstr(notice, notice_foundries[i][0])) return notice_foundries[i][1]; @@ -1263,7 +1269,7 @@ vendor_match(const signed char *vendor, const char *vendor_string) { /* vendor is not necessarily NUL-terminated. */ - int i, len; + size_t i, len; len = strlen(vendor_string); if(memcmp(vendor, vendor_string, len) != 0) return 0; @@ -1276,7 +1282,7 @@ static const char* vendor_foundry(const signed char *vendor) { - int i; + unsigned int i; for(i = 0; i < countof(vendor_foundries); i++) if(vendor_match(vendor, vendor_foundries[i][0])) return vendor_foundries[i][1];
