diff -Nru ttfautohint-0.9/.version ttfautohint-0.94/.version --- ttfautohint-0.9/.version 2012-06-06 05:43:02.000000000 +0000 +++ ttfautohint-0.94/.version 2012-11-29 07:23:42.000000000 +0000 @@ -1 +1 @@ -0.9 +0.94 diff -Nru ttfautohint-0.9/Makefile.in ttfautohint-0.94/Makefile.in --- ttfautohint-0.9/Makefile.in 2012-06-06 05:36:58.000000000 +0000 +++ ttfautohint-0.94/Makefile.in 2012-11-29 07:22:16.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.1 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -60,32 +60,42 @@ $(top_srcdir)/gnulib/missing AUTHORS COPYING ChangeLog INSTALL \ NEWS THANKS TODO gnulib/ar-lib gnulib/compile \ gnulib/config.guess gnulib/config.rpath gnulib/config.sub \ - gnulib/depcomp gnulib/install-sh gnulib/ltmain.sh \ - gnulib/missing + gnulib/install-sh gnulib/ltmain.sh gnulib/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/autotroll.m4 \ $(top_srcdir)/m4/ltlize_lang.m4 \ $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ + $(top_srcdir)/gnulib/m4/fcntl-o.m4 \ + $(top_srcdir)/gnulib/m4/fcntl_h.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ + $(top_srcdir)/gnulib/m4/isatty.m4 \ $(top_srcdir)/gnulib/m4/lib-ld.m4 \ $(top_srcdir)/gnulib/m4/lib-link.m4 \ $(top_srcdir)/gnulib/m4/lib-prefix.m4 \ $(top_srcdir)/gnulib/m4/libtool.m4 \ $(top_srcdir)/gnulib/m4/lock.m4 \ + $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/ltoptions.m4 \ $(top_srcdir)/gnulib/m4/ltsugar.m4 \ $(top_srcdir)/gnulib/m4/ltversion.m4 \ $(top_srcdir)/gnulib/m4/lt~obsolete.m4 \ + $(top_srcdir)/gnulib/m4/memchr.m4 \ + $(top_srcdir)/gnulib/m4/memmem.m4 \ + $(top_srcdir)/gnulib/m4/mmap-anon.m4 \ + $(top_srcdir)/gnulib/m4/msvc-inval.m4 \ + $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gnulib/m4/multiarch.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ + $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/strerror_r.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ @@ -103,12 +113,18 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -177,12 +193,18 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -214,6 +236,7 @@ FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GETOPT_H = @GETOPT_H@ +GHC = @GHC@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ @@ -225,6 +248,7 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ @@ -264,6 +288,9 @@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -325,6 +352,7 @@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ @@ -337,12 +365,16 @@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ @@ -352,7 +384,11 @@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ @@ -362,10 +398,15 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HELP2MAN = @HELP2MAN@ @@ -400,14 +441,18 @@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ @@ -429,6 +474,7 @@ PDFLATEX = @PDFLATEX@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QMAKE = @QMAKE@ QT_CFLAGS = @QT_CFLAGS@ QT_CPPFLAGS = @QT_CPPFLAGS@ @@ -448,6 +494,7 @@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ @@ -462,6 +509,8 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_READ = @REPLACE_READ@ @@ -489,14 +538,19 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ UIC = @UIC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -542,6 +596,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -643,7 +698,7 @@ # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. -$(RECURSIVE_TARGETS): +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -653,7 +708,11 @@ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -667,37 +726,6 @@ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ @@ -926,9 +954,9 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ diff -Nru ttfautohint-0.9/NEWS ttfautohint-0.94/NEWS --- ttfautohint-0.9/NEWS 2012-06-04 21:02:39.000000000 +0000 +++ ttfautohint-0.94/NEWS 2012-11-26 08:15:57.000000000 +0000 @@ -1,3 +1,55 @@ +New in 0.94: + +* New option `--windows-compatibility' which adds two artificial blue zones + at vertical positions given by `usWinAscent' and `usWinDescent'. This + helps ttfautohint's hinting algorithm reduce the possibility of clipping + if those two values are very tight. + +* Implement option `--x-height-snapping-exceptions', making ttfautohint + avoid x-height snapping for selected PPEM values. Useful in combination + with `--windows-compatibility'. + +* Minor fixes to the created bytecode for compatibility and robustness. + + +New in 0.93: + +* New option `--components' to treat components of composite glyphs + separately. This greatly reduces the bytecode size. + + I'm waiting for reports whether this option works for most fonts; in case + this is true I'm inverting the option, making it the default (and the old + behaviour optional). + +* Full support of TTCs, this is, all subfonts get auto-hinted now. + +* The upper limit of the `--increase-x-height' option has been removed. + +* Drag-and-drop support in the GUI. + +* The TTY version of ttfautohint now acts like a (Unix) filter, this is, it + accepts stdin and stdout as input and output, respectively. + +* Less memory consumption. + + +New in 0.92: + +* A serious bug in the created bytecode has been fixed, causing incorrect + rounding. + + +New in 0.91: + +* A new, `strong' routine to handle stem widths and positions has been + added, to be selected with the `--strong-stem-width' command line option. + If it is active, stem widths and positions are snapped to the grid as much + as possible. This algorithm is useful for GDI ClearType support. + +* A new command line option `--debug' (not available for ttfautohintGUI) to + print very detailed debugging information. + + New in 0.9: * The created bytecode has been reduced in size, making it approx. 20% @@ -10,7 +62,7 @@ * More documentation (in text, HTML, and PDF format). It's still incomplete, though. -* Option `--ignore-permissions' has been renamed to `--ignore-restrictions'. +* Option `--ignore-permissions' has been renamed to `--ignore-restrictions'. The short form is still `-i'. * Defaults for various parameters have been set to more sensible values: diff -Nru ttfautohint-0.9/README ttfautohint-0.94/README --- ttfautohint-0.9/README 2012-06-06 06:15:44.000000000 +0000 +++ ttfautohint-0.94/README 2012-11-29 06:52:58.000000000 +0000 @@ -1,5 +1,5 @@ -ttfautohint 0.9 ---------------- +ttfautohint 0.94 +---------------- by Werner Lemberg diff -Nru ttfautohint-0.9/THANKS ttfautohint-0.94/THANKS --- ttfautohint-0.9/THANKS 2012-05-22 20:14:35.000000000 +0000 +++ ttfautohint-0.94/THANKS 2012-11-29 06:56:07.000000000 +0000 @@ -15,16 +15,22 @@ The following people have provided help in developing and testing the -library: +library and front-ends: Dave Arnold Vernon Adams +Frederik Berlaen James Cloos +Erwin Denissen Greg Hitchcock Hirwen Harendal Khaled Hosny Daniel Johnson David Lemon +Karsten Lücke +Thomas Phinney +Eben Sorkin Adam Twardoch +Zack Weinberg EOF diff -Nru ttfautohint-0.9/TODO ttfautohint-0.94/TODO --- ttfautohint-0.9/TODO 2012-05-31 06:50:03.000000000 +0000 +++ ttfautohint-0.94/TODO 2012-11-29 07:00:37.000000000 +0000 @@ -2,20 +2,13 @@ important improvements ---------------------- -try to reduce size of hints - -> handling strong points separately - -> `compress' data - -> more subroutines to avoid flags - add features to the GUI -> direct control over `actions' -> preview similar to ftgrid - -improve handling of GDI ClearType by snapping to the pixel grid (this is, - integer coordinates of horizontal segments) + -> autocompletion of file names with tab key handle OT features - -> use HarfBuzz? + -> use HarfBuzz as soon it provides the necessary APIs control `gasp' table; Adam Twardoch suggest the following: @@ -34,10 +27,6 @@ parameter > 0, then up to that parameter value the gasp value 7 should be applied, and gasp value 15 should be applied above. -control activation threshold of blue zone widths; handle fonts with large - serifs like `Palatino' or `Quattrocento' (cf. this bug report: - https://savannah.nongnu.org/bugs/?36091) - create a separate blue zone class for `i' and `j': . if the values differ more than a given threshold, handle them separately @@ -51,6 +40,9 @@ control the width of blue zones +add control over character ranges which define a script; in particular, add + support for the PUA + handle normal and bold fonts differently; cf. Infinality patches; this should help avoid filling of bowls (like in `e') for bold shapes. @@ -59,7 +51,8 @@ try to `embolden' fonts at small sizes to avoid drop-outs; cf. Infinality patches -implement `x-height-snapping-exceptions' +make switching between smooth and strong hinting dependent on user-defined + ranges improve `pre-hinting' by making the used PPEM value configurable @@ -73,6 +66,8 @@ minor improvements ------------------ +reject fonts which are `hopeless' (for example, `Lipstick') + correctly set `lowestRecPPEM' field in `head' control dropout mode @@ -83,7 +78,7 @@ add a config and/or command file for batch handling -warn against overwrite of output file? +warn against overwrite of output file in TTY mode? reduce output size of option -p: 1. compare outline rendered at EM value with unhinted outline @@ -92,6 +87,22 @@ make it possible to hint fonts which aren't alphabetic at all, for example, icons; to do so, provide means to skip the global feature analysis +better control -i output + +allow processing of multiple files by using globs as in the Midnight + Commander? + +allow composite fonts already processed by ttfautohint to be processed + again (due to option `hint-with-components' this isn't urgent) + +make ttfautohint remember options: + 1. collect md5 checksums in a `~/.ttfautohint_history' file so that fonts + can be re-processed easily, using the same parameters + 2. if fonts already processed by ttfautohint can be re-processed (which + isn't possible yet), parse the `version' string for parameters + +implement (sort of) the opposite of -x, this is, decrease the x height + later enhancements ------------------ diff -Nru ttfautohint-0.9/VERSION ttfautohint-0.94/VERSION --- ttfautohint-0.9/VERSION 2012-06-06 06:20:19.000000000 +0000 +++ ttfautohint-0.94/VERSION 2012-11-29 08:36:37.000000000 +0000 @@ -1 +1 @@ -0.9 +0.94 diff -Nru ttfautohint-0.9/aclocal.m4 ttfautohint-0.94/aclocal.m4 --- ttfautohint-0.9/aclocal.m4 2012-06-06 05:22:09.000000000 +0000 +++ ttfautohint-0.94/aclocal.m4 2012-11-29 07:22:04.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.12.1 -*- Autoconf -*- +# generated automatically by aclocal 1.12.5 -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. @@ -25,8 +25,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -36,7 +34,7 @@ [am__api_version='1.12' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.12.1], [], +m4_if([$1], [1.12.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -52,7 +50,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.12.1])dnl +[AM_AUTOMAKE_VERSION([1.12.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -63,8 +61,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper @@ -126,8 +122,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. @@ -181,8 +175,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. @@ -214,7 +206,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 17 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -406,7 +397,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -483,8 +473,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 19 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -559,6 +547,11 @@ AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -631,8 +624,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -654,8 +645,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -677,8 +666,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -727,8 +714,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. @@ -763,8 +748,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -772,7 +755,6 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. @@ -805,8 +787,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -838,8 +818,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], @@ -921,8 +899,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT @@ -983,8 +959,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't @@ -1013,8 +987,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -1034,8 +1006,6 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. @@ -1128,24 +1098,35 @@ m4_include([gnulib/m4/00gnulib.m4]) m4_include([gnulib/m4/errno_h.m4]) m4_include([gnulib/m4/extensions.m4]) +m4_include([gnulib/m4/fcntl-o.m4]) +m4_include([gnulib/m4/fcntl_h.m4]) m4_include([gnulib/m4/getopt.m4]) m4_include([gnulib/m4/gnulib-common.m4]) m4_include([gnulib/m4/gnulib-comp.m4]) m4_include([gnulib/m4/include_next.m4]) +m4_include([gnulib/m4/isatty.m4]) m4_include([gnulib/m4/lib-ld.m4]) m4_include([gnulib/m4/lib-link.m4]) m4_include([gnulib/m4/lib-prefix.m4]) m4_include([gnulib/m4/libtool.m4]) m4_include([gnulib/m4/lock.m4]) +m4_include([gnulib/m4/longlong.m4]) m4_include([gnulib/m4/ltoptions.m4]) m4_include([gnulib/m4/ltsugar.m4]) m4_include([gnulib/m4/ltversion.m4]) m4_include([gnulib/m4/lt~obsolete.m4]) +m4_include([gnulib/m4/memchr.m4]) +m4_include([gnulib/m4/memmem.m4]) +m4_include([gnulib/m4/mmap-anon.m4]) +m4_include([gnulib/m4/msvc-inval.m4]) +m4_include([gnulib/m4/msvc-nothrow.m4]) +m4_include([gnulib/m4/multiarch.m4]) m4_include([gnulib/m4/nocrash.m4]) m4_include([gnulib/m4/off_t.m4]) m4_include([gnulib/m4/onceonly.m4]) m4_include([gnulib/m4/ssize_t.m4]) m4_include([gnulib/m4/stddef_h.m4]) +m4_include([gnulib/m4/stdint.m4]) m4_include([gnulib/m4/strerror.m4]) m4_include([gnulib/m4/strerror_r.m4]) m4_include([gnulib/m4/string_h.m4]) diff -Nru ttfautohint-0.9/bootstrap.conf ttfautohint-0.94/bootstrap.conf --- ttfautohint-0.9/bootstrap.conf 2012-05-29 05:46:31.000000000 +0000 +++ ttfautohint-0.94/bootstrap.conf 2012-11-11 18:29:05.000000000 +0000 @@ -27,8 +27,11 @@ # gnulib modules used by this package. gnulib_modules=" + fcntl-h getopt-gnu git-version-gen + isatty + memmem-simple strerror_r-posix " diff -Nru ttfautohint-0.9/config.h.in ttfautohint-0.94/config.h.in --- ttfautohint-0.9/config.h.in 2012-06-06 05:36:55.000000000 +0000 +++ ttfautohint-0.94/config.h.in 2012-11-29 07:22:13.000000000 +0000 @@ -1,11 +1,38 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to the number of bits in type 'ptrdiff_t'. */ +#undef BITSIZEOF_PTRDIFF_T + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#undef BITSIZEOF_SIG_ATOMIC_T + +/* Define to the number of bits in type 'size_t'. */ +#undef BITSIZEOF_SIZE_T + +/* Define to the number of bits in type 'wchar_t'. */ +#undef BITSIZEOF_WCHAR_T + +/* Define to the number of bits in type 'wint_t'. */ +#undef BITSIZEOF_WINT_T + /* Define to 1 when the gnulib module getopt-gnu should be tested. */ #undef GNULIB_TEST_GETOPT_GNU +/* Define to 1 when the gnulib module isatty should be tested. */ +#undef GNULIB_TEST_ISATTY + +/* Define to 1 when the gnulib module memchr should be tested. */ +#undef GNULIB_TEST_MEMCHR + +/* Define to 1 when the gnulib module memmem should be tested. */ +#undef GNULIB_TEST_MEMMEM + /* Define to 1 when the gnulib module strerror_r should be tested. */ #undef GNULIB_TEST_STRERROR_R +/* Define to 1 if you have the header file. */ +#undef HAVE_BP_SYM_H + /* Define to 1 if you have the 'catgets' function. */ #undef HAVE_CATGETS @@ -13,6 +40,10 @@ */ #undef HAVE_DECL_GETENV +/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't. + */ +#undef HAVE_DECL_MEMMEM + /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R @@ -29,9 +60,26 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if the system has the type 'long long int'. */ +#undef HAVE_LONG_LONG_INT + +/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and . */ +#undef HAVE_MAP_ANONYMOUS + +/* Define to 1 if you have the `memmem' function. */ +#undef HAVE_MEMMEM + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the 'mprotect' function. */ +#undef HAVE_MPROTECT + +/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER + /* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE @@ -77,6 +125,9 @@ /* Define to 1 if fchownat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHOWNAT +/* Define to 1 if fcntl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCNTL + /* Define to 1 if fdatasync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FDATASYNC @@ -146,6 +197,9 @@ /* Define to 1 if memrchr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MEMRCHR +/* Define to 1 if openat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_OPENAT + /* Define to 1 if pipe is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE @@ -239,6 +293,15 @@ /* Define to 1 if usleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_USLEEP +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#undef HAVE_SIGNED_SIG_ATOMIC_T + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#undef HAVE_SIGNED_WCHAR_T + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#undef HAVE_SIGNED_WINT_T + /* Define to 1 if you have the 'snprintf' function. */ #undef HAVE_SNPRINTF @@ -257,6 +320,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the 'symlink' function. */ +#undef HAVE_SYMLINK + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H @@ -269,12 +344,27 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if the system has the type 'unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define to 1 if you have the '_set_invalid_parameter_handler' function. */ +#undef HAVE__SET_INVALID_PARAMETER_HANDLER + /* Define to 1 if you have the '__xpg_strerror_r' function. */ #undef HAVE___XPG_STRERROR_R @@ -282,6 +372,9 @@ */ #undef LT_OBJDIR +/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ +#undef MAP_ANONYMOUS + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O @@ -309,9 +402,21 @@ /* Define if the pthread_in_use() detection is hard. */ #undef PTHREAD_IN_USE_DETECTION_HARD +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#undef PTRDIFF_T_SUFFIX + /* Define to 1 if strerror(0) does not return a message implying success. */ #undef REPLACE_STRERROR_0 +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#undef SIG_ATOMIC_T_SUFFIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#undef SIZE_T_SUFFIX + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -342,6 +447,14 @@ /* Version number of package */ #undef VERSION +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#undef WCHAR_T_SUFFIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + /* Define to 1 if on MINIX. */ #undef _MINIX @@ -378,7 +491,7 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on MacOS X. */ +/* Enable general extensions on Mac OS X. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -413,7 +526,7 @@ /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. - __APPLE__ && __MACH__ test for MacOS X. + __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ diff -Nru ttfautohint-0.9/configure ttfautohint-0.94/configure --- ttfautohint-0.9/configure 2012-06-06 05:36:55.000000000 +0000 +++ ttfautohint-0.94/configure 2012-11-29 07:22:13.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ttfautohint 0.9. +# Generated by GNU Autoconf 2.69 for ttfautohint 0.94. # # Report bugs to . # @@ -650,8 +650,8 @@ # Identity of this package. PACKAGE_NAME='ttfautohint' PACKAGE_TARNAME='ttfautohint' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='ttfautohint 0.9' +PACKAGE_VERSION='0.94' +PACKAGE_STRING='ttfautohint 0.94' PACKAGE_BUGREPORT='freetype-devel@nongnu.org' PACKAGE_URL='' @@ -692,10 +692,10 @@ #endif" gl_use_threads_default= -gl_getopt_required=POSIX gl_header_list= -gl_getopt_required=POSIX gl_func_list= +gl_getopt_required=POSIX +gl_getopt_required=POSIX ac_subst_vars='gltests_LTLIBOBJS gltests_LIBOBJS gl_LTLIBOBJS @@ -707,6 +707,7 @@ WITH_DOC_FALSE WITH_DOC_TRUE PDFLATEX +GHC PANDOC INKSCAPE IMPORT @@ -757,6 +758,42 @@ NEXT_SYS_TYPES_H NEXT_AS_FIRST_DIRECTIVE_STRING_H NEXT_STRING_H +HAVE_WINSOCK2_H +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +HAVE_SYS_BITYPES_H +HAVE_SYS_INTTYPES_H +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +REPLACE_NULL +APPLE_UNIVERSAL_BUILD +HAVE_MSVC_INVALID_PARAMETER_HANDLER UNDEFINE_STRTOK_R REPLACE_STRTOK_R REPLACE_STRSIGNAL @@ -830,14 +867,6 @@ GNULIB_MEMCHR GNULIB_FFSLL GNULIB_FFSL -HAVE_WINSOCK2_H -NEXT_AS_FIRST_DIRECTIVE_STDDEF_H -NEXT_STDDEF_H -GL_GENERATE_STDDEF_H_FALSE -GL_GENERATE_STDDEF_H_TRUE -STDDEF_H -HAVE_WCHAR_T -REPLACE_NULL LTLIBMULTITHREAD LIBMULTITHREAD LTLIBTHREAD @@ -972,6 +1001,17 @@ GNULIB_CLOSE GNULIB_CHOWN GNULIB_CHDIR +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL EOVERFLOW_VALUE EOVERFLOW_HIDDEN ENOLINK_VALUE @@ -1037,6 +1077,7 @@ am__leading_dot SET_MAKE AWK +mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP @@ -1668,7 +1709,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ttfautohint 0.9 to adapt to many kinds of systems. +\`configure' configures ttfautohint 0.94 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1738,7 +1779,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ttfautohint 0.9:";; + short | recursive ) echo "Configuration of ttfautohint 0.94:";; esac cat <<\_ACEOF @@ -1765,7 +1806,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib --without-libpth-prefix don't search for libpth in includedir and libdir --with-qt[=ARG] Qt support. ARG can be `yes' (the default), `no', or @@ -1864,7 +1905,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ttfautohint configure 0.9 +ttfautohint configure 0.94 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2451,52 +2492,6 @@ } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2551,6 +2546,52 @@ } # ac_fn_c_check_type +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR @@ -2733,7 +2774,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ttfautohint $as_me 0.9, which was +It was created by ttfautohint $as_me 0.94, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3013,14 +3054,20 @@ >$cache_file fi +gl_header_list="$gl_header_list unistd.h" +gl_func_list="$gl_func_list symlink" gl_getopt_required=GNU gl_header_list="$gl_header_list getopt.h" +gl_header_list="$gl_header_list sys/mman.h" +gl_func_list="$gl_func_list mprotect" +gl_func_list="$gl_func_list _set_invalid_parameter_handler" +gl_header_list="$gl_header_list wchar.h" +gl_header_list="$gl_header_list stdint.h" gl_header_list="$gl_header_list sys/socket.h" gl_func_list="$gl_func_list strerror_r" gl_func_list="$gl_func_list __xpg_strerror_r" gl_func_list="$gl_func_list catgets" gl_func_list="$gl_func_list snprintf" -gl_header_list="$gl_header_list unistd.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -3566,7 +3613,7 @@ # Define the identity of the package. PACKAGE='ttfautohint' - VERSION='0.9' + VERSION='0.94' cat >>confdefs.h <<_ACEOF @@ -3594,6 +3641,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used @@ -6947,19 +7000,27 @@ # Code from module errno: # Code from module extensions: + # Code from module fcntl-h: # Code from module getopt-gnu: # Code from module getopt-posix: # Code from module gettext-h: # Code from module git-version-gen: # Code from module havelib: # Code from module include_next: + # Code from module isatty: # Code from module lock: + # Code from module memchr: + # Code from module memmem-simple: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: # Code from module nocrash: # Code from module snippet/arg-nonnull: # Code from module snippet/c++defs: # Code from module snippet/warn-on-use: # Code from module ssize_t: # Code from module stddef: + # Code from module stdint: # Code from module strerror-override: # Code from module strerror_r-posix: # Code from module string: @@ -7152,6 +7213,9 @@ #if !defined ENOTRECOVERABLE booboo #endif +#if !defined EILSEQ +booboo +#endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | @@ -7462,6 +7526,238 @@ + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + for ac_header in $gl_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + for ac_func in $gl_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + : + + + + + + + : + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +$as_echo_n "checking for working fcntl.h... " >&6; } +if ${gl_cv_header_working_fcntl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_header_working_fcntl_h=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main () +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_fcntl_h=yes +else + case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +$as_echo "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOATIME $ac_val +_ACEOF + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOFOLLOW $ac_val +_ACEOF + + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + + GNULIB_CHDIR=0; GNULIB_CHOWN=0; GNULIB_CLOSE=0; @@ -7588,18 +7884,8 @@ - for ac_header in $gl_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done @@ -7609,13 +7895,7 @@ - - - - - - - : + : @@ -7731,57 +8011,124 @@ fi - if test -z "$gl_replace_getopt"; then + if test -z "$gl_replace_getopt"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 $as_echo_n "checking whether getopt is POSIX compatible... " >&6; } if ${gl_cv_func_getopt_posix+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test $cross_compiling = no; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include +#include +#include + int main () { -int *p = &optreset; return optreset; - ; + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_optind_min=1 +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#include +#include +#include + int main () { -return !getopt_clip; - ; + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_optind_min=1 +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe else - gl_optind_min=0 + gl_cv_func_getopt_posix=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - gl_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min" - if test "$cross_compiling" = yes; then : - case "$host_os" in - mingw*) gl_cv_func_getopt_posix="guessing no";; - darwin* | aix*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; - esac + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7793,78 +8140,17 @@ int main () { - { - static char program[] = "program"; - static char a[] = "-a"; - static char foo[] = "foo"; - static char bar[] = "bar"; - char *argv[] = { program, a, foo, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (4, argv, "ab"); - if (!(c == 'a')) - return 1; - c = getopt (4, argv, "ab"); - if (!(c == -1)) - return 2; - if (!(optind == 2)) - return 3; - } - /* Some internal state exists at this point. */ - { - static char program[] = "program"; - static char donald[] = "donald"; - static char p[] = "-p"; - static char billy[] = "billy"; - static char duck[] = "duck"; - static char a[] = "-a"; - static char bar[] = "bar"; - char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (7, argv, "+abp:q:"); - if (!(c == -1)) - return 4; - if (!(strcmp (argv[0], "program") == 0)) - return 5; - if (!(strcmp (argv[1], "donald") == 0)) - return 6; - if (!(strcmp (argv[2], "-p") == 0)) - return 7; - if (!(strcmp (argv[3], "billy") == 0)) - return 8; - if (!(strcmp (argv[4], "duck") == 0)) - return 9; - if (!(strcmp (argv[5], "-a") == 0)) - return 10; - if (!(strcmp (argv[6], "bar") == 0)) - return 11; - if (!(optind == 1)) - return 12; - } - /* Detect MacOS 10.5, AIX 7.1 bug. */ - { - static char program[] = "program"; - static char ab[] = "-ab"; - char *argv[3] = { program, ab, NULL }; - optind = OPTIND_MIN; - opterr = 0; - if (getopt (2, argv, "ab:") != 'a') - return 13; - if (getopt (2, argv, "ab:") != '?') - return 14; - if (optopt != 'b') - return 15; - if (optind != 2) - return 16; - } - + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; return 0; } @@ -7878,7 +8164,13 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - CPPFLAGS=$gl_save_CPPFLAGS + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 @@ -7909,11 +8201,7 @@ POSIXLY_CORRECT=1 export POSIXLY_CORRECT if test "$cross_compiling" = yes; then : - case $host_os:$ac_cv_have_decl_optreset in - *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;; - *:yes) gl_cv_func_getopt_gnu=no;; - *) gl_cv_func_getopt_gnu=yes;; - esac + gl_cv_func_getopt_gnu="guessing no" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7924,7 +8212,7 @@ #include #if defined __MACH__ && defined __APPLE__ -/* Avoid a crash on MacOS X. */ +/* Avoid a crash on Mac OS X. */ #include #include #include @@ -8044,7 +8332,7 @@ nocrash_init(); /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, - and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10. */ { static char conftest[] = "conftest"; @@ -8055,7 +8343,7 @@ result |= 1; } /* This code succeeds on glibc 2.8, mingw, - and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ { static char program[] = "program"; @@ -8084,7 +8372,7 @@ if (getopt (3, argv, "-p") != 1) result |= 16; else if (getopt (3, argv, "-p") != 'p') - result |= 32; + result |= 16; } /* This code fails on glibc 2.11. */ { @@ -8094,9 +8382,9 @@ char *argv[] = { program, b, a, NULL }; optind = opterr = 0; if (getopt (3, argv, "+:a:b") != 'b') - result |= 64; + result |= 32; else if (getopt (3, argv, "+:a:b") != ':') - result |= 64; + result |= 32; } /* This code dumps core on glibc 2.14. */ { @@ -8106,7 +8394,7 @@ char *argv[] = { program, w, dummy, NULL }; optind = opterr = 1; if (getopt (3, argv, "W;") != 'W') - result |= 128; + result |= 64; } return result; @@ -8132,24 +8420,83 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 $as_echo "$gl_cv_func_getopt_gnu" >&6; } - if test "$gl_cv_func_getopt_gnu" = "no"; then + if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes - fi - fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +$as_echo_n "checking for working GNU getopt_long function... " >&6; } +if ${gl_cv_func_getopt_long_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include +int +main () +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_long_gnu=yes +else + gl_cv_func_getopt_long_gnu=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +$as_echo "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi - REPLACE_GETOPT=0 - if test -n "$gl_replace_getopt"; then : - REPLACE_GETOPT=1 -fi + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi if test $REPLACE_GETOPT = 1; then @@ -8174,6 +8521,48 @@ _ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" @@ -8191,6 +8580,7 @@ prefix="$acl_save_prefix" + # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes @@ -8210,11 +8600,12 @@ || PATH_SEPARATOR=';' } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -8224,11 +8615,11 @@ esac case $ac_prog in # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) + [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -8253,23 +8644,26 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 &6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. + # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 @@ -9304,105 +9700,1241 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - REPLACE_NULL=0; - HAVE_WCHAR_T=1; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 -$as_echo_n "checking for wchar_t... " >&6; } -if ${gt_cv_c_wchar_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - wchar_t foo = (wchar_t)'\0'; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_c_wchar_t=yes -else - gt_cv_c_wchar_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 -$as_echo "$gt_cv_c_wchar_t" >&6; } - if test $gt_cv_c_wchar_t = yes; then -$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h - fi - REPLACE_STRERROR_0=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 -$as_echo_n "checking whether strerror(0) succeeds... " >&6; } -if ${gl_cv_func_strerror_0_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_strerror_0_works="guessing no" ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +$as_echo_n "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + +$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +$as_echo "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +$as_echo_n "checking whether memchr works... " >&6; } +if ${gl_cv_func_memchr_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_memchr_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main () +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_memchr_works=yes +else + gl_cv_func_memchr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +$as_echo "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default" +if test "x$ac_cv_have_decl_memmem" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MEMMEM $ac_have_decl +_ACEOF + + + + + + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + REPLACE_NULL=0; + HAVE_WCHAR_T=1; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if ${gt_cv_c_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +$as_echo_n "checking for unsigned long long int... " >&6; } +if ${ac_cv_type_unsigned_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + ac_cv_type_unsigned_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if ${ac_cv_type_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + + + + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + : + + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_stdint_h = yes; then + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } +if ${gl_cv_header_working_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_stdint_h=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main () +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +$as_echo "$gl_cv_header_working_stdint_h" >&6; } + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + for ac_header in sys/inttypes.h sys/bitypes.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + + + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include "; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include "; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +$as_echo_n "checking whether $gltype is signed... " >&6; } +if eval \${gl_cv_type_${gltype}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + result=yes +else + result=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 +_ACEOF + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi + + STDINT_H=stdint.h + fi + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + REPLACE_STRERROR_0=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +$as_echo_n "checking whether strerror(0) succeeds... " >&6; } +if ${gl_cv_func_strerror_0_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include int main () @@ -9449,96 +10981,6 @@ - GNULIB_FFSL=0; - GNULIB_FFSLL=0; - GNULIB_MEMCHR=0; - GNULIB_MEMMEM=0; - GNULIB_MEMPCPY=0; - GNULIB_MEMRCHR=0; - GNULIB_RAWMEMCHR=0; - GNULIB_STPCPY=0; - GNULIB_STPNCPY=0; - GNULIB_STRCHRNUL=0; - GNULIB_STRDUP=0; - GNULIB_STRNCAT=0; - GNULIB_STRNDUP=0; - GNULIB_STRNLEN=0; - GNULIB_STRPBRK=0; - GNULIB_STRSEP=0; - GNULIB_STRSTR=0; - GNULIB_STRCASESTR=0; - GNULIB_STRTOK_R=0; - GNULIB_MBSLEN=0; - GNULIB_MBSNLEN=0; - GNULIB_MBSCHR=0; - GNULIB_MBSRCHR=0; - GNULIB_MBSSTR=0; - GNULIB_MBSCASECMP=0; - GNULIB_MBSNCASECMP=0; - GNULIB_MBSPCASECMP=0; - GNULIB_MBSCASESTR=0; - GNULIB_MBSCSPN=0; - GNULIB_MBSPBRK=0; - GNULIB_MBSSPN=0; - GNULIB_MBSSEP=0; - GNULIB_MBSTOK_R=0; - GNULIB_STRERROR=0; - GNULIB_STRERROR_R=0; - GNULIB_STRSIGNAL=0; - GNULIB_STRVERSCMP=0; - HAVE_MBSLEN=0; - HAVE_FFSL=1; - HAVE_FFSLL=1; - HAVE_MEMCHR=1; - HAVE_DECL_MEMMEM=1; - HAVE_MEMPCPY=1; - HAVE_DECL_MEMRCHR=1; - HAVE_RAWMEMCHR=1; - HAVE_STPCPY=1; - HAVE_STPNCPY=1; - HAVE_STRCHRNUL=1; - HAVE_DECL_STRDUP=1; - HAVE_DECL_STRNDUP=1; - HAVE_DECL_STRNLEN=1; - HAVE_STRPBRK=1; - HAVE_STRSEP=1; - HAVE_STRCASESTR=1; - HAVE_DECL_STRTOK_R=1; - HAVE_DECL_STRERROR_R=1; - HAVE_DECL_STRSIGNAL=1; - HAVE_STRVERSCMP=1; - REPLACE_MEMCHR=0; - REPLACE_MEMMEM=0; - REPLACE_STPNCPY=0; - REPLACE_STRDUP=0; - REPLACE_STRSTR=0; - REPLACE_STRCASESTR=0; - REPLACE_STRCHRNUL=0; - REPLACE_STRERROR=0; - REPLACE_STRERROR_R=0; - REPLACE_STRNCAT=0; - REPLACE_STRNDUP=0; - REPLACE_STRNLEN=0; - REPLACE_STRSIGNAL=0; - REPLACE_STRTOK_R=0; - UNDEFINE_STRTOK_R=0; - - - - - - for ac_func in $gl_func_list -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - @@ -9908,52 +11350,165 @@ -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : + + WINDOWS_64_BIT_OFF_T=0 + + + + + if true; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=true + gl_m4_base='gnulib/m4' + + + + + + + + + + gl_source_base='gnulib/src' + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_fcntl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define pid_t int _ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +$as_echo "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define mode_t int +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 _ACEOF + eval ac_cv_have_decl_$gl_func=yes fi + done - WINDOWS_64_BIT_OFF_T=0 + if test $REPLACE_GETOPT = 1; then - if true; then - GL_COND_LIBTOOL_TRUE= - GL_COND_LIBTOOL_FALSE='#' -else - GL_COND_LIBTOOL_TRUE='#' - GL_COND_LIBTOOL_FALSE= -fi - gl_cond_libtool=true - gl_m4_base='gnulib/m4' + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" @@ -9961,23 +11516,25 @@ - gl_source_base='gnulib/src' + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + : -if test $REPLACE_GETOPT = 1; then + GNULIB_GL_UNISTD_H_GETOPT=1 + fi - gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" +$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h @@ -9985,90 +11542,96 @@ + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + if test $REPLACE_GETOPT = 1; then - gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + GETOPT_H=getopt.h +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - : + fi + if test $REPLACE_GETOPT = 1; then - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" - REPLACE_GETOPT=0 - if test -n "$gl_replace_getopt"; then : - REPLACE_GETOPT=1 -fi + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" - if test $REPLACE_GETOPT = 1; then - GETOPT_H=getopt.h + : + -$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + GNULIB_GL_UNISTD_H_GETOPT=1 fi -if test $REPLACE_GETOPT = 1; then + case $host_os in + mingw*) REPLACE_ISATTY=1 ;; + esac + + if test $REPLACE_ISATTY = 1; then - gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS isatty.$ac_objext" + fi - gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" - : + GNULIB_ISATTY=1 - GNULIB_GL_UNISTD_H_GETOPT=1 -fi +$as_echo "#define GNULIB_TEST_ISATTY 1" >>confdefs.h if test "$gl_threads_api" = posix; then - # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the + # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include " @@ -10110,6 +11673,237 @@ + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + for ac_header in bp-sym.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BP_SYM_H 1 +_ACEOF + +fi + +done + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + for ac_func in memmem +do : + ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" +if test "x$ac_cv_func_memmem" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMMEM 1 +_ACEOF + +fi +done + + if test $ac_cv_func_memmem = yes; then + HAVE_MEMMEM=1 + else + HAVE_MEMMEM=0 + fi + + : + + + + + + if test $ac_cv_have_decl_memmem = no; then + HAVE_DECL_MEMMEM=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 +$as_echo_n "checking whether memmem works... " >&6; } +if ${gl_cv_func_memmem_works_always+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __GNU_LIBRARY__ + #include + #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ + || __GLIBC_MINOR__ > 12)) \ + || (__GLIBC__ > 2)) \ + || defined __UCLIBC__ + Lucky user + #endif +#elif defined __CYGWIN__ + #include + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + Lucky user + #endif +#else + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then : + gl_cv_func_memmem_works_always="guessing yes" +else + gl_cv_func_memmem_works_always="guessing no" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include /* for memmem */ +#define P "_EF_BF_BD" +#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P +#define NEEDLE P P P P P + +int +main () +{ + + int result = 0; + if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) + result |= 1; + /* Check for empty needle behavior. */ + { + const char *haystack = "AAA"; + if (memmem (haystack, 3, NULL, 0) != haystack) + result |= 2; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_memmem_works_always=yes +else + gl_cv_func_memmem_works_always=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 +$as_echo "$gl_cv_func_memmem_works_always" >&6; } + case "$gl_cv_func_memmem_works_always" in + *yes) ;; + *) + REPLACE_MEMMEM=1 + ;; + esac + fi + : + + if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" + + fi + + + + + + GNULIB_MEMMEM=1 + + + + + +$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h + + + + + + : + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } if ${gt_cv_ssize_t+:} false; then : @@ -10262,7 +12056,8 @@ -if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then @@ -10306,7 +12101,7 @@ fi -fi + fi @@ -10338,7 +12133,7 @@ fi fi -if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then @@ -10372,7 +12167,7 @@ -fi + fi @@ -22370,7 +24165,7 @@ Report bugs to ." lt_cl_version="\ -ttfautohint config.lt 0.9 +ttfautohint config.lt 0.94 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -23808,7 +25603,6 @@ image_file=$srcdir/doc/img/ttfautohintGUI.png -svg2png_file=$srcdir/doc/img/segment-edge.png html_file=$srcdir/doc/ttfautohint.html pdf_file=$srcdir/doc/ttfautohint.pdf @@ -23872,7 +25666,7 @@ fi fi - # conversion of SVG to PNG + # conversion of SVG to PDF # Extract the first word of "inkscape", so it can be a program name with args. set dummy inkscape; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -23912,12 +25706,12 @@ if test x"$PANDOC" == x"no"; then - if test -f "$svg2png_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Need inkscape to convert SVG to PNG image files" >&5 -$as_echo "$as_me: WARNING: Need inkscape to convert SVG to PNG image files" >&2;} + if test -f "$pdf_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Need inkscape to convert SVG image files to PDF" >&5 +$as_echo "$as_me: WARNING: Need inkscape to convert SVG image files to PDF" >&2;} with_doc=no else - as_fn_error $? "Need inkscape to convert SVG to PNG image files" "$LINENO" 5 + as_fn_error $? "Need inkscape to convert SVG image files to PDF" "$LINENO" 5 fi fi @@ -23969,6 +25763,53 @@ as_fn_error $? "Need pandoc to create PDF and HTML documentation files" "$LINENO" 5 fi fi + # Extract the first word of "ghc", so it can be a program name with args. +set dummy ghc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GHC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GHC"; then + ac_cv_prog_GHC="$GHC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GHC="ghc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_GHC" && ac_cv_prog_GHC="no" +fi +fi +GHC=$ac_cv_prog_GHC +if test -n "$GHC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GHC" >&5 +$as_echo "$GHC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$GHC" == x"no"; then + if test -f "$html_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Need Glasgow Haskell Compiler (ghc) to create pandoc filter" >&5 +$as_echo "$as_me: WARNING: Need Glasgow Haskell Compiler (ghc) to create pandoc filter" >&2;} + with_doc=no + else + as_fn_error $? "Need Glasgow Haskell Compiler (ghc) to create pandoc filter" "$LINENO" 5 + fi + fi # PDF documentation # Extract the first word of "pdflatex", so it can be a program name with args. @@ -24186,6 +26027,10 @@ as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi gl_libobjs= gl_ltlibobjs= @@ -24623,7 +26468,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ttfautohint $as_me 0.9, which was +This file was extended by ttfautohint $as_me 0.94, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -24689,7 +26534,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ttfautohint config.status 0.9 +ttfautohint config.status 0.94 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru ttfautohint-0.9/configure.ac ttfautohint-0.94/configure.ac --- ttfautohint-0.9/configure.ac 2012-05-29 05:49:20.000000000 +0000 +++ ttfautohint-0.94/configure.ac 2012-06-26 14:24:17.000000000 +0000 @@ -169,7 +169,6 @@ fi]) image_file=$srcdir/doc/img/ttfautohintGUI.png -svg2png_file=$srcdir/doc/img/segment-edge.png html_file=$srcdir/doc/ttfautohint.html pdf_file=$srcdir/doc/ttfautohint.pdf @@ -186,11 +185,11 @@ fi fi - # conversion of SVG to PNG + # conversion of SVG to PDF AC_CHECK_PROG([INKSCAPE], [inkscape], [inkscape], [no]) if test x"$PANDOC" == x"no"; then - TA_DOC([$svg2png_file], - [Need inkscape to convert SVG to PNG image files]) + TA_DOC([$pdf_file], + [Need inkscape to convert SVG image files to PDF]) fi # documentation creation @@ -199,6 +198,11 @@ TA_DOC([$html_file], [Need pandoc to create PDF and HTML documentation files]) fi + AC_CHECK_PROG([GHC], [ghc], [ghc], [no]) + if test x"$GHC" == x"no"; then + TA_DOC([$html_file], + [Need Glasgow Haskell Compiler (ghc) to create pandoc filter]) + fi # PDF documentation AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [no]) diff -Nru ttfautohint-0.9/debian/changelog ttfautohint-0.94/debian/changelog --- ttfautohint-0.9/debian/changelog 2012-06-16 10:10:22.000000000 +0000 +++ ttfautohint-0.94/debian/changelog 2013-11-17 14:04:46.000000000 +0000 @@ -1,12 +1,5 @@ -ttfautohint (0.9-1) unstable; urgency=low +ttfautohint (0.94-1~quantal1) quantal; urgency=low - * New upstream version. - * Bump standards version to 3.9.3. + * Backport to Ubuntu Quantal - -- Gürkan Sengün Sat, 16 Jun 2012 12:07:22 +0200 - -ttfautohint (0.8-1) unstable; urgency=low - - * Initial release. (Closes: #659233) - - -- Gürkan Sengün Wed, 08 Feb 2012 14:27:05 +0100 + -- Bret Curtis Fri, 15 Nov 2013 08:13:09 +0200 diff -Nru ttfautohint-0.9/debian/watch ttfautohint-0.94/debian/watch --- ttfautohint-0.9/debian/watch 2012-02-09 11:53:23.000000000 +0000 +++ ttfautohint-0.94/debian/watch 2013-11-17 09:55:25.000000000 +0000 @@ -1,2 +1,3 @@ version=3 -http://sf.net/freetype/ttfautohint-(.*)\.tar\.gz +http://qa.debian.org/watch/sf.php/freetype/ttfautohint-(\d[^x]*)\.(?:tgz|tbz2|tar\.(?:gz|bz2|xz)) +# Bart Martens Sat, 01 Dec 2012 12:36:20 +0000 diff -Nru ttfautohint-0.9/doc/Makefile.am ttfautohint-0.94/doc/Makefile.am --- ttfautohint-0.9/doc/Makefile.am 2012-06-06 05:26:16.000000000 +0000 +++ ttfautohint-0.94/doc/Makefile.am 2012-11-22 14:29:39.000000000 +0000 @@ -14,32 +14,38 @@ ttfautohint-2.pandoc \ ttfautohint-3.pandoc -DOCIMGSRC = img/blue-zones.svg \ +DOCIMGSVG = img/blue-zones.svg \ img/glyph-terms.svg \ img/o-and-i.svg \ img/segment-edge.svg -DOCIMG = img/ttfautohintGUI.png \ - img/a-before-hinting.png \ - img/a-after-hinting.png \ - img/a-after-autohinting.png \ - img/afii10108-11px-after-hinting.png \ - img/afii10108-11px-before-hinting.png \ - img/afii10108-12px-after-hinting.png \ - img/afii10108-12px-before-hinting.png \ - img/blue-zones.png \ - img/e-17px-x14.png \ - img/e-17px-x17.png \ - img/glyph-terms.png \ - img/o-and-i.png \ - img/segment-edge.png +DOCIMGPDF = img/blue-zones.pdf \ + img/glyph-terms.pdf \ + img/o-and-i.pdf \ + img/segment-edge.pdf + +DOCIMGPNG = img/ttfautohintGUI.png \ + img/a-before-hinting.png \ + img/a-after-hinting.png \ + img/a-after-autohinting.png \ + img/afii10108-11px-after-hinting.png \ + img/afii10108-11px-before-hinting.png \ + img/afii10108-12px-after-hinting.png \ + img/afii10108-12px-before-hinting.png \ + img/e-17px-x14.png \ + img/e-17px-x17.png \ + img/ff-g-26px.png \ + img/ff-g-26px-wD.png DOC = ttfautohint.html \ ttfautohint.pdf \ ttfautohint.txt \ - $(DOCIMG) + $(DOCIMGPNG) \ + $(DOCIMGSVG) \ + $(DOCIMGPDF) EXTRA_DIST = c2pandoc.sed \ + handle-images.hs \ make-snapshot.sh \ strip-comments.sh \ ttfautohint-1.pandoc \ @@ -50,8 +56,7 @@ ttfautohint.css if WITH_DOC - nobase_dist_doc_DATA = $(DOC) \ - $(DOCIMGSRC) + nobase_dist_doc_DATA = $(DOC) endif @@ -62,11 +67,14 @@ $(SHELL) $(srcdir)/strip-comments.sh $^ > $@ if WITH_DOC - # this is a temporary solution: - # the right one is to write a pandoc filter - # which uses `foo.svg' for HTML and `foo.pdf' for PDF output -.svg.png: - $(INKSCAPE) --export-background=white --export-png=$@ $< + + # the pandoc image filter + handle-images: handle-images.hs + $(GHC) -dynamic --make $@ + + # suffix rules must always start in column 0 +.svg.pdf: + $(INKSCAPE) --export-pdf=$@ $< # build snapshot image of ttfautohintGUI: # this needs X11 and ImageMagick's `import' tool @@ -79,31 +87,38 @@ $(SHELL) $(srcdir)/make-snapshot.sh \ $(top_builddir)/frontend/ttfautohintGUI$(EXEEXT) $@ - ttfautohint.html: ttfautohint.txt $(DOCIMG) \ + ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) handle-images \ ttfautohint.css template.html $(top_srcdir)/.version - $(PANDOC) --template=$(srcdir)/template.html \ - --variable="version:$(VERSION)" \ - --toc \ - --include-in-header=$(srcdir)/ttfautohint.css \ + $(PANDOC) --to=json \ --smart \ - --standalone \ - --output=$@ \ - $< + $< \ + | ./handle-images ".svg" \ + | $(PANDOC) --from=json \ + --template=$(srcdir)/template.html \ + --variable="version:$(VERSION)" \ + --toc \ + --include-in-header=$(srcdir)/ttfautohint.css \ + --standalone \ + --output=$@ - ttfautohint.pdf: ttfautohint.txt $(DOCIMG) \ + ttfautohint.pdf: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) handle-images \ template.tex $(top_srcdir)/.version - TEXINPUTS="$(srcdir);" \ - $(PANDOC) --latex-engine=$(PDFLATEX) \ - --template=$(srcdir)/template.tex \ - --variable="version:$(VERSION)" \ - --number-sections \ - --toc \ + $(PANDOC) --to=json \ --smart \ - --standalone \ - --output=$@ \ - $< + $< \ + | ./handle-images ".pdf" \ + | TEXINPUTS="$(srcdir);" \ + $(PANDOC) --from=json \ + --latex-engine=$(PDFLATEX) \ + --template=$(srcdir)/template.tex \ + --variable="version:$(VERSION)" \ + --number-sections \ + --toc \ + --chapters \ + --standalone \ + --output=$@ else -.svg.png: +.svg.pdf: @echo 1>&2 "warning: can't generate \`$@'" @echo 1>&2 " please install inkscape and reconfigure" @@ -112,12 +127,12 @@ @echo 1>&2 "warning: can't generate \`$@'" @echo 1>&2 " please install ImageMagick's \`import' tool and reconfigure" - ttfautohint.html: ttfautohint.txt $(DOCIMG) \ + ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) \ ttfautohint.css template.html $(top_srcdir)/.version @echo 1>&2 "warning: can't generate \`$@'" @echo 1>&2 " pleasae install pandoc and reconfigure" - ttfautohint.pdf: $ttfautohint.txt $(DOCIMG) \ + ttfautohint.pdf: $ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) \ template.tex $(top_srcdir)/.version @echo 1>&2 "warning: can't generate \`$@'" @echo 1>&2 " please install pdftex and pandoc, then reconfigure" diff -Nru ttfautohint-0.9/doc/Makefile.in ttfautohint-0.94/doc/Makefile.in --- ttfautohint-0.9/doc/Makefile.in 2012-06-06 05:36:58.000000000 +0000 +++ ttfautohint-0.94/doc/Makefile.in 2012-11-29 07:22:16.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.1 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -71,24 +71,35 @@ $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ + $(top_srcdir)/gnulib/m4/fcntl-o.m4 \ + $(top_srcdir)/gnulib/m4/fcntl_h.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ + $(top_srcdir)/gnulib/m4/isatty.m4 \ $(top_srcdir)/gnulib/m4/lib-ld.m4 \ $(top_srcdir)/gnulib/m4/lib-link.m4 \ $(top_srcdir)/gnulib/m4/lib-prefix.m4 \ $(top_srcdir)/gnulib/m4/libtool.m4 \ $(top_srcdir)/gnulib/m4/lock.m4 \ + $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/ltoptions.m4 \ $(top_srcdir)/gnulib/m4/ltsugar.m4 \ $(top_srcdir)/gnulib/m4/ltversion.m4 \ $(top_srcdir)/gnulib/m4/lt~obsolete.m4 \ + $(top_srcdir)/gnulib/m4/memchr.m4 \ + $(top_srcdir)/gnulib/m4/memmem.m4 \ + $(top_srcdir)/gnulib/m4/mmap-anon.m4 \ + $(top_srcdir)/gnulib/m4/msvc-inval.m4 \ + $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gnulib/m4/multiarch.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ + $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/strerror_r.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ @@ -104,12 +115,18 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -124,10 +141,11 @@ img/afii10108-11px-after-hinting.png \ img/afii10108-11px-before-hinting.png \ img/afii10108-12px-after-hinting.png \ - img/afii10108-12px-before-hinting.png img/blue-zones.png \ - img/e-17px-x14.png img/e-17px-x17.png img/glyph-terms.png \ - img/o-and-i.png img/segment-edge.png img/blue-zones.svg \ - img/glyph-terms.svg img/o-and-i.svg img/segment-edge.svg + img/afii10108-12px-before-hinting.png img/e-17px-x14.png \ + img/e-17px-x17.png img/ff-g-26px.png img/ff-g-26px-wD.png \ + img/blue-zones.svg img/glyph-terms.svg img/o-and-i.svg \ + img/segment-edge.svg img/blue-zones.pdf img/glyph-terms.pdf \ + img/o-and-i.pdf img/segment-edge.pdf am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -161,12 +179,18 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -198,6 +222,7 @@ FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GETOPT_H = @GETOPT_H@ +GHC = @GHC@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ @@ -209,6 +234,7 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ @@ -248,6 +274,9 @@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -309,6 +338,7 @@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ @@ -321,12 +351,16 @@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ @@ -336,7 +370,11 @@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ @@ -346,10 +384,15 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HELP2MAN = @HELP2MAN@ @@ -384,14 +427,18 @@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ @@ -413,6 +460,7 @@ PDFLATEX = @PDFLATEX@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QMAKE = @QMAKE@ QT_CFLAGS = @QT_CFLAGS@ QT_CPPFLAGS = @QT_CPPFLAGS@ @@ -432,6 +480,7 @@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ @@ -446,6 +495,8 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_READ = @REPLACE_READ@ @@ -473,14 +524,19 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ UIC = @UIC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -526,6 +582,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -543,32 +600,38 @@ ttfautohint-2.pandoc \ ttfautohint-3.pandoc -DOCIMGSRC = img/blue-zones.svg \ +DOCIMGSVG = img/blue-zones.svg \ img/glyph-terms.svg \ img/o-and-i.svg \ img/segment-edge.svg -DOCIMG = img/ttfautohintGUI.png \ - img/a-before-hinting.png \ - img/a-after-hinting.png \ - img/a-after-autohinting.png \ - img/afii10108-11px-after-hinting.png \ - img/afii10108-11px-before-hinting.png \ - img/afii10108-12px-after-hinting.png \ - img/afii10108-12px-before-hinting.png \ - img/blue-zones.png \ - img/e-17px-x14.png \ - img/e-17px-x17.png \ - img/glyph-terms.png \ - img/o-and-i.png \ - img/segment-edge.png +DOCIMGPDF = img/blue-zones.pdf \ + img/glyph-terms.pdf \ + img/o-and-i.pdf \ + img/segment-edge.pdf + +DOCIMGPNG = img/ttfautohintGUI.png \ + img/a-before-hinting.png \ + img/a-after-hinting.png \ + img/a-after-autohinting.png \ + img/afii10108-11px-after-hinting.png \ + img/afii10108-11px-before-hinting.png \ + img/afii10108-12px-after-hinting.png \ + img/afii10108-12px-before-hinting.png \ + img/e-17px-x14.png \ + img/e-17px-x17.png \ + img/ff-g-26px.png \ + img/ff-g-26px-wD.png DOC = ttfautohint.html \ ttfautohint.pdf \ ttfautohint.txt \ - $(DOCIMG) + $(DOCIMGPNG) \ + $(DOCIMGSVG) \ + $(DOCIMGPDF) EXTRA_DIST = c2pandoc.sed \ + handle-images.hs \ make-snapshot.sh \ strip-comments.sh \ ttfautohint-1.pandoc \ @@ -578,13 +641,11 @@ template.tex \ ttfautohint.css -@WITH_DOC_TRUE@nobase_dist_doc_DATA = $(DOC) \ -@WITH_DOC_TRUE@ $(DOCIMGSRC) - +@WITH_DOC_TRUE@nobase_dist_doc_DATA = $(DOC) all: all-am .SUFFIXES: -.SUFFIXES: .png .svg +.SUFFIXES: .pdf .svg $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -809,11 +870,13 @@ ttfautohint.txt: $(DOCSRC) $(SHELL) $(srcdir)/strip-comments.sh $^ > $@ -@WITH_DOC_TRUE@ # this is a temporary solution: -@WITH_DOC_TRUE@ # the right one is to write a pandoc filter -@WITH_DOC_TRUE@ # which uses `foo.svg' for HTML and `foo.pdf' for PDF output -@WITH_DOC_TRUE@.svg.png: -@WITH_DOC_TRUE@ $(INKSCAPE) --export-background=white --export-png=$@ $< +@WITH_DOC_TRUE@ # the pandoc image filter +@WITH_DOC_TRUE@ handle-images: handle-images.hs +@WITH_DOC_TRUE@ $(GHC) -dynamic --make $@ + +@WITH_DOC_TRUE@ # suffix rules must always start in column 0 +@WITH_DOC_TRUE@.svg.pdf: +@WITH_DOC_TRUE@ $(INKSCAPE) --export-pdf=$@ $< @WITH_DOC_TRUE@ # build snapshot image of ttfautohintGUI: @WITH_DOC_TRUE@ # this needs X11 and ImageMagick's `import' tool @@ -826,30 +889,37 @@ @WITH_DOC_TRUE@ $(SHELL) $(srcdir)/make-snapshot.sh \ @WITH_DOC_TRUE@ $(top_builddir)/frontend/ttfautohintGUI$(EXEEXT) $@ -@WITH_DOC_TRUE@ ttfautohint.html: ttfautohint.txt $(DOCIMG) \ +@WITH_DOC_TRUE@ ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) handle-images \ @WITH_DOC_TRUE@ ttfautohint.css template.html $(top_srcdir)/.version -@WITH_DOC_TRUE@ $(PANDOC) --template=$(srcdir)/template.html \ -@WITH_DOC_TRUE@ --variable="version:$(VERSION)" \ -@WITH_DOC_TRUE@ --toc \ -@WITH_DOC_TRUE@ --include-in-header=$(srcdir)/ttfautohint.css \ +@WITH_DOC_TRUE@ $(PANDOC) --to=json \ @WITH_DOC_TRUE@ --smart \ -@WITH_DOC_TRUE@ --standalone \ -@WITH_DOC_TRUE@ --output=$@ \ -@WITH_DOC_TRUE@ $< +@WITH_DOC_TRUE@ $< \ +@WITH_DOC_TRUE@ | ./handle-images ".svg" \ +@WITH_DOC_TRUE@ | $(PANDOC) --from=json \ +@WITH_DOC_TRUE@ --template=$(srcdir)/template.html \ +@WITH_DOC_TRUE@ --variable="version:$(VERSION)" \ +@WITH_DOC_TRUE@ --toc \ +@WITH_DOC_TRUE@ --include-in-header=$(srcdir)/ttfautohint.css \ +@WITH_DOC_TRUE@ --standalone \ +@WITH_DOC_TRUE@ --output=$@ -@WITH_DOC_TRUE@ ttfautohint.pdf: ttfautohint.txt $(DOCIMG) \ +@WITH_DOC_TRUE@ ttfautohint.pdf: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) handle-images \ @WITH_DOC_TRUE@ template.tex $(top_srcdir)/.version -@WITH_DOC_TRUE@ TEXINPUTS="$(srcdir);" \ -@WITH_DOC_TRUE@ $(PANDOC) --latex-engine=$(PDFLATEX) \ -@WITH_DOC_TRUE@ --template=$(srcdir)/template.tex \ -@WITH_DOC_TRUE@ --variable="version:$(VERSION)" \ -@WITH_DOC_TRUE@ --number-sections \ -@WITH_DOC_TRUE@ --toc \ +@WITH_DOC_TRUE@ $(PANDOC) --to=json \ @WITH_DOC_TRUE@ --smart \ -@WITH_DOC_TRUE@ --standalone \ -@WITH_DOC_TRUE@ --output=$@ \ -@WITH_DOC_TRUE@ $< -@WITH_DOC_FALSE@.svg.png: +@WITH_DOC_TRUE@ $< \ +@WITH_DOC_TRUE@ | ./handle-images ".pdf" \ +@WITH_DOC_TRUE@ | TEXINPUTS="$(srcdir);" \ +@WITH_DOC_TRUE@ $(PANDOC) --from=json \ +@WITH_DOC_TRUE@ --latex-engine=$(PDFLATEX) \ +@WITH_DOC_TRUE@ --template=$(srcdir)/template.tex \ +@WITH_DOC_TRUE@ --variable="version:$(VERSION)" \ +@WITH_DOC_TRUE@ --number-sections \ +@WITH_DOC_TRUE@ --toc \ +@WITH_DOC_TRUE@ --chapters \ +@WITH_DOC_TRUE@ --standalone \ +@WITH_DOC_TRUE@ --output=$@ +@WITH_DOC_FALSE@.svg.pdf: @WITH_DOC_FALSE@ @echo 1>&2 "warning: can't generate \`$@'" @WITH_DOC_FALSE@ @echo 1>&2 " please install inkscape and reconfigure" @@ -858,12 +928,12 @@ @WITH_DOC_FALSE@ @echo 1>&2 "warning: can't generate \`$@'" @WITH_DOC_FALSE@ @echo 1>&2 " please install ImageMagick's \`import' tool and reconfigure" -@WITH_DOC_FALSE@ ttfautohint.html: ttfautohint.txt $(DOCIMG) \ +@WITH_DOC_FALSE@ ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) \ @WITH_DOC_FALSE@ ttfautohint.css template.html $(top_srcdir)/.version @WITH_DOC_FALSE@ @echo 1>&2 "warning: can't generate \`$@'" @WITH_DOC_FALSE@ @echo 1>&2 " pleasae install pandoc and reconfigure" -@WITH_DOC_FALSE@ ttfautohint.pdf: $ttfautohint.txt $(DOCIMG) \ +@WITH_DOC_FALSE@ ttfautohint.pdf: $ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) \ @WITH_DOC_FALSE@ template.tex $(top_srcdir)/.version @WITH_DOC_FALSE@ @echo 1>&2 "warning: can't generate \`$@'" @WITH_DOC_FALSE@ @echo 1>&2 " please install pdftex and pandoc, then reconfigure" diff -Nru ttfautohint-0.9/doc/handle-images.hs ttfautohint-0.94/doc/handle-images.hs --- ttfautohint-0.9/doc/handle-images.hs 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/doc/handle-images.hs 2012-06-26 13:34:43.000000000 +0000 @@ -0,0 +1,65 @@ +-- handle-images.hs +-- +-- Copyright (C) 2012 by Werner Lemberg. +-- +-- This file is part of the ttfautohint library, and may only be used, +-- modified, and distributed under the terms given in `COPYING'. By +-- continuing to use, modify, or distribute this file you indicate +-- that you have read `COPYING' and understand and accept it fully. +-- +-- The file `COPYING' mentioned in the previous paragraph is +-- distributed with the ttfautohint library. +-- +-- +-- This is a simple pandoc filter to support different image formats +-- for different backends. It simply appends the suffix given as a +-- command line option to all pandoc images and checks whether the +-- image files actually exist. For non-existent files the file name +-- doesn't get altered. +-- +-- Command line examples: +-- +-- % pandoc -t json foo \ +-- | ./handle-images ".svg" \ +-- | pandoc -f json -t html \ +-- > foo.html +-- +-- % pandoc -t json foo \ +-- | ./handle-images ".pdf" \ +-- | pandoc --latex-engine=pdflatex -f json -t latex \ +-- > foo.tex + + +import Text.Pandoc +import System.Environment(getArgs) +import System.Directory(doesFileExist) + + +handleImage :: String + -> Inline + -> IO Inline +handleImage format + (Image description (basename, title)) = do + let + filename = basename ++ format + + fileExists <- doesFileExist filename + if fileExists + then + return $ Image description (filename, title) + else + return $ Image description (basename, title) +handleImage _ x = return x + + +main :: IO () +main = do + args <- getArgs + toJsonFilter + $ handleImage + $ case args of + [f] -> f + _ -> "" -- default + + +-- end of handle-images.hs Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/blue-zones.pdf and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/blue-zones.pdf differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/blue-zones.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/blue-zones.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/ff-g-26px-wD.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/ff-g-26px-wD.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/ff-g-26px.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/ff-g-26px.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/glyph-terms.pdf and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/glyph-terms.pdf differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/glyph-terms.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/glyph-terms.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/o-and-i.pdf and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/o-and-i.pdf differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/o-and-i.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/o-and-i.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/segment-edge.pdf and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/segment-edge.pdf differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/segment-edge.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/segment-edge.png differ Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/img/ttfautohintGUI.png and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/img/ttfautohintGUI.png differ diff -Nru ttfautohint-0.9/doc/template.tex ttfautohint-0.94/doc/template.tex --- ttfautohint-0.9/doc/template.tex 2012-05-31 07:44:49.000000000 +0000 +++ ttfautohint-0.94/doc/template.tex 2012-07-17 14:22:37.000000000 +0000 @@ -1,5 +1,6 @@ -\documentclass[$if(fontsize)$$fontsize$,$endif$ - $if(lang)$$lang$,$endif$]{scrartcl} +\documentclass[$if(fontsize)$$fontsize$,$endif$% + $if(lang)$$lang$,$endif$% + DIV=13]{scrreprt} \usepackage{ifxetex,ifluatex} \usepackage[T1]{fontenc} @@ -79,6 +80,7 @@ \usepackage[unicode=true, colorlinks=true, linkcolor=blue]{hyperref} + \usepackage{microtype} \fi \hypersetup{breaklinks=true, pdfborder={0 0 0}} @@ -127,9 +129,7 @@ \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines -% We want a break after the description label. Alas, it is necessary to -% copy the whole definition of \@item and the `description' environemnt just -% to insert `\\'... +% We want a break after the description label (if there is one). \makeatletter \let\original@item\@item @@ -192,8 +192,14 @@ \box\@tempboxa \else \hbox to\labelwidth {\unhbox\@tempboxa}% - \fi}% + \fi + \hskip \labelsep}% + \def\reserved@a{#1}% + \def\reserved@b{\@itemlabel}% + \ifx\reserved@a \reserved@b + \else \leavevmode\\ + \fi \ignorespaces} \renewenvironment{description}{% diff -Nru ttfautohint-0.9/doc/ttfautohint-1.pandoc ttfautohint-0.94/doc/ttfautohint-1.pandoc --- ttfautohint-0.9/doc/ttfautohint-1.pandoc 2012-06-05 12:55:54.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint-1.pandoc 2012-11-26 08:41:48.000000000 +0000 @@ -19,18 +19,18 @@ Introduction ============ -**ttfautohint** is a library which takes a TrueType font as the input, -removes its bytecode instructions (if any), and returns a new font where all -glyphs are bytecode hinted using the information given by FreeType's -autohinting module. The idea is to provide the excellent quality of the -autohinter on platforms which don't use FreeType. +**ttfautohint** is a library written in\ C which takes a TrueType font as +the input, removes its bytecode instructions (if any), and returns a new +font where all glyphs are bytecode hinted using the information given by +FreeType's autohinting module. The idea is to provide the excellent quality +of the autohinter on platforms which don't use FreeType. The library has a single API function, `TTF_autohint`, which is described -[below](#function-ttf_autohint). +[below](#the-ttfautohint-api). Bundled with the library there are two front-end programs, [`ttfautohint` and `ttfautohintGUI`](#ttfautohint-and-ttfautohintgui), being a command line -and GUI application, respectively. +and an application with a Graphics User Interface (GUI), respectively. What exactly are hints? @@ -70,7 +70,7 @@ move the points of its outlines, depending on the resolution of the output device, and which intentionally distort the (outline) shape to produce a well-rasterized result. The hinting logic is in the font; - ideally, all rasterizeres simply process these instructions to get the + ideally, all rasterizers simply process these instructions to get the same result on all platforms. This is how TrueType hints work. @@ -135,11 +135,9 @@ with web browsers, for example. Across Windows rendering environments today, fonts processed with -ttfautohint look best with DirectWrite ClearType enabled. This is the -default for Windows\ 7. Good visual results are also seen in recent -MacOS\ X versions and GNU/Linux systems that use FreeType for rendering. -Work is now underway to improve the quality of the older Windows 'GDI' -rendering. +ttfautohint look best with ClearType enabled. This is the default for +Windows\ 7. Good visual results are also seen in recent MacOS\ X versions +and GNU/Linux systems that use FreeType for rendering. The goal of the project is to generate a 'first pass' of hinting that font developers can refine further for ultimate quality. @@ -158,30 +156,67 @@ Both the GUI and console version share the same features, to be discussed in the next subsection. -**Warning: ttfautohint can't process a font a second time** (well, it can, -if the font doesn't contain composite glyphs). Just think of ttfautohint as -being a compiler, a tool which also can't process its created output again. +**Warning: ttfautohint cannot always process a font a second time.** +If the font contains composite glyphs, and option `-c` is not used, +reprocessing with ttfautohint will fail. For this reason it is strongly +recommended to *not* delete the original, unhinted font so that you can +always rerun ttfautohint. -Options -------- +Calling `ttfautohint` +--------------------- + +``` + ttfautohint [OPTION]... [IN-FILE [OUT-FILE]] +``` + +The TTY binary, `ttfautohint`, works like a Unix filter, this is, it reads +data from standard input if no input file name is given, and it sends its +output to standard output if no output file name is specified. + +A typical call looks like the following. + +``` + ttfautohint -v -f foo.ttf foo-autohinted.ttf +``` + +For demonstration purposes, here the same using a pipe and redirection. +Note that Windows's default command line interpreter, `cmd.exe`, doesn't +support piping with binary files, unfortunately. + +``` + cat foo.ttf | ttfautohint -v -f > foo-autohinted.ttf +``` + + +Calling `ttfautohintGUI` +------------------------ + +``` + ttfautohintGUI [OPTION]... +``` `ttfautohintGUI` doesn't send any output to a console; however, it accepts the same command line options as `ttfautohint`, setting default values for the GUI. -Long options can be given with one or two dashes, and with and without equal -sign between option and argument. This means that the following forms are -acceptable: `-foo=`*bar*, `--foo=`*bar*, `-foo`\ *bar*, and `--foo`\ *bar*. -Below, the section title gives the command's label in the GUI, then comes -the name of the corresponding long command line option and its short +Options +------- + +Long options can be given with one or two dashes, and with and without an +equal sign between option and argument. This means that the following forms +are acceptable: `-foo=`*bar*, `--foo=`*bar*, `-foo`\ *bar*, and +`--foo`\ *bar*. + +Below, the section title refers to the command's label in the GUI, then +comes the name of the corresponding long command line option and its short equivalent, followed by a description. Background and technical details on the meaning of the various options are given [afterwards](#background-and-technical-details). -### Hint Set Ranges +### Hint Set Range Minimum, Hint Set Range Maximum See ['Hint Sets'](#hint-sets) for a definition and explanation. @@ -193,6 +228,13 @@ : The maximum PPEM value (in pixels) at which hint sets are created. The default value for *n* is 50. +### Fallback Script + +`--latin-fallback`, `-f` +: Set fallback script to 'latin', this is, use the 'latin' auto-hinting + module instead of 'none' for all glyphs which can't be assigned to a + script. See [below](#scripts) for more details. + ### Hinting Limit `--hinting-limit=`*n*, `-G`\ *n* @@ -220,28 +262,82 @@ glyphs like 'a' or 'e', depending on the font design. To switch off this feature, use `--increase-x-height=0` (or check the - `No x\ Height Increase' box in the GUI). + 'No x\ Height Increase' box in the GUI). - The following images use the font ['Mertz - Bold'](http://code.newtypography.co.uk/?p=2449) (still under - development) from [Vernon Adams]. + The following images again use the font 'Mertz Bold'. - ![At 17px, without option `-x`, the hole in glyph 'e' looks very grey in - the FontForge snapshot, and the GDI ClearType rendering (which is the - default on older Windows versions) fills it completely with black - because it uses B/W rendering along the y\ axis. FreeType's - autohinter (and thus ttfautohint too) intentionally aligns horizontal - lines to non-integer values also to avoid large glyph shape + ![At 17px, without option `-x` and '`-w ""`', the hole in glyph 'e' + looks very grey in the FontForge snapshot, and the GDI ClearType + rendering (which is the default on older Windows versions) fills it + completely with black because it uses B/W rendering along the y\ axis. + FreeType's 'light' autohint mode (which corresponds to ttfautohint's + 'smooth' stem width algorithm) intentionally aligns horizontal lines + to non-integer (but still discrete) values to avoid large glyph shape distortions.](img/e-17px-x14.png) - ![The same, this time with option `-x 17`.](img/e-17px-x17.png) + ![The same, this time with option `-x 17` (and + '`-w ""`').](img/e-17px-x17.png) -### Fallback Script +### x Height Snapping Exceptions -`--latin-fallback`, `-f` -: Set fallback script to 'latin', this is, use the 'latin' auto-hinting - module instead of 'none' for all glyphs which can't be assigned to a - script. See [above](#scripts) for more details. +`--x-height-snapping-exceptions=`*string*, `-X`\ *string* +: A list of comma separated PPEM values or value ranges at which no + x-height snapping shall be applied. A value range has the form + *value1*`-`*value2*, meaning *value1*\ <= PPEM <=\ *value2*. *value1* + or *value2* (or both) can be missing; a missing value is replaced by the + beginning or end of the whole interval of valid PPEM values, + respectively (6\ to 32767). Whitespace is not significant; superfluous + commas are ignored, and ranges must be specified in increasing order. + For example, the string `"7-9, 11, 13-"` means the values 7, 8, 9, 11, + 13, 14, 15, etc. Consequently, if the supplied argument is `"-"`, no + x-height snapping takes place at all. The default is the empty string + (`""`), meaning no snapping exceptions. + + Normally, x-height snapping means a slight increase in the overall + vertical glyph size so that the height of lowercase glyphs gets aligned + to the pixel grid. However, having larger vertical glyph sizes is not + always desired, especially if it is not possible to adjust the + `usWinAscent` and `usWinDescent` values from the font's `OS/2` table so + that they are not too tight. See ['Windows + Compatibility'](#windows-compatibility) for more details. + +### Windows Compatibility + +`--windows-compatibility`, `-W` +: This option makes ttfautohint add two artificial blue zones, positioned + at the `usWinAscent` and `usWinDescent` values (from the font's `OS/2` + table). The idea is to help ttfautohint so that the hinted glyphs stay + within this horizontal stripe since Windows clips everything falling + outside. + + There is a general problem with tight values for `usWinAscent` and + `usWinDescent`; a good description is given in the [Vertical Metrics + How-To](http://typophile.com/node/13081). Additionally, there is a + special problem with tight values if used in combination with + ttfautohint because the auto-hinter tends to slightly increase the + vertical glyph dimensions at smaller sizes to improve legibility. This + enlargement can make the heights and depths of glyphs exceed the range + given by `usWinAscent` and `usWinDescent`. + + If ttfautohint is part of the font creation tool chain, and the font + designer can adjust those two values, a better solution instead of using + option `-W` is to reserve some vertical space for 'padding': For the + auto-hinter, the difference between a top or bottom outline point before + and after hinting is less than 1px, thus a vertical padding of 2px is + sufficient. Assuming a minimum hinting size of 6ppem, adding two pixels + gives an increase factor of 8÷6 = 1.33. This is near to the default + baseline-to-baseline distance used by TeX and other sophisticated text + processing applications, namely 1.2×designsize, which gives satisfying + results in most cases. It is also near to the factor 1.25 recommended + in the abovementioned How-To. For example, if the vertical extension of + the largest glyph is 2000 units (assuming that it approximately + represents the designsize), the sum of `usWinAscent` and `usWinDescent` + could be 1.25×2000 = 2500. + + In case ttfautohint is used as an auto-hinting tool for fonts which can + be no longer modified to change the metrics, option `-W` in combination + with '`-X "-"`' to suppress any vertical enlargement should prevent + almost all clipping. ### Pre-Hinting @@ -253,7 +349,28 @@ CJK fonts need this because the bytecode is used to scale and shift subglyphs. For most fonts, however, this is not the case. -### ttfautohint Info +### Hint With Components + +`--components`, `-c` +: Hint glyph components separately instead of hinting composite glyphs as + a whole. Using this flag reduces the bytecode size enormously, however, + it might yield worse results. In the GUI it is similar: If you uncheck + the 'Process With Components' box, glyph components are hinted + separately. + + If a font contains composite glyphs and those glyphs are hinted as a + whole, ttfautohint cannot reprocess its own output. + +### Symbol Font + +`--symbol`, `-s` +: Use default values for standard (horizontal) stem width and height + instead of deriving them from latin character 'o'. Use this option + (usually in combination with option `--latin-fallback`) to hint symbol + or dingbat fonts or math glyphs, for example, which lack character 'o', + at the expense of possibly poor hinting results at small sizes. + +### Add ttfautohint Info `--no-info`, `-n` : Don't add ttfautohint version and command line information to the @@ -262,14 +379,58 @@ information is not added to the `name` table. Except for testing and development purposes it is strongly recommended to not use this option. -### Symbol Fonts +### Strong Stem Width and Positioning -`--symbol`, `-s` -: Use default values for standard stem width and height instead of - deriving them from latin character 'o'. Use this option (usually in - combination with option `--latin-fallback`) to hint symbol or dingbat - fonts or math glyphs, for example, which lack character 'o', at the - expense of possibly poor hinting results at small sizes. +`--strong-stem-width=`*string*, `-w`\ *string* +: ttfautohint offers two different routines to handle (horizontal) stem + widths and stem positions: 'smooth' and 'strong'. The former uses + discrete values which slightly increase the stem contrast with almost no + distortion of the outlines, while the latter snaps both stem widths and + stem positions to integer pixel values as much as possible, yielding a + crisper appearance at the cost of much more distortion. + + These two routines are mapped onto three possible rendering targets: + + - grayscale rendering, with or without optimization for subpixel + positioning (e.g. Mac OS\ X) + + - 'GDI ClearType' rendering: the rasterizer version, as returned by the + GETINFO bytecode instruction, is in the range 36\ <= version <\ 38 and + ClearType is enabled (e.g. Windows XP) + + - 'DirectWrite ClearType' rendering: the rasterizer version, as returned + by the GETINFO bytecode instruction, is >=\ 38, ClearType is enabled, + and subpixel positioning is enabled also (e.g. Internet Explorer\ 9 + running on Windows\ 7) + + GDI ClearType uses a mode similar to B/W rendering along the vertical + axis, while DW ClearType applies grayscale rendering. Additionally, + only DW ClearType provides subpixel positioning along the x\ axis. For + what it's worth, the rasterizers version\ 36 and version\ 38 in + Microsoft Windows are two completely different rendering engines. + + The command line option expects *string* to contain up to three letters + with possible values '`g`' for grayscale, '`G`' for GDI ClearType, and + '`D`' for DW ClearType. If a letter is found in *string*, the strong + stem width routine is used for the corresponding rendering target. The + default value is '`G`' which means that strong stem width handling is + activated for GDI ClearType only. To use smooth stem width handling for + all three rendering targets, use the empty string as an argument, + usually connoted with '`""`'. + + In the GUI, simply set the corresponding check box to select the stem + width routine for a given rendering target. + + The following FontForge snapshot images use the font ['Mertz + Bold'](http://code.newtypography.co.uk/?p=2449) (still under + development) from [Vernon Adams]. + + ![The left part shows the glyph 'g' unhinted at 26px, the right part + with hints, using the 'smooth' stem algorithm.](img/ff-g-26px.png) + + ![The same, but this time using the 'strong' + algorithm. Note how the stems are aligned to the pixel + grid.](img/ff-g-26px-wD.png) ### Font License Restrictions @@ -291,22 +452,10 @@ : On the console, print version information on standard output and exit. This doesn't work with `ttfautohintGUI` on MS Windows. - - -Samples -======= - - -Roboto ------- - -TODO - - -Ubuntu ------- - -TODO +`--debug` +: Print *a lot* of debugging information on standard error while + processing a font (you should redirect stderr to a file). This + doesn't work with `ttfautohintGUI` on MS Windows. @@ -331,7 +480,7 @@ example, glyph 'O' consists of two contours, while glyph 'I' has only one. ![The letter 'O' has two contours, an inner and an outer one, while letter - 'I' has only an outer contour.](img/o-and-i.png) + 'I' has only an outer contour.](img/o-and-i) A *segment* is a series of consecutive points of a contour (including its Bézier control points) that are approximately aligned along a coordinate @@ -341,7 +490,7 @@ circles, respectively. The bottom 'line' DE is approximately aligned along the horizontal axis, thus it forms a segment of 7\ points. Together with the two other horizontal segments, BC and FG, they form two edges - (BC+FG, DE).](img/segment-edge.png) + (BC+FG, DE).](img/segment-edge) An *edge* corresponds to a single coordinate value on the main dimension that collects one or more segments (allowing for a small threshold). While @@ -354,7 +503,9 @@ Feature Analysis ---------------- -The auto-hinter analyzes a font in two steps. +The auto-hinter analyzes a font in two steps. Right now, everything +described below happens for the horizontal axis only, providing vertical +hinting. * Global Analysis @@ -385,7 +536,7 @@ ---------- ![Two blue zones relevant to the glyph 'a'. Vertical point coordinates of - *all* glyphs within these zones are aligned.](img/blue-zones.png) + *all* glyphs within these zones are aligned.](img/blue-zones) Outlines of certain characters are used to determine *blue zones*. This concept is the same as with Type\ 1 fonts: All glyph points which lie in @@ -409,7 +560,7 @@ option](#x-height-increase-limit). ![This image shows the relevant glyph terms for vertical blue zone - positions.](img/glyph-terms.png) + positions.](img/glyph-terms) Grid Fitting @@ -454,11 +605,16 @@ In ttfautohint terminology, a *hint set* is the *optimal* configuration for a given PPEM (pixel per EM) value. -Internally, ttfautohint creates hint sets for every PPEM value in the range -given by the `--hinting-range-min` and `--hinting-range-max` options (this -is a per-glyph operation). If it differs to the current one, a new set is -emitted. For some glyphs it is possible that one set covers, say, the range -8px-1000px, while other glyphs need 10 or more such sets. +In the range given by the `--hinting-range-min` and `--hinting-range-max` +options, ttfautohint creates hint sets for every PPEM value. For each +glyph, ttfautohint automatically determines if a new set should be emitted +for a PPEM value if it finds that it differs from a previous one. For some +glyphs it is possible that one set covers, say, the range 8px-1000px, while +other glyphs need 10 or more such sets. + +In the PPEM range below `--hinting-range-min`, ttfautohint always uses just +one set, in the PPEM range between `--hinting-range-max` and +`--hinting-limit`, it also uses just one set. One of the hinting configuration parameters is the decision which segments form an edge. For example, let us assume that two segments get aligned on a @@ -495,14 +651,25 @@ Similar arguments hold for `--hinting-range-min` except that there is no lower limit at which hinting is switched off. +An example. Let's assume that we have a hinting range 10\ <= ppem <=\ 100, +and the hinting limit is set to 250. For a given glyph, ttfautohint finds +out that four hint sets must be computed to exactly cover thes hinting +range: 10-15, 16-40, 41-80, and 81-100. For ppem values below 10ppem, the +hint set covering 10-15ppem is used, for ppem values larger than 100 the +hint set covering 81-100ppem is used. For ppem values larger than 250, no +hinting gets applied. + The '\.ttfautohint' Glyph ------------------------- -ttfautohint doesn't hint subglyphs of composite glyphs separately. Instead, -it hints the whole glyph, this is, composites get recursively expanded so -that they form simple glyphs, then hints are applied -- this is the normal -working mode of FreeType's auto-hinter. +[The behaviour described in this section does not apply if [option +`--components`](#hint-with-components) is used.] + +By default, ttfautohint doesn't hint subglyphs of composite glyphs +separately. Instead, it hints the whole glyph, this is, composites get +recursively expanded internally so that they form simple glyphs, then hints +are applied -- this is the normal working mode of FreeType's auto-hinter. One problem, however, must be solved: Hinting for subglyphs (which usually are used as normal glyphs also) must be deactivated so that nothing but the @@ -541,7 +708,6 @@ some test and demo programs like FreeType's `ftview` application or other glyph viewers which are able to bypass the `cmap` table might be affected.) - Scripts ------- @@ -553,39 +719,41 @@ module. As you can see, this also covers some non-latin scripts (in the Unicode sense) which have similar typographical properties. - Character range Description - ------------------- ------------- - 0x0020 - 0x007F Basic Latin (no control chars) - 0x00A0 - 0x00FF Latin-1 Supplement (no control chars) - 0x0100 - 0x017F Latin Extended-A - 0x0180 - 0x024F Latin Extended-B - 0x0250 - 0x02AF IPA Extensions - 0x02B0 - 0x02FF Spacing Modifier Letters - 0x0300 - 0x036F Combining Diacritical Marks - 0x0370 - 0x03FF Greek and Coptic - 0x0400 - 0x04FF Cyrillic - 0x0500 - 0x052F Cyrillic Supplement - 0x1D00 - 0x1D7F Phonetic Extensions - 0x1D80 - 0x1DBF Phonetic Extensions Supplement - 0x1DC0 - 0x1DFF Combining Diacritical Marks Supplement - 0x1E00 - 0x1EFF Latin Extended Additional - 0x1F00 - 0x1FFF Greek Extended - 0x2000 - 0x206F General Punctuation - 0x2070 - 0x209F Superscripts and Subscripts - 0x20A0 - 0x20CF Currency Symbols - 0x2150 - 0x218F Number Forms - 0x2460 - 0x24FF Enclosed Alphanumerics - 0x2C60 - 0x2C7F Latin Extended-C - 0x2DE0 - 0x2DFF Cyrillic Extended-A - 0xA640 - 0xA69F Cyrillic Extended-B - 0xA720 - 0xA7FF Latin Extended-D - 0xFB00 - 0xFB06 Alphab. Present. Forms (Latin Ligs) - 0x1D400 - 0x1D7FF Mathematical Alphanumeric Symbols + Character range Description + --------------------- ------------- + `0x0020` - `0x007F` Basic Latin (no control characters) + `0x00A0` - `0x00FF` Latin-1 Supplement (no control characters) + `0x0100` - `0x017F` Latin Extended-A + `0x0180` - `0x024F` Latin Extended-B + `0x0250` - `0x02AF` IPA Extensions + `0x02B0` - `0x02FF` Spacing Modifier Letters + `0x0300` - `0x036F` Combining Diacritical Marks + `0x0370` - `0x03FF` Greek and Coptic + `0x0400` - `0x04FF` Cyrillic + `0x0500` - `0x052F` Cyrillic Supplement + `0x1D00` - `0x1D7F` Phonetic Extensions + `0x1D80` - `0x1DBF` Phonetic Extensions Supplement + `0x1DC0` - `0x1DFF` Combining Diacritical Marks Supplement + `0x1E00` - `0x1EFF` Latin Extended Additional + `0x1F00` - `0x1FFF` Greek Extended + `0x2000` - `0x206F` General Punctuation + `0x2070` - `0x209F` Superscripts and Subscripts + `0x20A0` - `0x20CF` Currency Symbols + `0x2150` - `0x218F` Number Forms + `0x2460` - `0x24FF` Enclosed Alphanumerics + `0x2C60` - `0x2C7F` Latin Extended-C + `0x2DE0` - `0x2DFF` Cyrillic Extended-A + `0x2E00` - `0x2E7F` Supplemental Punctuation + `0xA640` - `0xA69F` Cyrillic Extended-B + `0xA720` - `0xA7FF` Latin Extended-D + `0xFB00` - `0xFB06` Alphabetical Presentation Forms (Latin Ligatures) + `0x1D400` - `0x1D7FF` Mathematical Alphanumeric Symbols + `0x1F100` - `0x1F1FF` Enclosed Alphanumeric Supplement If a glyph's character code is not covered by a script range, it is not hinted (or rather, it gets hinted by the 'dummy' auto-hinting module which essentially does nothing). This can be changed by specifying a *fallback -script* with option `--latin-fallback`. +script* with [option `--latin-fallback`](#fallback-script). It is planned to extend ttfautohint so that the `GSUB` OpenType table gets analyzed, mapping character codes to all glyph indices which can be reached diff -Nru ttfautohint-0.9/doc/ttfautohint-2.pandoc ttfautohint-0.94/doc/ttfautohint-2.pandoc --- ttfautohint-0.9/doc/ttfautohint-2.pandoc 2012-06-06 05:23:48.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint-2.pandoc 2012-11-29 07:24:17.000000000 +0000 @@ -37,8 +37,7 @@ (this value can't be larger than 65535). *curr_sfnt* gives the current subfont within a TrueType Collection (TTC), -and *num_sfnts* the total number of subfonts. Currently, the ttfautohint -library only hints glyphs from the `glyf` table used in subfont\ 0. +and *num_sfnts* the total number of subfonts. If the return value is non-zero, `TTF_autohint` aborts with `TA_Err_Canceled`. Use this for a 'Cancel' button or similar features in @@ -163,13 +162,41 @@ this field is not set, it defaults to `TA_HINTING_LIMIT`. If it is set to\ 0, no hinting limit is added to the bytecode. +`gray-strong-stem-width` +: An integer (1\ for 'on' and 0\ for 'off', which is the default) which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for normal grayscale rendering. + +`gdi-cleartype-strong-stem-width` +: An integer (1\ for 'on', which is the default, and 0\ for 'off') which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for GDI ClearType rendering, this is, the + rasterizer version (as returned by the GETINFO bytecode instruction) + is in the range 36\ <= version <\ 38 and ClearType is enabled. + +`dw-cleartype-strong-stem-width` +: An integer (1\ for 'on' and 0\ for 'off', which is the default) which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for DW ClearType rendering, this is, the + rasterizer version (as returned by the GETINFO bytecode instruction) + is >=\ 38, ClearType is enabled, and subpixel positioning is enabled + also. + `increase-x-height` -: An integer in the range 6-20. For PPEM values in the range 6\ <= - PPEM <=\ `increase-x-height`, round up the font's x\ height much more - often than normally. If it is set to\ 0, this feature is switched - off. If this field is not set, it defaults to - `TA_INCREASE_X_HEIGHT`. Use this flag to improve the legibility of - small font sizes if necessary. +: An integer. For PPEM values in the range 6\ <= PPEM + <=\ `increase-x-height`, round up the font's x\ height much more often + than normally. If it is set to\ 0, this feature is switched off. If + this field is not set, it defaults to `TA_INCREASE_X_HEIGHT`. Use + this flag to improve the legibility of small font sizes if necessary. + +`hint-with-components` +: If this integer is set to\ 1 (which is the default), ttfautohint + handles composite glyphs as a whole. This implies adding a special + glyph to the font, as documented [here](#the-.ttfautohint-glyph). + Setting it to\ 0, the components of composite glyphs are hinted + separately. While separate hinting of subglyphs makes the resulting + bytecode much smaller, it might deliver worse results. However, this + depends on the processed font and must be checked by inspection. `pre-hinting` : An integer (1\ for 'on' and 0\ for 'off', which is the default) to @@ -181,7 +208,7 @@ `info-callback` : A pointer of type [`TA_Info_Func`](#callback-ta_info_func), - specifying a callback function for manipulating the `name` table. + specifying a callback function for manipulating the `name` table. This function gets called for each `name` table entry. If not set or set to NULL, the table data stays unmodified. @@ -193,10 +220,22 @@ : A pointer of type `const char*` to a null-terminated string which gives a list of comma separated PPEM values or value ranges at which no x-height snapping shall be applied. A value range has the form - *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. - Whitespace is not significant; a trailing comma is ignored. If the - supplied argument is NULL, no x-height snapping takes place at all. - By default, there are no snapping exceptions. Not implemented yet. + *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. *value1* + or *value2* (or both) can be missing; a missing value is replaced by + the beginning or end of the whole interval of valid PPEM values, + respectively. Whitespace is not significant; superfluous commas are + ignored, and ranges must be specified in increasing order. For + example, the string `"3, 5-7, 9-"` means the values 3, 5, 6, 7, 9, + 10, 11, 12, etc. Consequently, if the supplied argument is `"-"`, no + x-height snapping takes place at all. The default is the empty + string (`""`), meaning no snapping exceptions. + +`windows-compatibility` +: If this integer is set to\ 1, two artificial blue zones are used, + positioned at the `usWinAscent` and `usWinDescent` values (from the + font's `OS/2` table). The idea is to help ttfautohint so that the + hinted glyphs stay within this horizontal stripe since Windows clips + everything falling outside. The default is\ 0. `ignore-restrictions` : If the font has set bit\ 1 in the 'fsType' field of the `OS/2` table, @@ -220,10 +259,14 @@ (for the latin script, it is character 'o'). The default value is\ 0. +`debug` +: If this integer is set to\ 1, lots of debugging information is print + to stderr. The default value is\ 0. + Remarks: - * Obviously, it is necessary to have an input and an output data stream. - All other options are optional. + * Obviously, it is necessary to have an input and an output data + stream. All other options are optional. * `hinting-range-min` and `hinting-range-max` specify the range for which the autohinter generates optimized hinting code. If a PPEM diff -Nru ttfautohint-0.9/doc/ttfautohint-3.pandoc ttfautohint-0.94/doc/ttfautohint-3.pandoc --- ttfautohint-0.9/doc/ttfautohint-3.pandoc 2012-06-06 05:24:43.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint-3.pandoc 2012-06-12 09:56:23.000000000 +0000 @@ -15,9 +15,12 @@ Compilation and Installation ============================ -Please read the files `INSTALL` and `INSTALL.git` (part of the source code -bundle) for instructions how to compile the ttfautohint library together -with its front-ends. +Please read the files +[`INSTALL`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/INSTALL) +and +[`INSTALL.git`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/INSTALL.git) +(part of the source code bundle) for instructions how to compile the +ttfautohint library together with its front-ends. TODO @@ -45,12 +48,13 @@ ======= Copyright © 2011-2012 by [Werner Lemberg](mailto:wl@gnu.org).\ -Copyright © 2011-2012 by [Dave Crossland](dave@understandingfonts.com). +Copyright © 2011-2012 by [Dave Crossland](mailto:dave@understandingfonts.com). This file is part of the ttfautohint library, and may only be used, -modified, and distributed under the terms given in `COPYING`. By continuing -to use, modify, or distribute this file you indicate that you have read -`COPYING` and understand and accept it fully. +modified, and distributed under the terms given in +[`COPYING`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/COPYING). +By continuing to use, modify, or distribute this file you indicate that you +have read `COPYING` and understand and accept it fully. The file `COPYING` mentioned in the previous paragraph is distributed with the ttfautohint library. diff -Nru ttfautohint-0.9/doc/ttfautohint.css ttfautohint-0.94/doc/ttfautohint.css --- ttfautohint-0.9/doc/ttfautohint.css 2012-05-31 07:50:37.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint.css 2012-09-21 16:28:54.000000000 +0000 @@ -68,7 +68,7 @@ right: 100%; width: 45em; max-width: 66%; - overflow: hidden; } + /* overflow: hidden; */ } .leftmenu .col2 { float: left; width: 13em; /* wd2 */ diff -Nru ttfautohint-0.9/doc/ttfautohint.html ttfautohint-0.94/doc/ttfautohint.html --- ttfautohint-0.9/doc/ttfautohint.html 2012-06-06 05:43:14.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint.html 2012-11-29 07:24:35.000000000 +0000 @@ -13,7 +13,7 @@ + content="0.94" /> ttfautohint @@ -87,7 +87,7 @@ right: 100%; width: 45em; max-width: 66%; - overflow: hidden; } + /* overflow: hidden; */ } .leftmenu .col2 { float: left; width: 13em; /* wd2 */ @@ -229,7 +229,7 @@ -.
Copyright © 2011-2012 by Dave Crossland.

-

This file is part of the ttfautohint library, and may only be used, modified, and distributed under the terms given in COPYING. By continuing to use, modify, or distribute this file you indicate that you have read COPYING and understand and accept it fully.

+.
Copyright © 2011-2012 by .

+

This file is part of the ttfautohint library, and may only be used, modified, and distributed under the terms given in COPYING. By continuing to use, modify, or distribute this file you indicate that you have read COPYING and understand and accept it fully.

The file COPYING mentioned in the previous paragraph is distributed with the ttfautohint library.

@@ -817,22 +903,24 @@
  • Why ttfautohint?
  • ttfautohint and ttfautohintGUI
  • -
  • Samples
  • Background and Technical Details
    • Segments and Edges
    • Feature Analysis
    • Binary files /tmp/OlvLYXtYZt/ttfautohint-0.9/doc/ttfautohint.pdf and /tmp/iHLiBw_KSN/ttfautohint-0.94/doc/ttfautohint.pdf differ diff -Nru ttfautohint-0.9/doc/ttfautohint.txt ttfautohint-0.94/doc/ttfautohint.txt --- ttfautohint-0.9/doc/ttfautohint.txt 2012-06-06 05:24:46.000000000 +0000 +++ ttfautohint-0.94/doc/ttfautohint.txt 2012-11-29 07:24:18.000000000 +0000 @@ -19,18 +19,18 @@ Introduction ============ -**ttfautohint** is a library which takes a TrueType font as the input, -removes its bytecode instructions (if any), and returns a new font where all -glyphs are bytecode hinted using the information given by FreeType's -autohinting module. The idea is to provide the excellent quality of the -autohinter on platforms which don't use FreeType. +**ttfautohint** is a library written in\ C which takes a TrueType font as +the input, removes its bytecode instructions (if any), and returns a new +font where all glyphs are bytecode hinted using the information given by +FreeType's autohinting module. The idea is to provide the excellent quality +of the autohinter on platforms which don't use FreeType. The library has a single API function, `TTF_autohint`, which is described -[below](#function-ttf_autohint). +[below](#the-ttfautohint-api). Bundled with the library there are two front-end programs, [`ttfautohint` and `ttfautohintGUI`](#ttfautohint-and-ttfautohintgui), being a command line -and GUI application, respectively. +and an application with a Graphics User Interface (GUI), respectively. What exactly are hints? @@ -70,7 +70,7 @@ move the points of its outlines, depending on the resolution of the output device, and which intentionally distort the (outline) shape to produce a well-rasterized result. The hinting logic is in the font; - ideally, all rasterizeres simply process these instructions to get the + ideally, all rasterizers simply process these instructions to get the same result on all platforms. This is how TrueType hints work. @@ -135,11 +135,9 @@ with web browsers, for example. Across Windows rendering environments today, fonts processed with -ttfautohint look best with DirectWrite ClearType enabled. This is the -default for Windows\ 7. Good visual results are also seen in recent -MacOS\ X versions and GNU/Linux systems that use FreeType for rendering. -Work is now underway to improve the quality of the older Windows 'GDI' -rendering. +ttfautohint look best with ClearType enabled. This is the default for +Windows\ 7. Good visual results are also seen in recent MacOS\ X versions +and GNU/Linux systems that use FreeType for rendering. The goal of the project is to generate a 'first pass' of hinting that font developers can refine further for ultimate quality. @@ -158,30 +156,67 @@ Both the GUI and console version share the same features, to be discussed in the next subsection. -**Warning: ttfautohint can't process a font a second time** (well, it can, -if the font doesn't contain composite glyphs). Just think of ttfautohint as -being a compiler, a tool which also can't process its created output again. +**Warning: ttfautohint cannot always process a font a second time.** +If the font contains composite glyphs, and option `-c` is not used, +reprocessing with ttfautohint will fail. For this reason it is strongly +recommended to *not* delete the original, unhinted font so that you can +always rerun ttfautohint. -Options -------- +Calling `ttfautohint` +--------------------- + +``` + ttfautohint [OPTION]... [IN-FILE [OUT-FILE]] +``` + +The TTY binary, `ttfautohint`, works like a Unix filter, this is, it reads +data from standard input if no input file name is given, and it sends its +output to standard output if no output file name is specified. + +A typical call looks like the following. + +``` + ttfautohint -v -f foo.ttf foo-autohinted.ttf +``` + +For demonstration purposes, here the same using a pipe and redirection. +Note that Windows's default command line interpreter, `cmd.exe`, doesn't +support piping with binary files, unfortunately. + +``` + cat foo.ttf | ttfautohint -v -f > foo-autohinted.ttf +``` + + +Calling `ttfautohintGUI` +------------------------ + +``` + ttfautohintGUI [OPTION]... +``` `ttfautohintGUI` doesn't send any output to a console; however, it accepts the same command line options as `ttfautohint`, setting default values for the GUI. -Long options can be given with one or two dashes, and with and without equal -sign between option and argument. This means that the following forms are -acceptable: `-foo=`*bar*, `--foo=`*bar*, `-foo`\ *bar*, and `--foo`\ *bar*. -Below, the section title gives the command's label in the GUI, then comes -the name of the corresponding long command line option and its short +Options +------- + +Long options can be given with one or two dashes, and with and without an +equal sign between option and argument. This means that the following forms +are acceptable: `-foo=`*bar*, `--foo=`*bar*, `-foo`\ *bar*, and +`--foo`\ *bar*. + +Below, the section title refers to the command's label in the GUI, then +comes the name of the corresponding long command line option and its short equivalent, followed by a description. Background and technical details on the meaning of the various options are given [afterwards](#background-and-technical-details). -### Hint Set Ranges +### Hint Set Range Minimum, Hint Set Range Maximum See ['Hint Sets'](#hint-sets) for a definition and explanation. @@ -193,6 +228,13 @@ : The maximum PPEM value (in pixels) at which hint sets are created. The default value for *n* is 50. +### Fallback Script + +`--latin-fallback`, `-f` +: Set fallback script to 'latin', this is, use the 'latin' auto-hinting + module instead of 'none' for all glyphs which can't be assigned to a + script. See [below](#scripts) for more details. + ### Hinting Limit `--hinting-limit=`*n*, `-G`\ *n* @@ -220,28 +262,82 @@ glyphs like 'a' or 'e', depending on the font design. To switch off this feature, use `--increase-x-height=0` (or check the - `No x\ Height Increase' box in the GUI). + 'No x\ Height Increase' box in the GUI). - The following images use the font ['Mertz - Bold'](http://code.newtypography.co.uk/?p=2449) (still under - development) from [Vernon Adams]. + The following images again use the font 'Mertz Bold'. - ![At 17px, without option `-x`, the hole in glyph 'e' looks very grey in - the FontForge snapshot, and the GDI ClearType rendering (which is the - default on older Windows versions) fills it completely with black - because it uses B/W rendering along the y\ axis. FreeType's - autohinter (and thus ttfautohint too) intentionally aligns horizontal - lines to non-integer values also to avoid large glyph shape + ![At 17px, without option `-x` and '`-w ""`', the hole in glyph 'e' + looks very grey in the FontForge snapshot, and the GDI ClearType + rendering (which is the default on older Windows versions) fills it + completely with black because it uses B/W rendering along the y\ axis. + FreeType's 'light' autohint mode (which corresponds to ttfautohint's + 'smooth' stem width algorithm) intentionally aligns horizontal lines + to non-integer (but still discrete) values to avoid large glyph shape distortions.](img/e-17px-x14.png) - ![The same, this time with option `-x 17`.](img/e-17px-x17.png) + ![The same, this time with option `-x 17` (and + '`-w ""`').](img/e-17px-x17.png) -### Fallback Script +### x Height Snapping Exceptions -`--latin-fallback`, `-f` -: Set fallback script to 'latin', this is, use the 'latin' auto-hinting - module instead of 'none' for all glyphs which can't be assigned to a - script. See [above](#scripts) for more details. +`--x-height-snapping-exceptions=`*string*, `-X`\ *string* +: A list of comma separated PPEM values or value ranges at which no + x-height snapping shall be applied. A value range has the form + *value1*`-`*value2*, meaning *value1*\ <= PPEM <=\ *value2*. *value1* + or *value2* (or both) can be missing; a missing value is replaced by the + beginning or end of the whole interval of valid PPEM values, + respectively (6\ to 32767). Whitespace is not significant; superfluous + commas are ignored, and ranges must be specified in increasing order. + For example, the string `"7-9, 11, 13-"` means the values 7, 8, 9, 11, + 13, 14, 15, etc. Consequently, if the supplied argument is `"-"`, no + x-height snapping takes place at all. The default is the empty string + (`""`), meaning no snapping exceptions. + + Normally, x-height snapping means a slight increase in the overall + vertical glyph size so that the height of lowercase glyphs gets aligned + to the pixel grid. However, having larger vertical glyph sizes is not + always desired, especially if it is not possible to adjust the + `usWinAscent` and `usWinDescent` values from the font's `OS/2` table so + that they are not too tight. See ['Windows + Compatibility'](#windows-compatibility) for more details. + +### Windows Compatibility + +`--windows-compatibility`, `-W` +: This option makes ttfautohint add two artificial blue zones, positioned + at the `usWinAscent` and `usWinDescent` values (from the font's `OS/2` + table). The idea is to help ttfautohint so that the hinted glyphs stay + within this horizontal stripe since Windows clips everything falling + outside. + + There is a general problem with tight values for `usWinAscent` and + `usWinDescent`; a good description is given in the [Vertical Metrics + How-To](http://typophile.com/node/13081). Additionally, there is a + special problem with tight values if used in combination with + ttfautohint because the auto-hinter tends to slightly increase the + vertical glyph dimensions at smaller sizes to improve legibility. This + enlargement can make the heights and depths of glyphs exceed the range + given by `usWinAscent` and `usWinDescent`. + + If ttfautohint is part of the font creation tool chain, and the font + designer can adjust those two values, a better solution instead of using + option `-W` is to reserve some vertical space for 'padding': For the + auto-hinter, the difference between a top or bottom outline point before + and after hinting is less than 1px, thus a vertical padding of 2px is + sufficient. Assuming a minimum hinting size of 6ppem, adding two pixels + gives an increase factor of 8÷6 = 1.33. This is near to the default + baseline-to-baseline distance used by TeX and other sophisticated text + processing applications, namely 1.2×designsize, which gives satisfying + results in most cases. It is also near to the factor 1.25 recommended + in the abovementioned How-To. For example, if the vertical extension of + the largest glyph is 2000 units (assuming that it approximately + represents the designsize), the sum of `usWinAscent` and `usWinDescent` + could be 1.25×2000 = 2500. + + In case ttfautohint is used as an auto-hinting tool for fonts which can + be no longer modified to change the metrics, option `-W` in combination + with '`-X "-"`' to suppress any vertical enlargement should prevent + almost all clipping. ### Pre-Hinting @@ -253,7 +349,28 @@ CJK fonts need this because the bytecode is used to scale and shift subglyphs. For most fonts, however, this is not the case. -### ttfautohint Info +### Hint With Components + +`--components`, `-c` +: Hint glyph components separately instead of hinting composite glyphs as + a whole. Using this flag reduces the bytecode size enormously, however, + it might yield worse results. In the GUI it is similar: If you uncheck + the 'Process With Components' box, glyph components are hinted + separately. + + If a font contains composite glyphs and those glyphs are hinted as a + whole, ttfautohint cannot reprocess its own output. + +### Symbol Font + +`--symbol`, `-s` +: Use default values for standard (horizontal) stem width and height + instead of deriving them from latin character 'o'. Use this option + (usually in combination with option `--latin-fallback`) to hint symbol + or dingbat fonts or math glyphs, for example, which lack character 'o', + at the expense of possibly poor hinting results at small sizes. + +### Add ttfautohint Info `--no-info`, `-n` : Don't add ttfautohint version and command line information to the @@ -262,14 +379,58 @@ information is not added to the `name` table. Except for testing and development purposes it is strongly recommended to not use this option. -### Symbol Fonts +### Strong Stem Width and Positioning -`--symbol`, `-s` -: Use default values for standard stem width and height instead of - deriving them from latin character 'o'. Use this option (usually in - combination with option `--latin-fallback`) to hint symbol or dingbat - fonts or math glyphs, for example, which lack character 'o', at the - expense of possibly poor hinting results at small sizes. +`--strong-stem-width=`*string*, `-w`\ *string* +: ttfautohint offers two different routines to handle (horizontal) stem + widths and stem positions: 'smooth' and 'strong'. The former uses + discrete values which slightly increase the stem contrast with almost no + distortion of the outlines, while the latter snaps both stem widths and + stem positions to integer pixel values as much as possible, yielding a + crisper appearance at the cost of much more distortion. + + These two routines are mapped onto three possible rendering targets: + + - grayscale rendering, with or without optimization for subpixel + positioning (e.g. Mac OS\ X) + + - 'GDI ClearType' rendering: the rasterizer version, as returned by the + GETINFO bytecode instruction, is in the range 36\ <= version <\ 38 and + ClearType is enabled (e.g. Windows XP) + + - 'DirectWrite ClearType' rendering: the rasterizer version, as returned + by the GETINFO bytecode instruction, is >=\ 38, ClearType is enabled, + and subpixel positioning is enabled also (e.g. Internet Explorer\ 9 + running on Windows\ 7) + + GDI ClearType uses a mode similar to B/W rendering along the vertical + axis, while DW ClearType applies grayscale rendering. Additionally, + only DW ClearType provides subpixel positioning along the x\ axis. For + what it's worth, the rasterizers version\ 36 and version\ 38 in + Microsoft Windows are two completely different rendering engines. + + The command line option expects *string* to contain up to three letters + with possible values '`g`' for grayscale, '`G`' for GDI ClearType, and + '`D`' for DW ClearType. If a letter is found in *string*, the strong + stem width routine is used for the corresponding rendering target. The + default value is '`G`' which means that strong stem width handling is + activated for GDI ClearType only. To use smooth stem width handling for + all three rendering targets, use the empty string as an argument, + usually connoted with '`""`'. + + In the GUI, simply set the corresponding check box to select the stem + width routine for a given rendering target. + + The following FontForge snapshot images use the font ['Mertz + Bold'](http://code.newtypography.co.uk/?p=2449) (still under + development) from [Vernon Adams]. + + ![The left part shows the glyph 'g' unhinted at 26px, the right part + with hints, using the 'smooth' stem algorithm.](img/ff-g-26px.png) + + ![The same, but this time using the 'strong' + algorithm. Note how the stems are aligned to the pixel + grid.](img/ff-g-26px-wD.png) ### Font License Restrictions @@ -291,22 +452,10 @@ : On the console, print version information on standard output and exit. This doesn't work with `ttfautohintGUI` on MS Windows. - - -Samples -======= - - -Roboto ------- - -TODO - - -Ubuntu ------- - -TODO +`--debug` +: Print *a lot* of debugging information on standard error while + processing a font (you should redirect stderr to a file). This + doesn't work with `ttfautohintGUI` on MS Windows. @@ -331,7 +480,7 @@ example, glyph 'O' consists of two contours, while glyph 'I' has only one. ![The letter 'O' has two contours, an inner and an outer one, while letter - 'I' has only an outer contour.](img/o-and-i.png) + 'I' has only an outer contour.](img/o-and-i) A *segment* is a series of consecutive points of a contour (including its Bézier control points) that are approximately aligned along a coordinate @@ -341,7 +490,7 @@ circles, respectively. The bottom 'line' DE is approximately aligned along the horizontal axis, thus it forms a segment of 7\ points. Together with the two other horizontal segments, BC and FG, they form two edges - (BC+FG, DE).](img/segment-edge.png) + (BC+FG, DE).](img/segment-edge) An *edge* corresponds to a single coordinate value on the main dimension that collects one or more segments (allowing for a small threshold). While @@ -354,7 +503,9 @@ Feature Analysis ---------------- -The auto-hinter analyzes a font in two steps. +The auto-hinter analyzes a font in two steps. Right now, everything +described below happens for the horizontal axis only, providing vertical +hinting. * Global Analysis @@ -385,7 +536,7 @@ ---------- ![Two blue zones relevant to the glyph 'a'. Vertical point coordinates of - *all* glyphs within these zones are aligned.](img/blue-zones.png) + *all* glyphs within these zones are aligned.](img/blue-zones) Outlines of certain characters are used to determine *blue zones*. This concept is the same as with Type\ 1 fonts: All glyph points which lie in @@ -409,7 +560,7 @@ option](#x-height-increase-limit). ![This image shows the relevant glyph terms for vertical blue zone - positions.](img/glyph-terms.png) + positions.](img/glyph-terms) Grid Fitting @@ -454,11 +605,16 @@ In ttfautohint terminology, a *hint set* is the *optimal* configuration for a given PPEM (pixel per EM) value. -Internally, ttfautohint creates hint sets for every PPEM value in the range -given by the `--hinting-range-min` and `--hinting-range-max` options (this -is a per-glyph operation). If it differs to the current one, a new set is -emitted. For some glyphs it is possible that one set covers, say, the range -8px-1000px, while other glyphs need 10 or more such sets. +In the range given by the `--hinting-range-min` and `--hinting-range-max` +options, ttfautohint creates hint sets for every PPEM value. For each +glyph, ttfautohint automatically determines if a new set should be emitted +for a PPEM value if it finds that it differs from a previous one. For some +glyphs it is possible that one set covers, say, the range 8px-1000px, while +other glyphs need 10 or more such sets. + +In the PPEM range below `--hinting-range-min`, ttfautohint always uses just +one set, in the PPEM range between `--hinting-range-max` and +`--hinting-limit`, it also uses just one set. One of the hinting configuration parameters is the decision which segments form an edge. For example, let us assume that two segments get aligned on a @@ -495,14 +651,25 @@ Similar arguments hold for `--hinting-range-min` except that there is no lower limit at which hinting is switched off. +An example. Let's assume that we have a hinting range 10\ <= ppem <=\ 100, +and the hinting limit is set to 250. For a given glyph, ttfautohint finds +out that four hint sets must be computed to exactly cover thes hinting +range: 10-15, 16-40, 41-80, and 81-100. For ppem values below 10ppem, the +hint set covering 10-15ppem is used, for ppem values larger than 100 the +hint set covering 81-100ppem is used. For ppem values larger than 250, no +hinting gets applied. + The '\.ttfautohint' Glyph ------------------------- -ttfautohint doesn't hint subglyphs of composite glyphs separately. Instead, -it hints the whole glyph, this is, composites get recursively expanded so -that they form simple glyphs, then hints are applied -- this is the normal -working mode of FreeType's auto-hinter. +[The behaviour described in this section does not apply if [option +`--components`](#hint-with-components) is used.] + +By default, ttfautohint doesn't hint subglyphs of composite glyphs +separately. Instead, it hints the whole glyph, this is, composites get +recursively expanded internally so that they form simple glyphs, then hints +are applied -- this is the normal working mode of FreeType's auto-hinter. One problem, however, must be solved: Hinting for subglyphs (which usually are used as normal glyphs also) must be deactivated so that nothing but the @@ -541,7 +708,6 @@ some test and demo programs like FreeType's `ftview` application or other glyph viewers which are able to bypass the `cmap` table might be affected.) - Scripts ------- @@ -553,39 +719,41 @@ module. As you can see, this also covers some non-latin scripts (in the Unicode sense) which have similar typographical properties. - Character range Description - ------------------- ------------- - 0x0020 - 0x007F Basic Latin (no control chars) - 0x00A0 - 0x00FF Latin-1 Supplement (no control chars) - 0x0100 - 0x017F Latin Extended-A - 0x0180 - 0x024F Latin Extended-B - 0x0250 - 0x02AF IPA Extensions - 0x02B0 - 0x02FF Spacing Modifier Letters - 0x0300 - 0x036F Combining Diacritical Marks - 0x0370 - 0x03FF Greek and Coptic - 0x0400 - 0x04FF Cyrillic - 0x0500 - 0x052F Cyrillic Supplement - 0x1D00 - 0x1D7F Phonetic Extensions - 0x1D80 - 0x1DBF Phonetic Extensions Supplement - 0x1DC0 - 0x1DFF Combining Diacritical Marks Supplement - 0x1E00 - 0x1EFF Latin Extended Additional - 0x1F00 - 0x1FFF Greek Extended - 0x2000 - 0x206F General Punctuation - 0x2070 - 0x209F Superscripts and Subscripts - 0x20A0 - 0x20CF Currency Symbols - 0x2150 - 0x218F Number Forms - 0x2460 - 0x24FF Enclosed Alphanumerics - 0x2C60 - 0x2C7F Latin Extended-C - 0x2DE0 - 0x2DFF Cyrillic Extended-A - 0xA640 - 0xA69F Cyrillic Extended-B - 0xA720 - 0xA7FF Latin Extended-D - 0xFB00 - 0xFB06 Alphab. Present. Forms (Latin Ligs) - 0x1D400 - 0x1D7FF Mathematical Alphanumeric Symbols + Character range Description + --------------------- ------------- + `0x0020` - `0x007F` Basic Latin (no control characters) + `0x00A0` - `0x00FF` Latin-1 Supplement (no control characters) + `0x0100` - `0x017F` Latin Extended-A + `0x0180` - `0x024F` Latin Extended-B + `0x0250` - `0x02AF` IPA Extensions + `0x02B0` - `0x02FF` Spacing Modifier Letters + `0x0300` - `0x036F` Combining Diacritical Marks + `0x0370` - `0x03FF` Greek and Coptic + `0x0400` - `0x04FF` Cyrillic + `0x0500` - `0x052F` Cyrillic Supplement + `0x1D00` - `0x1D7F` Phonetic Extensions + `0x1D80` - `0x1DBF` Phonetic Extensions Supplement + `0x1DC0` - `0x1DFF` Combining Diacritical Marks Supplement + `0x1E00` - `0x1EFF` Latin Extended Additional + `0x1F00` - `0x1FFF` Greek Extended + `0x2000` - `0x206F` General Punctuation + `0x2070` - `0x209F` Superscripts and Subscripts + `0x20A0` - `0x20CF` Currency Symbols + `0x2150` - `0x218F` Number Forms + `0x2460` - `0x24FF` Enclosed Alphanumerics + `0x2C60` - `0x2C7F` Latin Extended-C + `0x2DE0` - `0x2DFF` Cyrillic Extended-A + `0x2E00` - `0x2E7F` Supplemental Punctuation + `0xA640` - `0xA69F` Cyrillic Extended-B + `0xA720` - `0xA7FF` Latin Extended-D + `0xFB00` - `0xFB06` Alphabetical Presentation Forms (Latin Ligatures) + `0x1D400` - `0x1D7FF` Mathematical Alphanumeric Symbols + `0x1F100` - `0x1F1FF` Enclosed Alphanumeric Supplement If a glyph's character code is not covered by a script range, it is not hinted (or rather, it gets hinted by the 'dummy' auto-hinting module which essentially does nothing). This can be changed by specifying a *fallback -script* with option `--latin-fallback`. +script* with [option `--latin-fallback`](#fallback-script). It is planned to extend ttfautohint so that the `GSUB` OpenType table gets analyzed, mapping character codes to all glyph indices which can be reached @@ -675,8 +843,7 @@ (this value can't be larger than 65535). *curr_sfnt* gives the current subfont within a TrueType Collection (TTC), -and *num_sfnts* the total number of subfonts. Currently, the ttfautohint -library only hints glyphs from the `glyf` table used in subfont\ 0. +and *num_sfnts* the total number of subfonts. If the return value is non-zero, `TTF_autohint` aborts with `TA_Err_Canceled`. Use this for a 'Cancel' button or similar features in @@ -801,13 +968,41 @@ this field is not set, it defaults to `TA_HINTING_LIMIT`. If it is set to\ 0, no hinting limit is added to the bytecode. +`gray-strong-stem-width` +: An integer (1\ for 'on' and 0\ for 'off', which is the default) which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for normal grayscale rendering. + +`gdi-cleartype-strong-stem-width` +: An integer (1\ for 'on', which is the default, and 0\ for 'off') which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for GDI ClearType rendering, this is, the + rasterizer version (as returned by the GETINFO bytecode instruction) + is in the range 36\ <= version <\ 38 and ClearType is enabled. + +`dw-cleartype-strong-stem-width` +: An integer (1\ for 'on' and 0\ for 'off', which is the default) which + specifies whether horizontal stems should be snapped and positioned + to integer pixel values for DW ClearType rendering, this is, the + rasterizer version (as returned by the GETINFO bytecode instruction) + is >=\ 38, ClearType is enabled, and subpixel positioning is enabled + also. + `increase-x-height` -: An integer in the range 6-20. For PPEM values in the range 6\ <= - PPEM <=\ `increase-x-height`, round up the font's x\ height much more - often than normally. If it is set to\ 0, this feature is switched - off. If this field is not set, it defaults to - `TA_INCREASE_X_HEIGHT`. Use this flag to improve the legibility of - small font sizes if necessary. +: An integer. For PPEM values in the range 6\ <= PPEM + <=\ `increase-x-height`, round up the font's x\ height much more often + than normally. If it is set to\ 0, this feature is switched off. If + this field is not set, it defaults to `TA_INCREASE_X_HEIGHT`. Use + this flag to improve the legibility of small font sizes if necessary. + +`hint-with-components` +: If this integer is set to\ 1 (which is the default), ttfautohint + handles composite glyphs as a whole. This implies adding a special + glyph to the font, as documented [here](#the-.ttfautohint-glyph). + Setting it to\ 0, the components of composite glyphs are hinted + separately. While separate hinting of subglyphs makes the resulting + bytecode much smaller, it might deliver worse results. However, this + depends on the processed font and must be checked by inspection. `pre-hinting` : An integer (1\ for 'on' and 0\ for 'off', which is the default) to @@ -819,7 +1014,7 @@ `info-callback` : A pointer of type [`TA_Info_Func`](#callback-ta_info_func), - specifying a callback function for manipulating the `name` table. + specifying a callback function for manipulating the `name` table. This function gets called for each `name` table entry. If not set or set to NULL, the table data stays unmodified. @@ -831,10 +1026,22 @@ : A pointer of type `const char*` to a null-terminated string which gives a list of comma separated PPEM values or value ranges at which no x-height snapping shall be applied. A value range has the form - *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. - Whitespace is not significant; a trailing comma is ignored. If the - supplied argument is NULL, no x-height snapping takes place at all. - By default, there are no snapping exceptions. Not implemented yet. + *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. *value1* + or *value2* (or both) can be missing; a missing value is replaced by + the beginning or end of the whole interval of valid PPEM values, + respectively. Whitespace is not significant; superfluous commas are + ignored, and ranges must be specified in increasing order. For + example, the string `"3, 5-7, 9-"` means the values 3, 5, 6, 7, 9, + 10, 11, 12, etc. Consequently, if the supplied argument is `"-"`, no + x-height snapping takes place at all. The default is the empty + string (`""`), meaning no snapping exceptions. + +`windows-compatibility` +: If this integer is set to\ 1, two artificial blue zones are used, + positioned at the `usWinAscent` and `usWinDescent` values (from the + font's `OS/2` table). The idea is to help ttfautohint so that the + hinted glyphs stay within this horizontal stripe since Windows clips + everything falling outside. The default is\ 0. `ignore-restrictions` : If the font has set bit\ 1 in the 'fsType' field of the `OS/2` table, @@ -858,10 +1065,14 @@ (for the latin script, it is character 'o'). The default value is\ 0. +`debug` +: If this integer is set to\ 1, lots of debugging information is print + to stderr. The default value is\ 0. + Remarks: - * Obviously, it is necessary to have an input and an output data stream. - All other options are optional. + * Obviously, it is necessary to have an input and an output data + stream. All other options are optional. * `hinting-range-min` and `hinting-range-max` specify the range for which the autohinter generates optimized hinting code. If a PPEM @@ -890,9 +1101,12 @@ Compilation and Installation ============================ -Please read the files `INSTALL` and `INSTALL.git` (part of the source code -bundle) for instructions how to compile the ttfautohint library together -with its front-ends. +Please read the files +[`INSTALL`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/INSTALL) +and +[`INSTALL.git`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/INSTALL.git) +(part of the source code bundle) for instructions how to compile the +ttfautohint library together with its front-ends. TODO @@ -920,12 +1134,13 @@ ======= Copyright © 2011-2012 by [Werner Lemberg](mailto:wl@gnu.org).\ -Copyright © 2011-2012 by [Dave Crossland](dave@understandingfonts.com). +Copyright © 2011-2012 by [Dave Crossland](mailto:dave@understandingfonts.com). This file is part of the ttfautohint library, and may only be used, -modified, and distributed under the terms given in `COPYING`. By continuing -to use, modify, or distribute this file you indicate that you have read -`COPYING` and understand and accept it fully. +modified, and distributed under the terms given in +[`COPYING`](http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/COPYING). +By continuing to use, modify, or distribute this file you indicate that you +have read `COPYING` and understand and accept it fully. The file `COPYING` mentioned in the previous paragraph is distributed with the ttfautohint library. diff -Nru ttfautohint-0.9/frontend/Makefile.am ttfautohint-0.94/frontend/Makefile.am --- ttfautohint-0.9/frontend/Makefile.am 2012-06-06 06:16:33.000000000 +0000 +++ ttfautohint-0.94/frontend/Makefile.am 2012-11-17 09:50:59.000000000 +0000 @@ -26,7 +26,7 @@ -I$(top_builddir)/gnulib/src \ -I$(top_srcdir)/gnulib/src \ $(FREETYPE_CPPFLAGS) -LDADD = $(top_builddir)/lib/libttfautohint.a \ +LDADD = $(top_builddir)/lib/libttfautohint.la \ $(top_builddir)/gnulib/src/libgnu.la \ $(LTLIBINTL) \ $(LTLIBTHREAD) \ @@ -42,10 +42,13 @@ bin_PROGRAMS += ttfautohintGUI ttfautohintGUI_SOURCES = info.cpp \ info.h \ + lineedit.cpp \ + lineedit.h \ main.cpp \ maingui.cpp \ maingui.h - nodist_ttfautohintGUI_SOURCES = maingui.moc.cpp + nodist_ttfautohintGUI_SOURCES = maingui.moc.cpp \ + lineedit.moc.cpp ttfautohintGUI_CXXFLAGS = $(QT_CXXFLAGS) ttfautohintGUI_LDFLAGS = $(QT_LDFLAGS) ttfautohintGUI_CPPFLAGS = $(AM_CPPFLAGS) \ @@ -54,7 +57,8 @@ ttfautohintGUI_LDADD = $(LDADD) \ $(QT_LIBS) - BUILT_SOURCES = maingui.moc.cpp + BUILT_SOURCES = maingui.moc.cpp \ + lineedit.moc.cpp manpages += ttfautohintGUI.1 endif diff -Nru ttfautohint-0.9/frontend/Makefile.in ttfautohint-0.94/frontend/Makefile.in --- ttfautohint-0.9/frontend/Makefile.in 2012-06-06 06:20:18.000000000 +0000 +++ ttfautohint-0.94/frontend/Makefile.in 2012-11-29 07:22:17.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.1 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -74,24 +74,35 @@ $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ + $(top_srcdir)/gnulib/m4/fcntl-o.m4 \ + $(top_srcdir)/gnulib/m4/fcntl_h.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ + $(top_srcdir)/gnulib/m4/isatty.m4 \ $(top_srcdir)/gnulib/m4/lib-ld.m4 \ $(top_srcdir)/gnulib/m4/lib-link.m4 \ $(top_srcdir)/gnulib/m4/lib-prefix.m4 \ $(top_srcdir)/gnulib/m4/libtool.m4 \ $(top_srcdir)/gnulib/m4/lock.m4 \ + $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/ltoptions.m4 \ $(top_srcdir)/gnulib/m4/ltsugar.m4 \ $(top_srcdir)/gnulib/m4/ltversion.m4 \ $(top_srcdir)/gnulib/m4/lt~obsolete.m4 \ + $(top_srcdir)/gnulib/m4/memchr.m4 \ + $(top_srcdir)/gnulib/m4/memmem.m4 \ + $(top_srcdir)/gnulib/m4/mmap-anon.m4 \ + $(top_srcdir)/gnulib/m4/msvc-inval.m4 \ + $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gnulib/m4/multiarch.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ + $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/strerror_r.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ @@ -114,23 +125,26 @@ ttfautohint_OBJECTS = $(am_ttfautohint_OBJECTS) ttfautohint_LDADD = $(LDADD) am__DEPENDENCIES_1 = -ttfautohint_DEPENDENCIES = $(top_builddir)/lib/libttfautohint.a \ +ttfautohint_DEPENDENCIES = $(top_builddir)/lib/libttfautohint.la \ $(top_builddir)/gnulib/src/libgnu.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent -am__ttfautohintGUI_SOURCES_DIST = info.cpp info.h main.cpp maingui.cpp \ - maingui.h +am__v_lt_1 = +am__ttfautohintGUI_SOURCES_DIST = info.cpp info.h lineedit.cpp \ + lineedit.h main.cpp maingui.cpp maingui.h @USE_QT_TRUE@am_ttfautohintGUI_OBJECTS = \ @USE_QT_TRUE@ ttfautohintGUI-info.$(OBJEXT) \ +@USE_QT_TRUE@ ttfautohintGUI-lineedit.$(OBJEXT) \ @USE_QT_TRUE@ ttfautohintGUI-main.$(OBJEXT) \ @USE_QT_TRUE@ ttfautohintGUI-maingui.$(OBJEXT) @USE_QT_TRUE@nodist_ttfautohintGUI_OBJECTS = \ -@USE_QT_TRUE@ ttfautohintGUI-maingui.moc.$(OBJEXT) +@USE_QT_TRUE@ ttfautohintGUI-maingui.moc.$(OBJEXT) \ +@USE_QT_TRUE@ ttfautohintGUI-lineedit.moc.$(OBJEXT) ttfautohintGUI_OBJECTS = $(am_ttfautohintGUI_OBJECTS) \ $(nodist_ttfautohintGUI_OBJECTS) -am__DEPENDENCIES_2 = $(top_builddir)/lib/libttfautohint.a \ +am__DEPENDENCIES_2 = $(top_builddir)/lib/libttfautohint.la \ $(top_builddir)/gnulib/src/libgnu.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) @USE_QT_TRUE@ttfautohintGUI_DEPENDENCIES = $(am__DEPENDENCIES_2) \ @@ -139,6 +153,18 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) \ $(ttfautohintGUI_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/gnulib/depcomp am__depfiles_maybe = depfiles @@ -152,9 +178,7 @@ AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ @@ -162,6 +186,7 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -171,6 +196,7 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -178,9 +204,7 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_1 = SOURCES = $(ttfautohint_SOURCES) $(ttfautohintGUI_SOURCES) \ $(nodist_ttfautohintGUI_SOURCES) DIST_SOURCES = $(ttfautohint_SOURCES) \ @@ -226,12 +250,18 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -263,6 +293,7 @@ FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GETOPT_H = @GETOPT_H@ +GHC = @GHC@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ @@ -274,6 +305,7 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ @@ -313,6 +345,9 @@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -374,6 +409,7 @@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ @@ -386,12 +422,16 @@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ @@ -401,7 +441,11 @@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ @@ -411,10 +455,15 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HELP2MAN = @HELP2MAN@ @@ -449,14 +498,18 @@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ @@ -478,6 +531,7 @@ PDFLATEX = @PDFLATEX@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QMAKE = @QMAKE@ QT_CFLAGS = @QT_CFLAGS@ QT_CPPFLAGS = @QT_CPPFLAGS@ @@ -497,6 +551,7 @@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ @@ -511,6 +566,8 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_READ = @REPLACE_READ@ @@ -538,14 +595,19 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ UIC = @UIC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -591,6 +653,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -616,7 +679,7 @@ -I$(top_srcdir)/gnulib/src \ $(FREETYPE_CPPFLAGS) -LDADD = $(top_builddir)/lib/libttfautohint.a \ +LDADD = $(top_builddir)/lib/libttfautohint.la \ $(top_builddir)/gnulib/src/libgnu.la \ $(LTLIBINTL) \ $(LTLIBTHREAD) \ @@ -629,11 +692,15 @@ manpages = ttfautohint.1 $(am__append_2) @USE_QT_TRUE@ttfautohintGUI_SOURCES = info.cpp \ @USE_QT_TRUE@ info.h \ +@USE_QT_TRUE@ lineedit.cpp \ +@USE_QT_TRUE@ lineedit.h \ @USE_QT_TRUE@ main.cpp \ @USE_QT_TRUE@ maingui.cpp \ @USE_QT_TRUE@ maingui.h -@USE_QT_TRUE@nodist_ttfautohintGUI_SOURCES = maingui.moc.cpp +@USE_QT_TRUE@nodist_ttfautohintGUI_SOURCES = maingui.moc.cpp \ +@USE_QT_TRUE@ lineedit.moc.cpp + @USE_QT_TRUE@ttfautohintGUI_CXXFLAGS = $(QT_CXXFLAGS) @USE_QT_TRUE@ttfautohintGUI_LDFLAGS = $(QT_LDFLAGS) @USE_QT_TRUE@ttfautohintGUI_CPPFLAGS = $(AM_CPPFLAGS) \ @@ -643,7 +710,9 @@ @USE_QT_TRUE@ttfautohintGUI_LDADD = $(LDADD) \ @USE_QT_TRUE@ $(QT_LIBS) -@USE_QT_TRUE@BUILT_SOURCES = maingui.moc.cpp +@USE_QT_TRUE@BUILT_SOURCES = maingui.moc.cpp \ +@USE_QT_TRUE@ lineedit.moc.cpp + @WITH_DOC_TRUE@dist_man_MANS = $(manpages) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -758,6 +827,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-lineedit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-lineedit.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-maingui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohintGUI-maingui.moc.Po@am__quote@ @@ -797,6 +868,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-info.obj `if test -f 'info.cpp'; then $(CYGPATH_W) 'info.cpp'; else $(CYGPATH_W) '$(srcdir)/info.cpp'; fi` +ttfautohintGUI-lineedit.o: lineedit.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -MT ttfautohintGUI-lineedit.o -MD -MP -MF $(DEPDIR)/ttfautohintGUI-lineedit.Tpo -c -o ttfautohintGUI-lineedit.o `test -f 'lineedit.cpp' || echo '$(srcdir)/'`lineedit.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ttfautohintGUI-lineedit.Tpo $(DEPDIR)/ttfautohintGUI-lineedit.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lineedit.cpp' object='ttfautohintGUI-lineedit.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-lineedit.o `test -f 'lineedit.cpp' || echo '$(srcdir)/'`lineedit.cpp + +ttfautohintGUI-lineedit.obj: lineedit.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -MT ttfautohintGUI-lineedit.obj -MD -MP -MF $(DEPDIR)/ttfautohintGUI-lineedit.Tpo -c -o ttfautohintGUI-lineedit.obj `if test -f 'lineedit.cpp'; then $(CYGPATH_W) 'lineedit.cpp'; else $(CYGPATH_W) '$(srcdir)/lineedit.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ttfautohintGUI-lineedit.Tpo $(DEPDIR)/ttfautohintGUI-lineedit.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lineedit.cpp' object='ttfautohintGUI-lineedit.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-lineedit.obj `if test -f 'lineedit.cpp'; then $(CYGPATH_W) 'lineedit.cpp'; else $(CYGPATH_W) '$(srcdir)/lineedit.cpp'; fi` + ttfautohintGUI-main.o: main.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -MT ttfautohintGUI-main.o -MD -MP -MF $(DEPDIR)/ttfautohintGUI-main.Tpo -c -o ttfautohintGUI-main.o `test -f 'main.cpp' || echo '$(srcdir)/'`main.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ttfautohintGUI-main.Tpo $(DEPDIR)/ttfautohintGUI-main.Po @@ -839,6 +924,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-maingui.moc.obj `if test -f 'maingui.moc.cpp'; then $(CYGPATH_W) 'maingui.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/maingui.moc.cpp'; fi` +ttfautohintGUI-lineedit.moc.o: lineedit.moc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -MT ttfautohintGUI-lineedit.moc.o -MD -MP -MF $(DEPDIR)/ttfautohintGUI-lineedit.moc.Tpo -c -o ttfautohintGUI-lineedit.moc.o `test -f 'lineedit.moc.cpp' || echo '$(srcdir)/'`lineedit.moc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ttfautohintGUI-lineedit.moc.Tpo $(DEPDIR)/ttfautohintGUI-lineedit.moc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lineedit.moc.cpp' object='ttfautohintGUI-lineedit.moc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-lineedit.moc.o `test -f 'lineedit.moc.cpp' || echo '$(srcdir)/'`lineedit.moc.cpp + +ttfautohintGUI-lineedit.moc.obj: lineedit.moc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -MT ttfautohintGUI-lineedit.moc.obj -MD -MP -MF $(DEPDIR)/ttfautohintGUI-lineedit.moc.Tpo -c -o ttfautohintGUI-lineedit.moc.obj `if test -f 'lineedit.moc.cpp'; then $(CYGPATH_W) 'lineedit.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/lineedit.moc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ttfautohintGUI-lineedit.moc.Tpo $(DEPDIR)/ttfautohintGUI-lineedit.moc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lineedit.moc.cpp' object='ttfautohintGUI-lineedit.moc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ttfautohintGUI_CPPFLAGS) $(CPPFLAGS) $(ttfautohintGUI_CXXFLAGS) $(CXXFLAGS) -c -o ttfautohintGUI-lineedit.moc.obj `if test -f 'lineedit.moc.cpp'; then $(CYGPATH_W) 'lineedit.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/lineedit.moc.cpp'; fi` + mostlyclean-libtool: -rm -f *.lo diff -Nru ttfautohint-0.9/frontend/info.cpp ttfautohint-0.94/frontend/info.cpp --- ttfautohint-0.9/frontend/info.cpp 2012-06-04 20:33:37.000000000 +0000 +++ ttfautohint-0.94/frontend/info.cpp 2012-11-24 13:52:44.000000000 +0000 @@ -19,38 +19,124 @@ #include "info.h" +#define TTFAUTOHINT_STRING "; ttfautohint" +#define TTFAUTOHINT_STRING_WIDE "\0;\0 \0t\0t\0f\0a\0u\0t\0o\0h\0i\0n\0t" + // build string which gets appended to the `Version' field(s) extern "C" { -void +// return value 1 means allocation error, value 2 too long a string + +int build_version_string(Info_Data* idata) { char* d; char* dw; + char* s = NULL; + size_t s_len; + unsigned char* data_new; + unsigned short data_new_len; + char strong[4]; + int count; + int ret = 0; + + // 128 bytes certainly hold the following options except -X + data_new = (unsigned char*)realloc(idata->data, 128); + if (!data_new) + { + ret = 1; + goto Fail; + } + idata->data = data_new; d = (char*)idata->data; - d += sprintf(d, "; ttfautohint (v%s)", VERSION); + d += sprintf(d, TTFAUTOHINT_STRING " (v%s)", VERSION); - if (idata->hinting_range_min != TA_HINTING_RANGE_MIN) - d += sprintf(d, " -l %d", idata->hinting_range_min); - if (idata->hinting_range_max != TA_HINTING_RANGE_MAX) - d += sprintf(d, " -r %d", idata->hinting_range_max); - if (idata->hinting_limit != TA_HINTING_LIMIT) - d += sprintf(d, " -G %d", idata->hinting_limit); - if (idata->increase_x_height != TA_INCREASE_X_HEIGHT) - d += sprintf(d, " -x %d", idata->increase_x_height); + d += sprintf(d, " -l %d", idata->hinting_range_min); + d += sprintf(d, " -r %d", idata->hinting_range_max); + d += sprintf(d, " -G %d", idata->hinting_limit); + d += sprintf(d, " -x %d", idata->increase_x_height); + + count = 0; + strong[0] = '\0'; + strong[1] = '\0'; + strong[2] = '\0'; + strong[3] = '\0'; + if (idata->gray_strong_stem_width) + strong[count++] = 'g'; + if (idata->gdi_cleartype_strong_stem_width) + strong[count++] = 'G'; + if (idata->dw_cleartype_strong_stem_width) + strong[count++] = 'D'; + d += sprintf(d, " -w \"%s\"", strong); + if (idata->windows_compatibility) + d += sprintf(d, " -W"); if (idata->pre_hinting) d += sprintf(d, " -p"); + if (!idata->hint_with_components) + d += sprintf(d, " -c"); if (idata->latin_fallback) d += sprintf(d, " -f"); if (idata->symbol) d += sprintf(d, " -s"); + if (idata->x_height_snapping_exceptions) + d += sprintf(d, " -X \"\""); // fill in data later idata->data_len = d - (char*)idata->data; + if (idata->x_height_snapping_exceptions) + { + s = number_set_show(idata->x_height_snapping_exceptions, 6, 0x7FFF); + if (!s) + { + ret = 1; + goto Fail; + } + + // ensure UTF16-BE version doesn't get too long + s_len = strlen(s); + if (s_len > 0xFFFF / 2 - 128) + { + ret = 2; + goto Fail; + } + } + else + s_len = 0; + + // we now reallocate to the real size + // (plus one byte so that `sprintf' works) + data_new_len = idata->data_len + s_len; + data_new = (unsigned char*)realloc(idata->data, data_new_len + 1); + if (!data_new) + { + ret = 1; + goto Fail; + } + + if (idata->x_height_snapping_exceptions) + { + // overwrite second doublequote and append it instead + d = (char*)(data_new + idata->data_len - 1); + sprintf(d, "%s\"", s); + } + + idata->data = data_new; + idata->data_len = data_new_len; + // prepare UTF16-BE version data + idata->data_wide_len = 2 * idata->data_len; + data_new = (unsigned char*)realloc(idata->data_wide, + idata->data_wide_len); + if (!data_new) + { + ret = 1; + goto Fail; + } + idata->data_wide = data_new; + d = (char*)idata->data; dw = (char*)idata->data_wide; for (unsigned short i = 0; i < idata->data_len; i++) @@ -58,7 +144,22 @@ *(dw++) = '\0'; *(dw++) = *(d++); } - idata->data_wide_len = idata->data_len << 1; + +Exit: + free(s); + + return ret; + +Fail: + free(idata->data); + free(idata->data_wide); + + idata->data = NULL; + idata->data_wide = NULL; + idata->data_len = 0; + idata->data_wide_len = 0; + + goto Exit; } @@ -72,8 +173,18 @@ void* user) { Info_Data* idata = (Info_Data*)user; + unsigned char ttfautohint_string[] = TTFAUTOHINT_STRING; + unsigned char ttfautohint_string_wide[] = TTFAUTOHINT_STRING_WIDE; + + // we use memmem, so don't count the trailing \0 character + size_t ttfautohint_string_len = sizeof (TTFAUTOHINT_STRING) - 1; + size_t ttfautohint_string_wide_len = sizeof (TTFAUTOHINT_STRING_WIDE) - 1; + unsigned char* v; unsigned short v_len; + unsigned char* s; + size_t s_len; + size_t offset; // if it is a version string, append our data if (name_id != 5) @@ -86,12 +197,51 @@ // one-byte or multi-byte encodings v = idata->data; v_len = idata->data_len; + s = ttfautohint_string; + s_len = ttfautohint_string_len; + offset = 2; } else { // (two-byte) UTF-16BE for everything else v = idata->data_wide; v_len = idata->data_wide_len; + s = ttfautohint_string_wide; + s_len = ttfautohint_string_wide_len; + offset = 4; + } + + // if we already have an ttfautohint info string, + // remove it up to a following `;' character (or end of string) + unsigned char* s_start = (unsigned char*)memmem(*str, *len, s, s_len); + if (s_start) + { + unsigned char* s_end = s_start + offset; + unsigned char* limit = *str + *len; + + while (s_end < limit) + { + if (*s_end == ';') + { + if (offset == 2) + break; + else + { + if (*(s_end - 1) == '\0') // UTF-16BE + { + s_end--; + break; + } + } + } + + s_end++; + } + + while (s_end < limit) + *s_start++ = *s_end++; + + *len -= s_end - s_start; } // do nothing if the string would become too long diff -Nru ttfautohint-0.9/frontend/info.h ttfautohint-0.94/frontend/info.h --- ttfautohint-0.9/frontend/info.h 2012-06-04 14:59:05.000000000 +0000 +++ ttfautohint-0.94/frontend/info.h 2012-11-24 10:08:08.000000000 +0000 @@ -15,6 +15,7 @@ #define __INFO_H__ #include +#include extern "C" { @@ -28,15 +29,23 @@ int hinting_range_min; int hinting_range_max; int hinting_limit; + + bool gray_strong_stem_width; + bool gdi_cleartype_strong_stem_width; + bool dw_cleartype_strong_stem_width; + int increase_x_height; + number_range* x_height_snapping_exceptions; + bool windows_compatibility; bool pre_hinting; + bool hint_with_components; int latin_fallback; bool symbol; } Info_Data; -void +int build_version_string(Info_Data* idata); TA_Error diff -Nru ttfautohint-0.9/frontend/lineedit.cpp ttfautohint-0.94/frontend/lineedit.cpp --- ttfautohint-0.9/frontend/lineedit.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/frontend/lineedit.cpp 2012-11-11 18:29:05.000000000 +0000 @@ -0,0 +1,81 @@ +// lineedit.cpp + +// Copyright (C) 2012 by Werner Lemberg. +// +// This file is part of the ttfautohint library, and may only be used, +// modified, and distributed under the terms given in `COPYING'. By +// continuing to use, modify, or distribute this file you indicate that you +// have read `COPYING' and understand and accept it fully. +// +// The file `COPYING' mentioned in the previous paragraph is distributed +// with the ttfautohint library. + + +// Derived class `Line_Edit' is QLineEdit which accepts drag and drop. + +#include + +#include "lineedit.h" + +Line_Edit::Line_Edit(QWidget* parent) +: QLineEdit(parent) +{ + // empty +} + + +// XXX: There are no standardized MIME types for TTFs and TTCs +// which work everywhere. So we rely on the extension. + +void +Line_Edit::dragEnterEvent(QDragEnterEvent* event) +{ + QList url_list; + QString file_name; + + if (event->mimeData()->hasUrls()) + { + url_list = event->mimeData()->urls(); + + // if just text was dropped, url_list is empty + if (url_list.size()) + { + file_name = url_list[0].toLocalFile(); + + if (file_name.endsWith(".ttf") + || file_name.endsWith(".TTF") + || file_name.endsWith(".ttc") + || file_name.endsWith(".TTC")) + event->acceptProposedAction(); + } + } +} + + +void +Line_Edit::dropEvent(QDropEvent* event) +{ + QList url_list; + QString file_name; + QFileInfo info; + + if (event->mimeData()->hasUrls()) + { + url_list = event->mimeData()->urls(); + + // if just text was dropped, url_list is empty + if (url_list.size()) + { + file_name = url_list[0].toLocalFile(); + + // check whether `file_name' is valid + info.setFile(file_name); + if (info.isFile()) + setText(file_name); + } + } + + event->acceptProposedAction(); +} + +// end of lineedit.cpp diff -Nru ttfautohint-0.9/frontend/lineedit.h ttfautohint-0.94/frontend/lineedit.h --- ttfautohint-0.9/frontend/lineedit.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/frontend/lineedit.h 2012-11-11 18:29:05.000000000 +0000 @@ -0,0 +1,36 @@ +// lineedit.h + +// Copyright (C) 2012 by Werner Lemberg. +// +// This file is part of the ttfautohint library, and may only be used, +// modified, and distributed under the terms given in `COPYING'. By +// continuing to use, modify, or distribute this file you indicate that you +// have read `COPYING' and understand and accept it fully. +// +// The file `COPYING' mentioned in the previous paragraph is distributed +// with the ttfautohint library. + + +#ifndef __LINEEDIT_H__ +#define __LINEEDIT_H__ + +#include + +#include + +class Line_Edit +: public QLineEdit +{ + Q_OBJECT + +public: + Line_Edit(QWidget* = 0); + + void dragEnterEvent(QDragEnterEvent*); + void dropEvent(QDropEvent*); +}; + + +#endif // __LINEEDIT_H__ + +// end of lineedit.h diff -Nru ttfautohint-0.9/frontend/main.cpp ttfautohint-0.94/frontend/main.cpp --- ttfautohint-0.9/frontend/main.cpp 2012-06-04 20:26:58.000000000 +0000 +++ ttfautohint-0.94/frontend/main.cpp 2012-11-25 15:44:19.000000000 +0000 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,21 @@ #endif #include +#include + + +#ifdef _WIN32 +# include +# define SET_BINARY(f) do { \ + if (!isatty(fileno(f))) \ + setmode(fileno(f), O_BINARY); \ + } while (0) +#endif + +#ifndef SET_BINARY +# define SET_BINARY(f) do {} while (0) +#endif + using namespace std; @@ -69,6 +85,7 @@ { fprintf(stderr, "subfont %ld of %ld\n", curr_sfnt + 1, num_sfnts); data->last_sfnt = curr_sfnt; + data->last_percent = 0; data->begin = true; } @@ -115,10 +132,13 @@ "Usage: ttfautohintGUI [OPTION]...\n" "A GUI application to replace hints in a TrueType font.\n" #else -"Usage: ttfautohint [OPTION]... IN-FILE OUT-FILE\n" +"Usage: ttfautohint [OPTION]... [IN-FILE [OUT-FILE]]\n" "Replace hints in TrueType font IN-FILE and write output to OUT-FILE.\n" +"If OUT-FILE is missing, standard output is used instead;\n" +"if IN-FILE is missing also, standard input and output are used.\n" #endif -"The new hints are based on FreeType's autohinter.\n" +"\n" +"The new hints are based on FreeType's auto-hinter.\n" "\n" "This program is a simple front-end to the `ttfautohint' library.\n" "\n"); @@ -138,6 +158,10 @@ fprintf(handle, "Options:\n" +#ifndef BUILD_GUI +" --debug print debugging information\n" +#endif +" -c, --components hint glyph components separately\n" " -f, --latin-fallback set fallback script to latin\n" " -G, --hinting-limit=N switch off hinting above this PPEM value\n" " (default: %d); value 0 means no limit\n" @@ -148,7 +172,7 @@ " -i, --ignore-restrictions override font license restrictions\n" " -l, --hinting-range-min=N the minimum PPEM value for hint sets\n" " (default: %d)\n" -" -n --no-info don't add ttfautohint info\n" +" -n, --no-info don't add ttfautohint info\n" " to the version string(s) in the `name' table\n" " -p, --pre-hinting apply original hints in advance\n", TA_HINTING_LIMIT, TA_HINTING_RANGE_MIN); @@ -158,12 +182,21 @@ " -s, --symbol input is symbol font\n" " -v, --verbose show progress information\n" " -V, --version print version information and exit\n" +" -w, --strong-stem-width=S use strong stem width routine for modes S,\n" +" where S is a string of up to three letters\n" +" with possible values `g' for grayscale,\n" +" `G' for GDI ClearType, and `D' for\n" +" DirectWrite ClearType (default: G)\n" +" -W, --windows-compatibility\n" +" add blue zones for `usWinAscent' and\n" +" `usWinDescent' to avoid clipping\n" " -x, --increase-x-height=N increase x height for sizes in the range\n" " 6<=PPEM<=N; value 0 switches off this feature\n" " (default: %d)\n" " -X, --x-height-snapping-exceptions=STRING\n" " specify a comma-separated list of\n" -" x-height snapping exceptions\n" +" x-height snapping exceptions, for example\n" +" \"-9, 13-17, 19\" (default: \"\")\n" "\n", TA_HINTING_RANGE_MAX, TA_INCREASE_X_HEIGHT); @@ -283,13 +316,24 @@ bool have_hinting_limit = false; bool have_increase_x_height = false; + bool gray_strong_stem_width = false; + bool gdi_cleartype_strong_stem_width = true; + bool dw_cleartype_strong_stem_width = false; + bool ignore_restrictions = false; + bool windows_compatibility = false; bool pre_hinting = false; + bool hint_with_components = true; bool no_info = false; int latin_fallback = 0; // leave it as int; this probably gets extended bool symbol = false; + const char* x_height_snapping_exceptions_string = NULL; + bool have_x_height_snapping_exceptions_string = false; + #ifndef BUILD_GUI + bool debug = false; + TA_Progress_Func progress_func = NULL; TA_Info_Func info_func = info; #endif @@ -308,7 +352,8 @@ enum { PASS_THROUGH = CHAR_MAX + 1, - HELP_ALL_OPTION + HELP_ALL_OPTION, + DEBUG_OPTION }; static struct option long_options[] = @@ -319,6 +364,10 @@ #endif // ttfautohint options + {"components", no_argument, NULL, 'c'}, +#ifndef BUILD_GUI + {"debug", no_argument, NULL, DEBUG_OPTION}, +#endif {"hinting-limit", required_argument, NULL, 'G'}, {"hinting-range-max", required_argument, NULL, 'r'}, {"hinting-range-min", required_argument, NULL, 'l'}, @@ -327,9 +376,11 @@ {"latin-fallback", no_argument, NULL, 'f'}, {"no-info", no_argument, NULL, 'n'}, {"pre-hinting", no_argument, NULL, 'p'}, + {"strong-stem-width", required_argument, NULL, 'w'}, {"symbol", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, + {"windows-compatibility", no_argument, NULL, 'W'}, {"x-height-snapping-exceptions", required_argument, NULL, 'X'}, // Qt options @@ -362,13 +413,17 @@ }; int option_index; - int c = getopt_long_only(argc, argv, "fG:hil:npr:stVvx:X:", + int c = getopt_long_only(argc, argv, "cfG:hil:npr:stVvw:Wx:X:", long_options, &option_index); if (c == -1) break; switch (c) { + case 'c': + hint_with_components = false; + break; + case 'f': latin_fallback = 1; break; @@ -422,22 +477,39 @@ #endif break; + case 'w': + gray_strong_stem_width = strchr(optarg, 'g') ? true : false; + gdi_cleartype_strong_stem_width = strchr(optarg, 'G') ? true : false; + dw_cleartype_strong_stem_width = strchr(optarg, 'D') ? true : false; + break; + + case 'W': + windows_compatibility = true; + break; + case 'x': increase_x_height = atoi(optarg); have_increase_x_height = true; break; case 'X': -#ifdef CONSOLE_OUTPUT - fprintf(stderr, "Option `-x' not implemented yet\n"); -#endif + x_height_snapping_exceptions_string = optarg; + have_x_height_snapping_exceptions_string = true; break; +#ifndef BUILD_GUI + case DEBUG_OPTION: + debug = true; + break; +#endif + +#ifdef BUILD_GUI case HELP_ALL_OPTION: #ifdef CONSOLE_OUTPUT show_help(true, false); #endif break; +#endif case PASS_THROUGH: { @@ -465,9 +537,14 @@ hinting_limit = TA_HINTING_LIMIT; if (!have_increase_x_height) increase_x_height = TA_INCREASE_X_HEIGHT; + if (!have_x_height_snapping_exceptions_string) + x_height_snapping_exceptions_string = ""; #ifndef BUILD_GUI + if (!isatty(fileno(stderr)) && !debug) + setvbuf(stderr, (char*)NULL, _IONBF, BUFSIZ); + if (hinting_range_min < 2) { fprintf(stderr, "The hinting range minimum must be at least 2\n"); @@ -487,40 +564,93 @@ hinting_range_max); exit(EXIT_FAILURE); } - if (increase_x_height != 0 - && (increase_x_height < 6 || increase_x_height > 20)) + if (increase_x_height != 0 && increase_x_height < 6) { fprintf(stderr, "A non-zero x height increase limit" - " must be in the range 6-20\n"); + " must be larger than or equal to 6\n"); exit(EXIT_FAILURE); } - // on the console we need in and out file arguments - if (argc - optind != 2) - show_help(false, true); + number_range* x_height_snapping_exceptions = NULL; - FILE* in = fopen(argv[optind], "rb"); - if (!in) + if (have_x_height_snapping_exceptions_string) { - fprintf(stderr, "The following error occurred while opening font `%s':\n" - "\n" - " %s\n", - argv[optind], strerror(errno)); - exit(EXIT_FAILURE); + const char* s; + + + s = number_set_parse(x_height_snapping_exceptions_string, + &x_height_snapping_exceptions, + 6, 0x7FFF); + if (*s) + { + if (x_height_snapping_exceptions == NUMBERSET_ALLOCATION_ERROR) + fprintf(stderr, "Allocation error while scanning" + " x height snapping exceptions\n"); + else { + if (x_height_snapping_exceptions == NUMBERSET_INVALID_CHARACTER) + fprintf(stderr, "Invalid character"); + else if (x_height_snapping_exceptions == NUMBERSET_OVERFLOW) + fprintf(stderr, "Overflow"); + else if (x_height_snapping_exceptions == NUMBERSET_INVALID_RANGE) + fprintf(stderr, "Invalid range"); + else if (x_height_snapping_exceptions == NUMBERSET_OVERLAPPING_RANGES) + fprintf(stderr, "Overlapping ranges"); + else if (x_height_snapping_exceptions == NUMBERSET_NOT_ASCENDING) + fprintf(stderr, "Values und ranges must be ascending"); + fprintf(stderr, " in x height snapping exceptions:\n" + " \"%s\"\n" + " %*s\n", + x_height_snapping_exceptions_string, + s - x_height_snapping_exceptions_string + 1, "^"); + } + exit(EXIT_FAILURE); + } } - FILE* out = fopen(argv[optind + 1], "wb"); - if (!out) + int num_args = argc - optind; + + if (num_args > 2) + show_help(false, true); + + FILE* out; + if (num_args > 1) { - fprintf(stderr, "The following error occurred while opening font `%s':\n" - "\n" - " %s\n", - argv[optind + 1], strerror(errno)); - exit(EXIT_FAILURE); + out = fopen(argv[optind + 1], "wb"); + if (!out) + { + fprintf(stderr, "The following error occurred while opening font `%s':\n" + "\n" + " %s\n", + argv[optind + 1], strerror(errno)); + exit(EXIT_FAILURE); + } + } + else + { + if (isatty(fileno(stdout))) + show_help(false, true); + out = stdout; } - unsigned char version_data[128]; - unsigned char version_data_wide[256]; + FILE* in; + if (num_args > 0) + { + in = fopen(argv[optind], "rb"); + if (!in) + { + fprintf(stderr, "The following error occurred while opening font `%s':\n" + "\n" + " %s\n", + argv[optind], strerror(errno)); + exit(EXIT_FAILURE); + } + } + else + { + if (isatty(fileno(stdin))) + show_help(false, true); + in = stdin; + } const unsigned char* error_string; Progress_Data progress_data = {-1, 1, 0}; @@ -530,36 +660,74 @@ info_func = NULL; else { - info_data.data = version_data; - info_data.data_wide = version_data_wide; + info_data.data = NULL; // must be deallocated after use + info_data.data_wide = NULL; // must be deallocated after use + info_data.data_len = 0; + info_data.data_wide_len = 0; info_data.hinting_range_min = hinting_range_min; info_data.hinting_range_max = hinting_range_max; info_data.hinting_limit = hinting_limit; + info_data.gray_strong_stem_width = gray_strong_stem_width; + info_data.gdi_cleartype_strong_stem_width = gdi_cleartype_strong_stem_width; + info_data.dw_cleartype_strong_stem_width = dw_cleartype_strong_stem_width; + + info_data.windows_compatibility = windows_compatibility; info_data.pre_hinting = pre_hinting; + info_data.hint_with_components = hint_with_components; info_data.increase_x_height = increase_x_height; + info_data.x_height_snapping_exceptions = x_height_snapping_exceptions; info_data.latin_fallback = latin_fallback; info_data.symbol = symbol; - build_version_string(&info_data); + int ret = build_version_string(&info_data); + if (ret == 1) + fprintf(stderr, "Warning: Can't allocate memory" + " for ttfautohint options string in `name' table\n"); + else if (ret == 2) + fprintf(stderr, "Warning: ttfautohint options string" + " in `name' table too long\n"); } + if (in == stdin) + SET_BINARY(stdin); + if (out == stdout) + SET_BINARY(stdout); + TA_Error error = TTF_autohint("in-file, out-file," "hinting-range-min, hinting-range-max, hinting-limit," + "gray-strong-stem-width, gdi-cleartype-strong-stem-width," + "dw-cleartype-strong-stem-width," "error-string," "progress-callback, progress-callback-data," "info-callback, info-callback-data," - "ignore-restrictions, pre-hinting, increase-x-height," - "fallback-script, symbol", + "ignore-restrictions, windows-compatibility," + "pre-hinting, hint-with-components," + "increase-x-height, x-height-snapping-exceptions," + "fallback-script, symbol," + "debug", in, out, hinting_range_min, hinting_range_max, hinting_limit, + gray_strong_stem_width, gdi_cleartype_strong_stem_width, + dw_cleartype_strong_stem_width, &error_string, progress_func, &progress_data, info_func, &info_data, - ignore_restrictions, pre_hinting, increase_x_height, - latin_fallback, symbol); + ignore_restrictions, windows_compatibility, + pre_hinting, hint_with_components, + increase_x_height, x_height_snapping_exceptions_string, + latin_fallback, symbol, + debug); + + if (!no_info) + { + free(info_data.data); + free(info_data.data_wide); + } + + number_set_free(x_height_snapping_exceptions); if (error) { @@ -585,6 +753,9 @@ else if (error == TA_Err_Missing_Unicode_CMap) fprintf(stderr, "No Unicode character map.\n"); + else if (error == TA_Err_Missing_Symbol_CMap) + fprintf(stderr, + "No symbol character map.\n"); else if (error == TA_Err_Missing_Glyph) fprintf(stderr, "No glyph for the key character" @@ -597,8 +768,10 @@ exit(EXIT_FAILURE); } - fclose(in); - fclose(out); + if (in != stdin) + fclose(in); + if (out != stdout) + fclose(out); exit(EXIT_SUCCESS); @@ -620,8 +793,11 @@ app.setOrganizationDomain("freetype.org"); Main_GUI gui(hinting_range_min, hinting_range_max, hinting_limit, - increase_x_height, ignore_restrictions, pre_hinting, - no_info, latin_fallback, symbol); + gray_strong_stem_width, gdi_cleartype_strong_stem_width, + dw_cleartype_strong_stem_width, increase_x_height, + x_height_snapping_exceptions_string, + ignore_restrictions, windows_compatibility, pre_hinting, + hint_with_components, no_info, latin_fallback, symbol); gui.show(); return app.exec(); diff -Nru ttfautohint-0.9/frontend/maingui.cpp ttfautohint-0.94/frontend/maingui.cpp --- ttfautohint-0.9/frontend/maingui.cpp 2012-06-04 19:51:02.000000000 +0000 +++ ttfautohint-0.94/frontend/maingui.cpp 2012-11-25 15:53:19.000000000 +0000 @@ -40,28 +40,43 @@ Main_GUI::Main_GUI(int range_min, int range_max, int limit, + bool gray, + bool gdi, + bool dw, int increase, + const char* exceptions, bool ignore, + bool wincomp, bool pre, + bool components, bool no, int fallback, bool symb) : hinting_range_min(range_min), hinting_range_max(range_max), hinting_limit(limit), + gray_strong_stem_width(gray), + gdi_cleartype_strong_stem_width(gdi), + dw_cleartype_strong_stem_width(dw), increase_x_height(increase), + x_height_snapping_exceptions_string(exceptions), ignore_restrictions(ignore), + windows_compatibility(wincomp), pre_hinting(pre), + hint_with_components(components), no_info(no), latin_fallback(fallback), symbol(symb) { + x_height_snapping_exceptions = NULL; + create_layout(); create_connections(); create_actions(); create_menus(); create_status_bar(); + set_defaults(); read_settings(); setUnifiedTitleAndToolBarOnMac(true); @@ -74,6 +89,12 @@ } +Main_GUI::~Main_GUI() +{ + number_set_free(x_height_snapping_exceptions); +} + + // overloading void @@ -242,6 +263,106 @@ } +void +Main_GUI::check_number_set() +{ + QString text = snapping_line->text(); + QString qs; + + // construct ASCII string from arbitrary Unicode data; + // the idea is to accept, say, CJK fullwidth digits also + for (int i = 0; i < text.size(); i++) + { + QChar c = text.at(i); + + int digit = c.digitValue(); + if (digit >= 0) + qs += QString::number(digit); + else if (c.isSpace()) + qs += ' '; + // U+30FC KATAGANA-HIRAGANA PROLONGED SOUND MARK is assigned + // to the `-' key in some Japanese input methods + else if (c.category() == QChar::Punctuation_Dash + || c == QChar(0x30FC)) + qs += '-'; + // various Unicode COMMA characters, + // including representation forms + else if (c == QChar(',') + || c == QChar(0x055D) + || c == QChar(0x060C) + || c == QChar(0x07F8) + || c == QChar(0x1363) + || c == QChar(0x1802) + || c == QChar(0x1808) + || c == QChar(0x3001) + || c == QChar(0xA4FE) + || c == QChar(0xA60D) + || c == QChar(0xA6F5) + || c == QChar(0xFE10) + || c == QChar(0xFE11) + || c == QChar(0xFE50) + || c == QChar(0xFE51) + || c == QChar(0xFF0C) + || c == QChar(0xFF64)) + qs += ','; + else + qs += c; // we do error handling below + } + + if (x_height_snapping_exceptions) + number_set_free(x_height_snapping_exceptions); + + QByteArray str = qs.toLocal8Bit(); + const char* s = number_set_parse(str.constData(), + &x_height_snapping_exceptions, + 6, 0x7FFF); + if (s && *s) + { + statusBar()->setStyleSheet("color: red;"); + if (x_height_snapping_exceptions == NUMBERSET_ALLOCATION_ERROR) + statusBar()->showMessage( + tr("allocation error")); + else if (x_height_snapping_exceptions == NUMBERSET_INVALID_CHARACTER) + statusBar()->showMessage( + tr("invalid character (use digits, dashes, commas, and spaces)")); + else if (x_height_snapping_exceptions == NUMBERSET_OVERFLOW) + statusBar()->showMessage( + tr("overflow")); + else if (x_height_snapping_exceptions == NUMBERSET_INVALID_RANGE) + statusBar()->showMessage( + tr("invalid range (minimum is 6, maximum is 32767)")); + else if (x_height_snapping_exceptions == NUMBERSET_OVERLAPPING_RANGES) + statusBar()->showMessage( + tr("overlapping ranges")); + else if (x_height_snapping_exceptions == NUMBERSET_NOT_ASCENDING) + statusBar()->showMessage( + tr("values und ranges must be specified in ascending order")); + + snapping_line->setText(qs); + snapping_line->setFocus(Qt::OtherFocusReason); + snapping_line->setCursorPosition(s - str.constData()); + + x_height_snapping_exceptions = NULL; + } + else + { + // normalize if there is no error + char* new_str = number_set_show(x_height_snapping_exceptions, + 6, 0x7FFF); + snapping_line->setText(new_str); + free(new_str); + } +} + + +void +Main_GUI::clear_status_bar() +{ + statusBar()->clearMessage(); + statusBar()->setStyleSheet(""); +} + + int Main_GUI::check_filenames(const QString& input_name, const QString& output_name) @@ -429,7 +550,7 @@ QMessageBox::warning( this, "TTFautohint", - tr("This font has already been processed by ttfautohint."), + tr("This font has already been processed by TTFautohint."), QMessageBox::Ok, QMessageBox::Ok); else if (error == TA_Err_Missing_Legal_Permission) @@ -458,6 +579,13 @@ tr("No Unicode character map."), QMessageBox::Ok, QMessageBox::Ok); + else if (error == TA_Err_Missing_Symbol_CMap) + QMessageBox::warning( + this, + "TTFautohint", + tr("No symbol character map."), + QMessageBox::Ok, + QMessageBox::Ok); else if (error == TA_Err_Missing_Glyph) QMessageBox::warning( this, @@ -519,9 +647,6 @@ if (!open_files(input_name, &input, output_name, &output)) return; - unsigned char version_data[128]; - unsigned char version_data_wide[256]; - QProgressDialog dialog; dialog.setCancelButtonText(tr("Cancel")); dialog.setMinimumDuration(1000); @@ -532,47 +657,97 @@ GUI_Progress_Data gui_progress_data = {-1, true, &dialog}; Info_Data info_data; - info_data.data = version_data; - info_data.data_wide = version_data_wide; + info_data.data = NULL; // must be deallocated after use + info_data.data_wide = NULL; // must be deallocated after use + info_data.data_len = 0; + info_data.data_wide_len = 0; info_data.hinting_range_min = min_box->value(); info_data.hinting_range_max = max_box->value(); info_data.hinting_limit = no_limit_box->isChecked() ? 0 : limit_box->value(); + + info_data.gray_strong_stem_width = gray_box->isChecked(); + info_data.gdi_cleartype_strong_stem_width = gdi_box->isChecked(); + info_data.dw_cleartype_strong_stem_width = dw_box->isChecked(); + info_data.increase_x_height = no_increase_box->isChecked() ? 0 : increase_box->value(); + info_data.x_height_snapping_exceptions = x_height_snapping_exceptions; + info_data.windows_compatibility = wincomp_box->isChecked(); info_data.pre_hinting = pre_box->isChecked(); + info_data.hint_with_components = hint_box->isChecked(); info_data.latin_fallback = fallback_box->currentIndex(); info_data.symbol = symbol_box->isChecked(); if (info_box->isChecked()) - build_version_string(&info_data); + { + int ret = build_version_string(&info_data); + if (ret == 1) + QMessageBox::information( + this, + "TTFautohint", + tr("Can't allocate memory for TTFautohint options string" + " in name table."), + QMessageBox::Ok, + QMessageBox::Ok); + else if (ret == 2) + QMessageBox::information( + this, + "TTFautohint", + tr("TTFautohint options string" + " in name table too long."), + QMessageBox::Ok, + QMessageBox::Ok); + } else info_func = NULL; + QByteArray snapping_string = snapping_line->text().toLocal8Bit(); + TA_Error error = TTF_autohint("in-file, out-file," "hinting-range-min, hinting-range-max," "hinting-limit," + "gray-strong-stem-width," + "gdi-cleartype-strong-stem-width," + "dw-cleartype-strong-stem-width," "error-string," "progress-callback, progress-callback-data," "info-callback, info-callback-data," "ignore-restrictions," - "pre-hinting, increase-x-height," + "windows-compatibility," + "pre-hinting," + "hint-with-components," + "increase-x-height," + "x-height-snapping-exceptions," "fallback-script, symbol", input, output, info_data.hinting_range_min, info_data.hinting_range_max, info_data.hinting_limit, + info_data.gray_strong_stem_width, + info_data.gdi_cleartype_strong_stem_width, + info_data.dw_cleartype_strong_stem_width, &error_string, gui_progress, &gui_progress_data, info_func, &info_data, ignore_restrictions, - info_data.pre_hinting, info_data.increase_x_height, + info_data.windows_compatibility, + info_data.pre_hinting, + info_data.hint_with_components, + info_data.increase_x_height, + snapping_string.constData(), info_data.latin_fallback, info_data.symbol); + if (info_box->isChecked()) + { + free(info_data.data); + free(info_data.data_wide); + } + fclose(input); fclose(output); @@ -586,17 +761,21 @@ } +// XXX distances are specified in pixels, +// making the layout dependent on the output device resolution void Main_GUI::create_layout() { + // // file stuff + // QCompleter* completer = new QCompleter(this); QFileSystemModel* model = new QFileSystemModel(completer); model->setRootPath(QDir::rootPath()); completer->setModel(model); QLabel* input_label = new QLabel(tr("&Input File:")); - input_line = new QLineEdit; + input_line = new Line_Edit; input_button = new QPushButton(tr("Browse...")); input_label->setBuddy(input_line); // enforce rich text to get nice word wrapping @@ -606,55 +785,64 @@ input_line->setCompleter(completer); QLabel* output_label = new QLabel(tr("&Output File:")); - output_line = new QLineEdit; + output_line = new Line_Edit; output_button = new QPushButton(tr("Browse...")); output_label->setBuddy(output_line); output_label->setToolTip( tr("The output file, which will be essentially identical" - " to the input font but contains new, generated hints.")); + " to the input font but will contain new, generated hints.")); output_line->setCompleter(completer); + // layout QGridLayout* file_layout = new QGridLayout; - file_layout->addWidget(input_label, 0, 0); + + file_layout->addWidget(input_label, 0, 0, Qt::AlignRight); file_layout->addWidget(input_line, 0, 1); file_layout->addWidget(input_button, 0, 2); - file_layout->addWidget(output_label, 1, 0); - file_layout->addWidget(output_line, 1, 1); - file_layout->addWidget(output_button, 1, 2); + file_layout->setRowStretch(1, 1); + + file_layout->addWidget(output_label, 2, 0, Qt::AlignRight); + file_layout->addWidget(output_line, 2, 1); + file_layout->addWidget(output_button, 2, 2); + + // // minmax controls - QLabel* min_label = new QLabel(tr("Mi&nimum:")); + // + QLabel* min_label = new QLabel(tr("Hint Set Range Mi&nimum:")); min_box = new QSpinBox; min_label->setBuddy(min_box); + min_label->setToolTip( + tr("The minimum PPEM value of the range for which" + " TTFautohint computes hint sets." + " A hint set for a given PPEM value hints this size optimally." + " The larger the range, the more hint sets are considered," + " usually increasing the size of the bytecode.
      " + "Note that changing this range doesn't influence" + " the gasp table:" + " Hinting is enabled for all sizes.")); min_box->setKeyboardTracking(false); min_box->setRange(2, 10000); - min_box->setValue(hinting_range_min); - QLabel* max_label = new QLabel(tr("Ma&ximum:")); + QLabel* max_label = new QLabel(tr("Hint Set Range Ma&ximum:")); max_box = new QSpinBox; max_label->setBuddy(max_box); - max_box->setKeyboardTracking(false); - max_box->setRange(2, 10000); - max_box->setValue(hinting_range_max); - - QGridLayout* minmax_layout = new QGridLayout; - minmax_layout->addWidget(min_label, 0, 0); - minmax_layout->addWidget(min_box, 0, 1); - minmax_layout->addWidget(max_label, 1, 0); - minmax_layout->addWidget(max_box, 1, 1); - - // hinting and fallback controls - QLabel* hinting_label = new QLabel(tr("Hint Set Range") + " "); - QLabel* fallback_label = new QLabel(tr("Fallback &Script:")); - hinting_label->setToolTip( - tr("The PPEM range for which TTFautohint computes" - " hint sets." + max_label->setToolTip( + tr("The maximum PPEM value of the range for which" + " TTFautohint computes hint sets." " A hint set for a given PPEM value hints this size optimally." " The larger the range, the more hint sets are considered," " usually increasing the size of the bytecode.
      " "Note that changing this range doesn't influence" " the gasp table:" " Hinting is enabled for all sizes.")); + max_box->setKeyboardTracking(false); + max_box->setRange(2, 10000); + + // + // hinting and fallback controls + // + QLabel* fallback_label = new QLabel(tr("Fallback &Script:")); fallback_box = new QComboBox; fallback_label->setBuddy(fallback_box); fallback_label->setToolTip( @@ -662,17 +850,10 @@ " which TTFautohint can't map to a script automatically.")); fallback_box->insertItem(0, tr("None")); fallback_box->insertItem(1, tr("Latin")); - fallback_box->setCurrentIndex(latin_fallback); - - QHBoxLayout* hint_fallback_layout = new QHBoxLayout; - hint_fallback_layout->addWidget(hinting_label); - hint_fallback_layout->addLayout(minmax_layout); - hint_fallback_layout->addStretch(1); - hint_fallback_layout->addWidget(fallback_label); - hint_fallback_layout->addWidget(fallback_box); - hint_fallback_layout->addStretch(2); + // // hinting limit + // limit_label = new QLabel(tr("Hinting &Limit:")); limit_box = new QSpinBox; limit_label->setBuddy(limit_box); @@ -682,28 +863,15 @@ " (regardless of the values in the gasp table).")); limit_box->setKeyboardTracking(false); limit_box->setRange(2, 10000); - limit_box->setValue(hinting_limit ? hinting_limit : hinting_range_max); - no_limit_box = new QCheckBox(tr("No Hinting Limi&t"), this); + no_limit_box = new QCheckBox(tr("No Hinting Limit"), this); no_limit_box->setToolTip( tr("If switched on, TTFautohint adds no hinting limit" " to the bytecode.")); - QHBoxLayout* limit_layout = new QHBoxLayout; - limit_layout->addWidget(limit_label); - limit_layout->addWidget(limit_box); - limit_layout->addStretch(1); - limit_layout->addWidget(no_limit_box); - limit_layout->addStretch(1); - - // handle command line option `--hinting-limit=0' - if (!hinting_limit) - { - hinting_limit = max_box->value(); - no_limit_box->setChecked(true); - } - + // // x height increase limit + // increase_label = new QLabel(tr("x Height In&crease Limit:")); increase_box = new QSpinBox; increase_label->setBuddy(increase_box); @@ -714,93 +882,181 @@ "Use this if holes in letters like e get filled," " for example.")); increase_box->setKeyboardTracking(false); - increase_box->setRange(6, 20); - increase_box->setValue(increase_x_height ? increase_x_height : TA_INCREASE_X_HEIGHT); + increase_box->setRange(6, 10000); - no_increase_box = new QCheckBox(tr("No x Hei&ght Increase"), this); + no_increase_box = new QCheckBox(tr("No x Height Increase"), this); no_increase_box->setToolTip( - tr("If switched on, TTFautohint does not increase the x height.")); + tr("If switched on," + " TTFautohint does not increase the x height.")); - QHBoxLayout* increase_layout = new QHBoxLayout; - increase_layout->addWidget(increase_label); - increase_layout->addWidget(increase_box); - increase_layout->addStretch(1); - increase_layout->addWidget(no_increase_box); - increase_layout->addStretch(1); - - // handle command line option `--increase-x-height=0' - if (!increase_x_height) - { - increase_x_height = TA_INCREASE_X_HEIGHT; - no_increase_box->setChecked(true); - } - - check_min(); - check_max(); - check_limit(); - - check_no_limit(); - check_no_increase(); + // + // x height snapping exceptions + // + QLabel* snapping_label = new QLabel(tr("x Height Snapping Excep&tions:")); + snapping_line = new QLineEdit; + snapping_label->setBuddy(snapping_line); + snapping_label->setToolTip( + tr("

      A list of comma separated PPEM values or value ranges" + " at which no x-height snapping shall be applied.

      " + "" + "Examples:
      " + "  2, 3-5, 12-17
      " + "  -20, 40-" + " (meaning PPEM ≤ 20 or PPEM ≥ 40)
      " + "  - (meaning all possible PPEM values)")); + // // flags + // + wincomp_box = new QCheckBox(tr("Windows Com&patibility"), this); + wincomp_box->setToolTip( + tr("If switched on, add two artificial blue zones positioned at the" + " usWinAscent and usWinDescent values" + " (from the font's OS/2 table)." + " Use this if those values are tight," + " and you are experiencing clipping during rendering.")); + pre_box = new QCheckBox(tr("Pr&e-hinting"), this); pre_box->setToolTip( tr("If switched on, the original bytecode of the input font" " gets applied before TTFautohint starts processing" " the outlines of the glyphs.")); - if (pre_hinting) - pre_box->setChecked(true); + + hint_box = new QCheckBox(tr("Hint With Co&mponents") + + " ", this); // make label wider + hint_box->setToolTip( + tr("If switched on, TTFautohint hints composite glyphs" + " as a whole, including subglyphs." + " Otherwise, glyph components get hinted separately.
      " + "Deactivating this flag reduces the bytecode size enormously," + " however, it might yield worse results.")); symbol_box = new QCheckBox(tr("S&ymbol Font"), this); symbol_box->setToolTip( - tr("If switched on, ttfautohint uses default values" + tr("If switched on, TTFautohint uses default values" " for standard stem width and height" " instead of deriving these values from the input font.
      " "Use this for fonts which don't contain glyphs" " of a (supported) script.")); - if (symbol) - symbol_box->setChecked(true); info_box = new QCheckBox(tr("Add ttf&autohint Info"), this); info_box->setToolTip( - tr("If switched on, information about ttfautohint" + tr("If switched on, information about TTFautohint" " and its calling parameters are added to the version string(s)" " (name ID 5) in the name table.")); - if (!no_info) - info_box->setChecked(true); - QHBoxLayout* flags_layout = new QHBoxLayout; - flags_layout->addWidget(pre_box); - flags_layout->addStretch(1); - flags_layout->addWidget(symbol_box); - flags_layout->addStretch(1); - flags_layout->addWidget(info_box); - flags_layout->addStretch(1); + // + // stem width and positioning + // + QLabel* stem_label = new QLabel(tr("Strong Stem &Width and Positioning:")); + stem_label->setToolTip( + tr("TTFautohint provides two different hinting algorithms" + " which can be selected for various hinting modes." + "" + "

      strong: Position horizontal stems and snap stem widths" + " to integer pixel values. While making the output look crisper," + " outlines become more distorted.

      " + "" + "

      smooth: Use discrete values for horizontal stems" + " and stem widths. This only slightly increases the contrast" + " but avoids larger outline distortion.

      ")); + + gray_box = new QCheckBox(tr("Grayscale"), this); + gray_box->setToolTip( + tr("Grayscale rendering, no ClearType activated.")); + stem_label->setBuddy(gray_box); + + gdi_box = new QCheckBox(tr("GDI ClearType"), this); + gdi_box->setToolTip( + tr("GDI ClearType rendering," + " introduced in 2000 for Windows XP.
      " + "The rasterizer version (as returned by the" + " GETINFO bytecode instruction) is in the range" + " 36 ≤ version < 38, and ClearType is enabled.
      " + "Along the vertical axis, this mode behaves like B/W rendering.")); + + dw_box = new QCheckBox(tr("DW ClearType"), this); + dw_box->setToolTip( + tr("DirectWrite ClearType rendering," + " introduced in 2008 for Windows Vista.
      " + "The rasterizer version (as returned by the" + " GETINFO bytecode instruction) is ≥ 38," + " ClearType is enabled, and subpixel positioning is enabled also.
      " + "Smooth rendering along the vertical axis.")); + // // running - run_button = new QPushButton(tr("&Run")); - run_button->setEnabled(false); - - QHBoxLayout* running_layout = new QHBoxLayout; - running_layout->addStretch(1); - running_layout->addWidget(run_button); - running_layout->addStretch(1); + // + run_button = new QPushButton(" " + + tr("&Run") + + " "); // make label wider + // // the whole gui - QVBoxLayout* gui_layout = new QVBoxLayout; - gui_layout->addSpacing(10); // XXX urgh, pixels... - gui_layout->addLayout(file_layout); - gui_layout->addSpacing(20); // XXX urgh, pixels... - gui_layout->addLayout(hint_fallback_layout); - gui_layout->addSpacing(20); // XXX urgh, pixels... - gui_layout->addLayout(limit_layout); - gui_layout->addSpacing(20); // XXX urgh, pixels... - gui_layout->addLayout(increase_layout); - gui_layout->addSpacing(20); // XXX urgh, pixels... - gui_layout->addLayout(flags_layout); - gui_layout->addSpacing(20); // XXX urgh, pixels... - gui_layout->addLayout(running_layout); - gui_layout->addSpacing(10); // XXX urgh, pixels... + // + QGridLayout* gui_layout = new QGridLayout; + QFrame* hline = new QFrame; + hline->setFrameShape(QFrame::HLine); + int row = 0; // this counter simplifies inserting new items + + gui_layout->setRowMinimumHeight(row, 10); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addLayout(file_layout, row, 0, row, -1); + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(hline, row, 0, row, -1); + gui_layout->setRowStretch(row++, 1); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(min_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(min_box, row++, 1, Qt::AlignLeft); + gui_layout->addWidget(max_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(max_box, row++, 1, Qt::AlignLeft); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(fallback_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(fallback_box, row++, 1, Qt::AlignLeft); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(limit_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(limit_box, row++, 1, Qt::AlignLeft); + gui_layout->addWidget(no_limit_box, row++, 1); + + gui_layout->addWidget(increase_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(increase_box, row++, 1, Qt::AlignLeft); + gui_layout->addWidget(no_increase_box, row++, 1); + + gui_layout->addWidget(snapping_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(snapping_line, row++, 1, Qt::AlignLeft); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(wincomp_box, row++, 1); + gui_layout->addWidget(pre_box, row++, 1); + gui_layout->addWidget(hint_box, row++, 1); + gui_layout->addWidget(symbol_box, row++, 1); + gui_layout->addWidget(info_box, row++, 1); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(stem_label, row, 0, Qt::AlignRight); + gui_layout->addWidget(gray_box, row++, 1); + gui_layout->addWidget(gdi_box, row++, 1); + gui_layout->addWidget(dw_box, row++, 1); + + gui_layout->setRowMinimumHeight(row, 20); // XXX urgh, pixels... + gui_layout->setRowStretch(row++, 1); + + gui_layout->addWidget(run_button, row++, 1, Qt::AlignRight); // create dummy widget to register layout QWidget* main_widget = new QWidget; @@ -841,6 +1097,11 @@ connect(no_increase_box, SIGNAL(clicked()), this, SLOT(check_no_increase())); + connect(snapping_line, SIGNAL(editingFinished()), this, + SLOT(check_number_set())); + connect(snapping_line, SIGNAL(textEdited(QString)), this, + SLOT(clear_status_bar())); + connect(run_button, SIGNAL(clicked()), this, SLOT(run())); } @@ -881,6 +1142,63 @@ void +Main_GUI::set_defaults() +{ + min_box->setValue(hinting_range_min); + max_box->setValue(hinting_range_max); + + fallback_box->setCurrentIndex(latin_fallback); + + limit_box->setValue(hinting_limit ? hinting_limit : hinting_range_max); + // handle command line option `--hinting-limit=0' + if (!hinting_limit) + { + hinting_limit = max_box->value(); + no_limit_box->setChecked(true); + } + + increase_box->setValue(increase_x_height ? increase_x_height + : TA_INCREASE_X_HEIGHT); + // handle command line option `--increase-x-height=0' + if (!increase_x_height) + { + increase_x_height = TA_INCREASE_X_HEIGHT; + no_increase_box->setChecked(true); + } + + snapping_line->setText(x_height_snapping_exceptions_string); + + if (windows_compatibility) + wincomp_box->setChecked(true); + if (pre_hinting) + pre_box->setChecked(true); + if (hint_with_components) + hint_box->setChecked(true); + if (symbol) + symbol_box->setChecked(true); + if (!no_info) + info_box->setChecked(true); + + if (gray_strong_stem_width) + gray_box->setChecked(true); + if (gdi_cleartype_strong_stem_width) + gdi_box->setChecked(true); + if (dw_cleartype_strong_stem_width) + dw_box->setChecked(true); + + run_button->setEnabled(false); + + check_min(); + check_max(); + check_limit(); + + check_no_limit(); + check_no_increase(); + check_number_set(); +} + + +void Main_GUI::read_settings() { QSettings settings; diff -Nru ttfautohint-0.9/frontend/maingui.h ttfautohint-0.94/frontend/maingui.h --- ttfautohint-0.9/frontend/maingui.h 2012-06-04 19:32:11.000000000 +0000 +++ ttfautohint-0.94/frontend/maingui.h 2012-11-25 15:44:19.000000000 +0000 @@ -16,21 +16,26 @@ #include -#include +#include +#include "lineedit.h" #include #include +#include class QAction; +class QButtonGroup; +class QCheckBox; +class QComboBox; +class QFile; class QLabel; -class QMenu; class QLineEdit; +class QLocale; +class QMenu; class QPushButton; class QSpinBox; -class QComboBox; -class QCheckBox; -class QLocale; -class QFile; + +class Line_Edit; class Main_GUI : public QMainWindow @@ -38,7 +43,12 @@ Q_OBJECT public: - Main_GUI(int, int, int, int, bool, bool, bool, int, bool); + Main_GUI(int, int, int, + bool, bool, bool, + int, const char*, + bool, bool, bool, + bool, bool, int, bool); + ~Main_GUI(); protected: void closeEvent(QCloseEvent*); @@ -54,6 +64,8 @@ void check_no_increase(); void absolute_input(); void absolute_output(); + void check_number_set(); + void clear_status_bar(); void check_run(); void run(); @@ -61,18 +73,27 @@ int hinting_range_min; int hinting_range_max; int hinting_limit; + int gray_strong_stem_width; + int gdi_cleartype_strong_stem_width; + int dw_cleartype_strong_stem_width; int increase_x_height; + QString x_height_snapping_exceptions_string; + number_range* x_height_snapping_exceptions; int ignore_restrictions; + int windows_compatibility; int pre_hinting; + int hint_with_components; int no_info; int latin_fallback; int symbol; void create_layout(); + void create_connections(); void create_actions(); void create_menus(); void create_status_bar(); + void set_defaults(); void read_settings(); void write_settings(); @@ -83,15 +104,19 @@ QMenu* file_menu; QMenu* help_menu; - QLineEdit* input_line; + Line_Edit* input_line; QPushButton* input_button; - QLineEdit* output_line; + Line_Edit* output_line; QPushButton* output_button; QSpinBox* min_box; QSpinBox* max_box; + QCheckBox* gray_box; + QCheckBox* gdi_box; + QCheckBox* dw_box; + QComboBox* fallback_box; QLabel* limit_label; @@ -102,7 +127,11 @@ QSpinBox* increase_box; QCheckBox* no_increase_box; + QLineEdit* snapping_line; + + QCheckBox* wincomp_box; QCheckBox* pre_box; + QCheckBox* hint_box; QCheckBox* symbol_box; QCheckBox* info_box; diff -Nru ttfautohint-0.9/frontend/ttfautohint.1 ttfautohint-0.94/frontend/ttfautohint.1 --- ttfautohint-0.9/frontend/ttfautohint.1 2012-06-06 05:43:13.000000000 +0000 +++ ttfautohint-0.94/frontend/ttfautohint.1 2012-11-29 07:24:17.000000000 +0000 @@ -1,13 +1,16 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.5. -.TH TTFAUTOHINT "1" "June 2012" "ttfautohint 0.9" "User Commands" +.TH TTFAUTOHINT "1" "November 2012" "ttfautohint 0.94" "User Commands" .SH NAME ttfautohint \- add new auto-generated hints to a TrueType font .SH SYNOPSIS .B ttfautohint -[\fIOPTION\fR]... \fIIN-FILE OUT-FILE\fR +[\fIOPTION\fR]... [\fIIN-FILE \fR[\fIOUT-FILE\fR]] .SH DESCRIPTION Replace hints in TrueType font IN\-FILE and write output to OUT\-FILE. -The new hints are based on FreeType's autohinter. +If OUT\-FILE is missing, standard output is used instead; +if IN\-FILE is missing also, standard input and output are used. +.PP +The new hints are based on FreeType's auto\-hinter. .PP This program is a simple front\-end to the `ttfautohint' library. .PP @@ -19,6 +22,12 @@ Mandatory arguments to long options are mandatory for short options too. .SH OPTIONS .TP +\fB\-\-debug\fR +print debugging information +.TP +\fB\-c\fR, \fB\-\-components\fR +hint glyph components separately +.TP \fB\-f\fR, \fB\-\-latin\-fallback\fR set fallback script to latin .TP @@ -36,7 +45,7 @@ the minimum PPEM value for hint sets (default: 8) .TP -\fB\-n\fR \fB\-\-no\-info\fR +\fB\-n\fR, \fB\-\-no\-info\fR don't add ttfautohint info to the version string(s) in the `name' table .TP @@ -56,6 +65,17 @@ \fB\-V\fR, \fB\-\-version\fR print version information and exit .TP +\fB\-w\fR, \fB\-\-strong\-stem\-width\fR=\fIS\fR +use strong stem width routine for modes S, +where S is a string of up to three letters +with possible values `g' for grayscale, +`G' for GDI ClearType, and `D' for +DirectWrite ClearType (default: G) +.TP +\fB\-W\fR, \fB\-\-windows\-compatibility\fR +add blue zones for `usWinAscent' and +`usWinDescent' to avoid clipping +.TP \fB\-x\fR, \fB\-\-increase\-x\-height\fR=\fIN\fR increase x height for sizes in the range 6<=PPEM<=N; value 0 switches off this feature @@ -63,7 +83,8 @@ .TP \fB\-X\fR, \fB\-\-x\-height\-snapping\-exceptions\fR=\fISTRING\fR specify a comma\-separated list of -x\-height snapping exceptions +x\-height snapping exceptions, for example +"\-9, 13\-17, 19" (default: "") .PP The program accepts both TTF and TTC files as input. Use option \fB\-i\fR only if you have a legal permission to modify the font. diff -Nru ttfautohint-0.9/frontend/ttfautohintGUI.1 ttfautohint-0.94/frontend/ttfautohintGUI.1 --- ttfautohint-0.9/frontend/ttfautohintGUI.1 2012-06-06 05:43:14.000000000 +0000 +++ ttfautohint-0.94/frontend/ttfautohintGUI.1 2012-11-29 07:24:17.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.5. -.TH TTFAUTOHINTGUI "1" "June 2012" "ttfautohintGUI 0.9" "User Commands" +.TH TTFAUTOHINTGUI "1" "November 2012" "ttfautohintGUI 0.94" "User Commands" .SH NAME ttfautohintGUI \- add new auto-generated hints to a TrueType font .SH SYNOPSIS @@ -7,7 +7,8 @@ [\fIOPTION\fR]... .SH DESCRIPTION A GUI application to replace hints in a TrueType font. -The new hints are based on FreeType's autohinter. +.PP +The new hints are based on FreeType's auto\-hinter. .PP This program is a simple front\-end to the `ttfautohint' library. .PP @@ -20,6 +21,9 @@ Options not related to Qt or X11 set default values. .SH OPTIONS .TP +\fB\-c\fR, \fB\-\-components\fR +hint glyph components separately +.TP \fB\-f\fR, \fB\-\-latin\-fallback\fR set fallback script to latin .TP @@ -40,7 +44,7 @@ the minimum PPEM value for hint sets (default: 8) .TP -\fB\-n\fR \fB\-\-no\-info\fR +\fB\-n\fR, \fB\-\-no\-info\fR don't add ttfautohint info to the version string(s) in the `name' table .TP @@ -60,6 +64,17 @@ \fB\-V\fR, \fB\-\-version\fR print version information and exit .TP +\fB\-w\fR, \fB\-\-strong\-stem\-width\fR=\fIS\fR +use strong stem width routine for modes S, +where S is a string of up to three letters +with possible values `g' for grayscale, +`G' for GDI ClearType, and `D' for +DirectWrite ClearType (default: G) +.TP +\fB\-W\fR, \fB\-\-windows\-compatibility\fR +add blue zones for `usWinAscent' and +`usWinDescent' to avoid clipping +.TP \fB\-x\fR, \fB\-\-increase\-x\-height\fR=\fIN\fR increase x height for sizes in the range 6<=PPEM<=N; value 0 switches off this feature @@ -67,7 +82,8 @@ .TP \fB\-X\fR, \fB\-\-x\-height\-snapping\-exceptions\fR=\fISTRING\fR specify a comma\-separated list of -x\-height snapping exceptions +x\-height snapping exceptions, for example +"\-9, 13\-17, 19" (default: "") .SS "Qt Options:" .TP \fB\-\-graphicssystem\fR=\fISYSTEM\fR diff -Nru ttfautohint-0.9/gnulib/compile ttfautohint-0.94/gnulib/compile --- ttfautohint-0.9/gnulib/compile 2012-01-21 10:26:35.000000000 +0000 +++ ttfautohint-0.94/gnulib/compile 2012-11-29 07:22:16.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. +# Wrapper for compilers which do not understand '-c -o'. -scriptversion=2009-10-06.20; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software -# Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -29,21 +28,224 @@ # bugs to or send patches to # . +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. +right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF @@ -53,11 +255,13 @@ echo "compile $scriptversion" exit $? ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; esac ofile= cfile= -eat= for arg do @@ -66,8 +270,8 @@ else case $1 in -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) @@ -94,10 +298,10 @@ done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a + # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also + # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi @@ -106,7 +310,7 @@ cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. -# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d diff -Nru ttfautohint-0.9/gnulib/depcomp ttfautohint-0.94/gnulib/depcomp --- ttfautohint-0.9/gnulib/depcomp 2012-01-21 10:26:35.000000000 +0000 +++ ttfautohint-0.94/gnulib/depcomp 2012-11-29 07:22:16.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-07-12.20; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +27,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,11 +39,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -57,6 +56,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +74,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -90,10 +98,24 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -123,13 +145,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -148,20 +174,21 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -193,18 +220,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -216,10 +240,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -249,12 +280,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -265,23 +295,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -290,6 +323,85 @@ exit $stat fi rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'` + tmpdepfile="$base.d" + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir="$base.d-lock" + trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0 ; do + # mkdir is a portable test-and-set. + if mkdir $lockdir 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rm -rf $lockdir + break + else + ## the lock is being held by a different process, + ## wait until the winning process is done or we timeout + while test -d $lockdir && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to @@ -334,7 +446,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -349,9 +461,9 @@ tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -397,14 +509,59 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -422,7 +579,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -442,15 +599,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -503,9 +659,10 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -525,7 +682,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -594,8 +751,8 @@ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru ttfautohint-0.9/gnulib/m4/errno_h.m4 ttfautohint-0.94/gnulib/m4/errno_h.m4 --- ttfautohint-0.9/gnulib/m4/errno_h.m4 2012-06-06 05:21:58.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/errno_h.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# errno_h.m4 serial 11 +# errno_h.m4 serial 12 dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -58,6 +58,9 @@ #if !defined ENOTRECOVERABLE booboo #endif +#if !defined EILSEQ +booboo +#endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) diff -Nru ttfautohint-0.9/gnulib/m4/extensions.m4 ttfautohint-0.94/gnulib/m4/extensions.m4 --- ttfautohint-0.9/gnulib/m4/extensions.m4 2012-01-21 10:26:11.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/extensions.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# serial 11 -*- Autoconf -*- +# serial 12 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc. @@ -67,7 +67,7 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on MacOS X. */ +/* Enable general extensions on Mac OS X. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif diff -Nru ttfautohint-0.9/gnulib/m4/fcntl-o.m4 ttfautohint-0.94/gnulib/m4/fcntl-o.m4 --- ttfautohint-0.9/gnulib/m4/fcntl-o.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/fcntl-o.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,134 @@ +# fcntl-o.m4 serial 4 +dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +# Test whether the flags O_NOATIME and O_NOFOLLOW actually work. +# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. +# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. +AC_DEFUN([gl_FCNTL_O_FLAGS], +[ + dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. + dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes + dnl AC_GNU_SOURCE. + m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], + [AC_REQUIRE([AC_GNU_SOURCE])]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + ]], + [[ + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result;]])], + [gl_cv_header_working_fcntl_h=yes], + [case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/fcntl_h.m4 ttfautohint-0.94/gnulib/m4/fcntl_h.m4 --- ttfautohint-0.9/gnulib/m4/fcntl_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/fcntl_h.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,50 @@ +# serial 15 +# Configure fcntl.h. +dnl Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_FCNTL_H], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + gl_NEXT_HEADERS([fcntl.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, if it is not common + dnl enough to be declared everywhere. + gl_WARN_ON_USE_PREPARE([[#include + ]], [fcntl openat]) +]) + +AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_FCNTL_H_DEFAULTS], +[ + GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) + GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) + REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/getopt.m4 ttfautohint-0.94/gnulib/m4/getopt.m4 --- ttfautohint-0.9/gnulib/m4/getopt.m4 2012-01-21 10:26:11.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/getopt.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# getopt.m4 serial 39 +# getopt.m4 serial 44 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,18 +9,17 @@ [ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) dnl Other modules can request the gnulib implementation of the getopt dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. dnl argp.m4 does this. m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ - gl_GETOPT_IFELSE([], []) REPLACE_GETOPT=1 ], [ REPLACE_GETOPT=0 - gl_GETOPT_IFELSE([ + if test -n "$gl_replace_getopt"; then REPLACE_GETOPT=1 - ], - []) + fi ]) if test $REPLACE_GETOPT = 1; then dnl Arrange for getopt.h to be created. @@ -38,13 +37,6 @@ AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) ]) -# emacs' configure.in uses this. -AC_DEFUN([gl_GETOPT_IFELSE], -[ - AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) - AS_IF([test -n "$gl_replace_getopt"], [$1], [$2]) -]) - # Determine whether to replace the entire getopt facility. AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ @@ -74,11 +66,6 @@ AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) fi - dnl mingw's getopt (in libmingwex.a) does weird things when the options - dnl strings starts with '+' and it's not the first call. Some internal state - dnl is left over from earlier calls, and neither setting optind = 0 nor - dnl setting optreset = 1 get rid of this internal state. - dnl POSIX is silent on optind vs. optreset, so we allow either behavior. dnl POSIX 2008 does not specify leading '+' behavior, but see dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on dnl the next version of POSIX. For now, we only guarantee leading '+' @@ -87,30 +74,16 @@ AC_CACHE_CHECK([whether getopt is POSIX compatible], [gl_cv_func_getopt_posix], [ - dnl BSD getopt_long uses an incompatible method to reset option - dnl processing. Existence of the optreset variable, in and of - dnl itself, is not a reason to replace getopt, but knowledge - dnl of the variable is needed to determine how to reset and - dnl whether a reset reparses the environment. Solaris - dnl supports neither optreset nor optind=0, but keeps no state - dnl that needs a reset beyond setting optind=1; detect Solaris - dnl by getopt_clip. - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[int *p = &optreset; return optreset;]])], - [gl_optind_min=1], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[return !getopt_clip;]])], - [gl_optind_min=1], - [gl_optind_min=0])]) - - dnl This test fails on mingw and succeeds on many other platforms. - gl_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + dnl Merging these three different test programs into a single one + dnl would require a reset mechanism. On BSD systems, it can be done + dnl through 'optreset'; on some others (glibc), it can be done by + dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, + dnl Solaris 9, musl libc), there is no such mechanism. + if test $cross_compiling = no; then + dnl Sanity check. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -118,89 +91,107 @@ int main () { - { - static char program[] = "program"; - static char a[] = "-a"; - static char foo[] = "foo"; - static char bar[] = "bar"; - char *argv[] = { program, a, foo, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (4, argv, "ab"); - if (!(c == 'a')) - return 1; - c = getopt (4, argv, "ab"); - if (!(c == -1)) - return 2; - if (!(optind == 2)) - return 3; - } - /* Some internal state exists at this point. */ - { - static char program[] = "program"; - static char donald[] = "donald"; - static char p[] = "-p"; - static char billy[] = "billy"; - static char duck[] = "duck"; - static char a[] = "-a"; - static char bar[] = "bar"; - char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (7, argv, "+abp:q:"); - if (!(c == -1)) - return 4; - if (!(strcmp (argv[0], "program") == 0)) - return 5; - if (!(strcmp (argv[1], "donald") == 0)) - return 6; - if (!(strcmp (argv[2], "-p") == 0)) - return 7; - if (!(strcmp (argv[3], "billy") == 0)) - return 8; - if (!(strcmp (argv[4], "duck") == 0)) - return 9; - if (!(strcmp (argv[5], "-a") == 0)) - return 10; - if (!(strcmp (argv[6], "bar") == 0)) - return 11; - if (!(optind == 1)) - return 12; - } - /* Detect MacOS 10.5, AIX 7.1 bug. */ - { - static char program[] = "program"; - static char ab[] = "-ab"; - char *argv[3] = { program, ab, NULL }; - optind = OPTIND_MIN; - opterr = 0; - if (getopt (2, argv, "ab:") != 'a') - return 13; - if (getopt (2, argv, "ab:") != '?') - return 14; - if (optopt != 'b') - return 15; - if (optind != 2) - return 16; - } + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + if test $gl_cv_func_getopt_posix = maybe; then + dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; return 0; } ]])], - [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no], - [case "$host_os" in - mingw*) gl_cv_func_getopt_posix="guessing no";; - darwin* | aix*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; - esac - ]) - CPPFLAGS=$gl_save_CPPFLAGS + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + fi + if test $gl_cv_func_getopt_posix = maybe; then + dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} +]])], + [gl_cv_func_getopt_posix=yes], + [gl_cv_func_getopt_posix=no]) + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi ]) case "$gl_cv_func_getopt_posix" in *no) gl_replace_getopt=yes ;; @@ -236,7 +227,7 @@ nocrash_init(); /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, - and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10. */ { static char conftest[] = "conftest"; @@ -247,7 +238,7 @@ result |= 1; } /* This code succeeds on glibc 2.8, mingw, - and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ { static char program[] = "program"; @@ -276,7 +267,7 @@ if (getopt (3, argv, "-p") != 1) result |= 16; else if (getopt (3, argv, "-p") != 'p') - result |= 32; + result |= 16; } /* This code fails on glibc 2.11. */ { @@ -286,9 +277,9 @@ char *argv[] = { program, b, a, NULL }; optind = opterr = 0; if (getopt (3, argv, "+:a:b") != 'b') - result |= 64; + result |= 32; else if (getopt (3, argv, "+:a:b") != ':') - result |= 64; + result |= 32; } /* This code dumps core on glibc 2.14. */ { @@ -298,18 +289,14 @@ char *argv[] = { program, w, dummy, NULL }; optind = opterr = 1; if (getopt (3, argv, "W;") != 'W') - result |= 128; + result |= 64; } return result; ]])], [gl_cv_func_getopt_gnu=yes], [gl_cv_func_getopt_gnu=no], - [dnl Cross compiling. Guess based on host and declarations. - case $host_os:$ac_cv_have_decl_optreset in - *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;; - *:yes) gl_cv_func_getopt_gnu=no;; - *) gl_cv_func_getopt_gnu=yes;; - esac + [dnl Cross compiling. Assume the worst, even on glibc platforms. + gl_cv_func_getopt_gnu="guessing no" ]) case $gl_had_POSIXLY_CORRECT in exported) ;; @@ -317,13 +304,54 @@ *) AS_UNSET([POSIXLY_CORRECT]) ;; esac ]) - if test "$gl_cv_func_getopt_gnu" = "no"; then + if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes + else + AC_CACHE_CHECK([for working GNU getopt_long function], + [gl_cv_func_getopt_long_gnu], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + ]], + [[static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + ]])], + [gl_cv_func_getopt_long_gnu=yes], + [gl_cv_func_getopt_long_gnu=no], + [dnl Cross compiling. Guess no on OpenBSD, yes otherwise. + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + ]) + ]) + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac fi fi ]) -# emacs' configure.in uses this. AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ GETOPT_H=getopt.h @@ -334,7 +362,6 @@ ]) # Prerequisites of lib/getopt*. -# emacs' configure.in uses this. AC_DEFUN([gl_PREREQ_GETOPT], [ AC_CHECK_DECLS_ONCE([getenv]) diff -Nru ttfautohint-0.9/gnulib/m4/gnulib-cache.m4 ttfautohint-0.94/gnulib/m4/gnulib-cache.m4 --- ttfautohint-0.9/gnulib/m4/gnulib-cache.m4 2012-05-01 06:46:34.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/gnulib-cache.m4 2012-11-29 07:21:54.000000000 +0000 @@ -27,13 +27,16 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl getopt-gnu git-version-gen strerror_r-posix +# gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl fcntl-h getopt-gnu git-version-gen isatty memmem-simple strerror_r-posix # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl]) gl_MODULES([ + fcntl-h getopt-gnu git-version-gen + isatty + memmem-simple strerror_r-posix ]) gl_AVOID([]) @@ -47,4 +50,4 @@ gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) -gl_WITNESS_C_DOMAIN([]) +gl_WITNESS_C_MACRO([]) diff -Nru ttfautohint-0.9/gnulib/m4/gnulib-common.m4 ttfautohint-0.94/gnulib/m4/gnulib-common.m4 --- ttfautohint-0.9/gnulib/m4/gnulib-common.m4 2012-06-06 05:21:58.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/gnulib-common.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 32 +# gnulib-common.m4 serial 33 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -30,7 +30,7 @@ [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. - __APPLE__ && __MACH__ test for MacOS X. + __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ diff -Nru ttfautohint-0.9/gnulib/m4/gnulib-comp.m4 ttfautohint-0.94/gnulib/m4/gnulib-comp.m4 --- ttfautohint-0.9/gnulib/m4/gnulib-comp.m4 2012-06-06 05:22:01.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/gnulib-comp.m4 2012-11-29 07:21:55.000000000 +0000 @@ -42,19 +42,27 @@ # Code from module errno: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # Code from module fcntl-h: # Code from module getopt-gnu: # Code from module getopt-posix: # Code from module gettext-h: # Code from module git-version-gen: # Code from module havelib: # Code from module include_next: + # Code from module isatty: # Code from module lock: + # Code from module memchr: + # Code from module memmem-simple: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: # Code from module nocrash: # Code from module snippet/arg-nonnull: # Code from module snippet/c++defs: # Code from module snippet/warn-on-use: # Code from module ssize_t: # Code from module stddef: + # Code from module stdint: # Code from module strerror-override: # Code from module strerror_r-posix: # Code from module string: @@ -78,48 +86,76 @@ m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/src' -gl_HEADER_ERRNO_H -gl_FUNC_GETOPT_GNU -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) -gl_FUNC_GETOPT_POSIX -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -AC_SUBST([LIBINTL]) -AC_SUBST([LTLIBINTL]) -gl_LOCK -gt_TYPE_SSIZE_T -gl_STDDEF_H -AC_REQUIRE([gl_HEADER_ERRNO_H]) -AC_REQUIRE([gl_FUNC_STRERROR_0]) -if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then - AC_LIBOBJ([strerror-override]) - gl_PREREQ_SYS_H_WINSOCK2 -fi -gl_FUNC_STRERROR_R -if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then - AC_LIBOBJ([strerror_r]) - gl_PREREQ_STRERROR_R -fi -gl_STRING_MODULE_INDICATOR([strerror_r]) -gl_HEADER_STRING_H -gl_SYS_TYPES_H -AC_PROG_MKDIR_P -gl_THREADLIB -gl_UNISTD_H + gl_HEADER_ERRNO_H + gl_FCNTL_H + gl_FUNC_GETOPT_GNU + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_FUNC_ISATTY + if test $REPLACE_ISATTY = 1; then + AC_LIBOBJ([isatty]) + gl_PREREQ_ISATTY + fi + gl_UNISTD_MODULE_INDICATOR([isatty]) + gl_LOCK + gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi + gl_STRING_MODULE_INDICATOR([memchr]) + gl_FUNC_MEMMEM_SIMPLE + if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then + AC_LIBOBJ([memmem]) + fi + gl_STRING_MODULE_INDICATOR([memmem]) + gl_MSVC_INVAL + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + gl_MSVC_NOTHROW + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi + gl_MULTIARCH + gt_TYPE_SSIZE_T + gl_STDDEF_H + gl_STDINT_H + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_FUNC_STRERROR_R + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AC_LIBOBJ([strerror_r]) + gl_PREREQ_STRERROR_R + fi + gl_STRING_MODULE_INDICATOR([strerror_r]) + gl_HEADER_STRING_H + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_THREADLIB + gl_UNISTD_H # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -262,6 +298,7 @@ build-aux/snippet/c++defs.h build-aux/snippet/warn-on-use.h lib/errno.in.h + lib/fcntl.in.h lib/getopt.c lib/getopt.in.h lib/getopt1.c @@ -270,7 +307,17 @@ lib/glthread/lock.c lib/glthread/lock.h lib/glthread/threadlib.c + lib/isatty.c + lib/memchr.c + lib/memchr.valgrind + lib/memmem.c + lib/msvc-inval.c + lib/msvc-inval.h + lib/msvc-nothrow.c + lib/msvc-nothrow.h lib/stddef.in.h + lib/stdint.in.h + lib/str-two-way.h lib/strerror-override.c lib/strerror-override.h lib/strerror_r.c @@ -280,18 +327,29 @@ m4/00gnulib.m4 m4/errno_h.m4 m4/extensions.m4 + m4/fcntl-o.m4 + m4/fcntl_h.m4 m4/getopt.m4 m4/gnulib-common.m4 m4/include_next.m4 + m4/isatty.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/lock.m4 + m4/longlong.m4 + m4/memchr.m4 + m4/memmem.m4 + m4/mmap-anon.m4 + m4/msvc-inval.m4 + m4/msvc-nothrow.m4 + m4/multiarch.m4 m4/nocrash.m4 m4/off_t.m4 m4/onceonly.m4 m4/ssize_t.m4 m4/stddef_h.m4 + m4/stdint.m4 m4/strerror.m4 m4/strerror_r.m4 m4/string_h.m4 diff -Nru ttfautohint-0.9/gnulib/m4/isatty.m4 ttfautohint-0.94/gnulib/m4/isatty.m4 --- ttfautohint-0.9/gnulib/m4/isatty.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/isatty.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,21 @@ +# isatty.m4 serial 2 +dnl Copyright (C) 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ISATTY], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl On native Windows, the system's isatty(), defined as an alias of _isatty() + dnl in the "oldnames" library, returns true for the NUL device. + case $host_os in + mingw*) REPLACE_ISATTY=1 ;; + esac +]) + +# Prerequisites of lib/isatty.c. +AC_DEFUN([gl_PREREQ_ISATTY], [ + AC_REQUIRE([AC_C_INLINE]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/lib-ld.m4 ttfautohint-0.94/gnulib/m4/lib-ld.m4 --- ttfautohint-0.9/gnulib/m4/lib-ld.m4 2012-01-21 10:26:12.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/lib-ld.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,33 +1,39 @@ -# lib-ld.m4 serial 5 (gettext-0.18.2) +# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1; do + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -78,23 +85,26 @@ fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'long long int'.]) + fi +]) + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'unsigned long long int'.]) + fi +]) + +# Expands to a C program that can be used to test for simultaneous support +# of 'long long' and 'unsigned long long'. We don't want to say that +# 'long long' is available if 'unsigned long long' is not, or vice versa, +# because too many programs rely on the symmetry between signed and unsigned +# integer types (excluding 'bool'). +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], +[ + AC_LANG_PROGRAM( + [[/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/memchr.m4 ttfautohint-0.94/gnulib/m4/memchr.m4 --- ttfautohint-0.9/gnulib/m4/memchr.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/memchr.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,88 @@ +# memchr.m4 serial 12 +dnl Copyright (C) 2002-2004, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_FUNC_MEMCHR], +[ + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif +]], [[ + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; +]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], + [dnl Be pessimistic for now. + gl_cv_func_memchr_works="guessing no"])]) + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi +]) + +# Prerequisites of lib/memchr.c. +AC_DEFUN([gl_PREREQ_MEMCHR], [ + AC_CHECK_HEADERS([bp-sym.h]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/memmem.m4 ttfautohint-0.94/gnulib/m4/memmem.m4 --- ttfautohint-0.9/gnulib/m4/memmem.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/memmem.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,151 @@ +# memmem.m4 serial 24 +dnl Copyright (C) 2002-2004, 2007-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Check that memmem is present and functional. +AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], +[ + dnl Persuade glibc to declare memmem(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS([memmem]) + if test $ac_cv_func_memmem = yes; then + HAVE_MEMMEM=1 + else + HAVE_MEMMEM=0 + fi + AC_CHECK_DECLS_ONCE([memmem]) + if test $ac_cv_have_decl_memmem = no; then + HAVE_DECL_MEMMEM=0 + else + dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092. + dnl Also check that we handle empty needles correctly. + AC_CACHE_CHECK([whether memmem works], + [gl_cv_func_memmem_works_always], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include /* for memmem */ +#define P "_EF_BF_BD" +#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P +#define NEEDLE P P P P P +]], [[ + int result = 0; + if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) + result |= 1; + /* Check for empty needle behavior. */ + { + const char *haystack = "AAA"; + if (memmem (haystack, 3, NULL, 0) != haystack) + result |= 2; + } + return result; + ]])], + [gl_cv_func_memmem_works_always=yes], + [gl_cv_func_memmem_works_always=no], + [dnl glibc 2.9..2.12 and cygwin 1.7.7 have issue #12092 above. + dnl Also empty needles work on glibc >= 2.1 and cygwin >= 1.7.0. + dnl uClibc is not affected, since it uses different source code. + dnl Assume that it works on all other platforms (even if not linear). + AC_EGREP_CPP([Lucky user], + [ +#ifdef __GNU_LIBRARY__ + #include + #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ + || __GLIBC_MINOR__ > 12)) \ + || (__GLIBC__ > 2)) \ + || defined __UCLIBC__ + Lucky user + #endif +#elif defined __CYGWIN__ + #include + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + Lucky user + #endif +#else + Lucky user +#endif + ], + [gl_cv_func_memmem_works_always="guessing yes"], + [gl_cv_func_memmem_works_always="guessing no"]) + ]) + ]) + case "$gl_cv_func_memmem_works_always" in + *yes) ;; + *) + REPLACE_MEMMEM=1 + ;; + esac + fi + gl_PREREQ_MEMMEM +]) # gl_FUNC_MEMMEM_SIMPLE + +dnl Additionally, check that memmem has linear performance characteristics +AC_DEFUN([gl_FUNC_MEMMEM], +[ + AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE]) + if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then + AC_CACHE_CHECK([whether memmem works in linear time], + [gl_cv_func_memmem_works_fast], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include /* for signal */ +#include /* for memmem */ +#include /* for malloc */ +#include /* for alarm */ +static void quit (int sig) { exit (sig + 128); } +]], [[ + int result = 0; + size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 1); + char *needle = (char *) malloc (m + 1); + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack memmem. */ + signal (SIGALRM, quit); + alarm (5); + /* Check for quadratic performance. */ + if (haystack && needle) + { + memset (haystack, 'A', 2 * m); + haystack[2 * m] = 'B'; + memset (needle, 'A', m); + needle[m] = 'B'; + if (!memmem (haystack, 2 * m + 1, needle, m + 1)) + result |= 1; + } + return result; + ]])], + [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no], + [dnl Only glibc >= 2.9 and cygwin > 1.7.0 are known to have a + dnl memmem that works in linear time. + AC_EGREP_CPP([Lucky user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif +#ifdef __CYGWIN__ + #include + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0) + Lucky user + #endif +#endif + ], + [gl_cv_func_memmem_works_fast="guessing yes"], + [gl_cv_func_memmem_works_fast="guessing no"]) + ]) + ]) + case "$gl_cv_func_memmem_works_fast" in + *yes) ;; + *) + REPLACE_MEMMEM=1 + ;; + esac + fi +]) # gl_FUNC_MEMMEM + +# Prerequisites of lib/memmem.c. +AC_DEFUN([gl_PREREQ_MEMMEM], [:]) diff -Nru ttfautohint-0.9/gnulib/m4/mmap-anon.m4 ttfautohint-0.94/gnulib/m4/mmap-anon.m4 --- ttfautohint-0.9/gnulib/m4/mmap-anon.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/mmap-anon.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,55 @@ +# mmap-anon.m4 serial 10 +dnl Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Detect how mmap can be used to create anonymous (not file-backed) memory +# mappings. +# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS +# and MAP_ANON exist and have the same value. +# - On HP-UX, only MAP_ANONYMOUS exists. +# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. +# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be +# used. + +AC_DEFUN([gl_FUNC_MMAP_ANON], +[ + dnl Persuade glibc to define MAP_ANONYMOUS. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + AC_MSG_CHECKING([for MAP_ANONYMOUS]) + AC_EGREP_CPP([I cannot identify this map], [ +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif +], + [gl_have_mmap_anonymous=yes]) + if test $gl_have_mmap_anonymous != yes; then + AC_EGREP_CPP([I cannot identify this map], [ +#include +#ifdef MAP_ANON + I cannot identify this map +#endif +], + [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], + [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.]) + gl_have_mmap_anonymous=yes]) + fi + AC_MSG_RESULT([$gl_have_mmap_anonymous]) + if test $gl_have_mmap_anonymous = yes; then + AC_DEFINE([HAVE_MAP_ANONYMOUS], [1], + [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and .]) + fi + fi +]) diff -Nru ttfautohint-0.9/gnulib/m4/msvc-inval.m4 ttfautohint-0.94/gnulib/m4/msvc-inval.m4 --- ttfautohint-0.9/gnulib/m4/msvc-inval.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/msvc-inval.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,19 @@ +# msvc-inval.m4 serial 1 +dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MSVC_INVAL], +[ + AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler]) + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1], + [Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept.]) + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/msvc-nothrow.m4 ttfautohint-0.94/gnulib/m4/msvc-nothrow.m4 --- ttfautohint-0.9/gnulib/m4/msvc-nothrow.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/msvc-nothrow.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,10 @@ +# msvc-nothrow.m4 serial 1 +dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MSVC_NOTHROW], +[ + AC_REQUIRE([gl_MSVC_INVAL]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/multiarch.m4 ttfautohint-0.94/gnulib/m4/multiarch.m4 --- ttfautohint-0.9/gnulib/m4/multiarch.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/multiarch.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,62 @@ +# multiarch.m4 serial 7 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Determine whether the compiler is or may be producing universal binaries. +# +# On Mac OS X 10.5 and later systems, the user can create libraries and +# executables that work on multiple system types--known as "fat" or +# "universal" binaries--by specifying multiple '-arch' options to the +# compiler but only a single '-arch' option to the preprocessor. Like +# this: +# +# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CPP="gcc -E" CXXCPP="g++ -E" +# +# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly. + +AC_DEFUN_ONCE([gl_MULTIARCH], +[ + dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. + gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + AC_SUBST([APPLE_UNIVERSAL_BUILD]) +]) diff -Nru ttfautohint-0.9/gnulib/m4/nocrash.m4 ttfautohint-0.94/gnulib/m4/nocrash.m4 --- ttfautohint-0.9/gnulib/m4/nocrash.m4 2012-01-21 10:26:12.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/nocrash.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# nocrash.m4 serial 3 +# nocrash.m4 serial 4 dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,7 @@ AC_DEFUN([GL_NOCRASH],[[ #include #if defined __MACH__ && defined __APPLE__ -/* Avoid a crash on MacOS X. */ +/* Avoid a crash on Mac OS X. */ #include #include #include diff -Nru ttfautohint-0.9/gnulib/m4/stdint.m4 ttfautohint-0.94/gnulib/m4/stdint.m4 --- ttfautohint-0.9/gnulib/m4/stdint.m4 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/stdint.m4 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,484 @@ +# stdint.m4 serial 43 +dnl Copyright (C) 2001-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert and Bruno Haible. +dnl Test whether is supported or must be substituted. + +AC_DEFUN_ONCE([gl_STDINT_H], +[ + AC_PREREQ([2.59])dnl + + dnl Check for long long int and unsigned long long int. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_LONG_LONG_INT]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + + dnl Check for , in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + AC_SUBST([HAVE_INTTYPES_H]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + AC_SUBST([HAVE_SYS_TYPES_H]) + + gl_CHECK_NEXT_HEADERS([stdint.h]) + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + AC_SUBST([HAVE_STDINT_H]) + + dnl Now see whether we need a substitute . + if test $ac_cv_header_stdint_h = yes; then + AC_CACHE_CHECK([whether stdint.h conforms to C99], + [gl_cv_header_working_stdint_h], + [gl_cv_header_working_stdint_h=no + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif +] +gl_STDINT_INCLUDES +[ +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + ]])], + [dnl Determine whether the various *_MIN, *_MAX macros are usable + dnl in preprocessor expression. We could do it by compiling a test + dnl program for each of these macros. It is faster to run a program + dnl that inspects the macro expansion. + dnl This detects a bug on HP-UX 11.23/ia64. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +] +gl_STDINT_INCLUDES +[ +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; +]], [[ + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; +]])], + [gl_cv_header_working_stdint_h=yes], + [], + [dnl When cross-compiling, assume it works. + gl_cv_header_working_stdint_h=yes + ]) + ]) + ]) + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + dnl Check for , and for + dnl (used in Linux libc4 >= 4.6.7 and libc5). + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + AC_SUBST([HAVE_SYS_INTTYPES_H]) + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + AC_SUBST([HAVE_SYS_BITYPES_H]) + + gl_STDINT_TYPE_PROPERTIES + STDINT_H=stdint.h + fi + AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +]) + +dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) +dnl Determine the size of each of the given types in bits. +AC_DEFUN([gl_STDINT_BITSIZEOF], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to the number of bits in type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], + [$2 +#include ], [result=unknown]) + eval gl_cv_bitsizeof_${gltype}=\$result + ]) + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, + dnl do a syntax check even on unused #if conditions and give an error + dnl on valid C code like this: + dnl #if 0 + dnl # if > 32 + dnl # endif + dnl #endif + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) + eval BITSIZEOF_${GLTYPE}=\$result + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) +dnl Determine the signedness of each of the given types. +dnl Define HAVE_SIGNED_TYPE if type is signed. +AC_DEFUN([gl_CHECK_TYPES_SIGNED], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to 1 if ']gltype[' is a signed integer type.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], + result=yes, result=no) + eval gl_cv_type_${gltype}_signed=\$result + ]) + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) +dnl Determine the suffix to use for integer constants of the given types. +dnl Define t_SUFFIX for each such type. +AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], + [Define to l, ll, u, ul, ull, etc., as suitable for + constants of type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for $gltype integer literal suffix], + [gl_cv_type_${gltype}_suffix], + [eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + extern $gltype foo; + extern $gltype1 foo;]])], + [eval gl_cv_type_${gltype}_suffix=\$glsuf]) + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done]) + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) + done + m4_foreach_w([gltype], [$1], + [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) +]) + +dnl gl_STDINT_INCLUDES +AC_DEFUN([gl_STDINT_INCLUDES], +[[ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif +]]) + +dnl gl_STDINT_TYPE_PROPERTIES +dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t +dnl of interest to stdint.in.h. +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], +[ + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_STDINT_BITSIZEOF([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + + dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 + dnl requirement that wint_t is "unchanged by default argument promotions". + dnl In this case gnulib's and override wint_t. + dnl Set the variable BITSIZEOF_WINT_T accordingly. + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) + +# Hey Emacs! +# Local Variables: +# indent-tabs-mode: nil +# End: diff -Nru ttfautohint-0.9/gnulib/m4/strerror_r.m4 ttfautohint-0.94/gnulib/m4/strerror_r.m4 --- ttfautohint-0.9/gnulib/m4/strerror_r.m4 2012-01-21 10:26:12.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/strerror_r.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# strerror_r.m4 serial 14 +# strerror_r.m4 serial 15 dnl Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -76,7 +76,7 @@ dnl HP-UX 11.31 strerror_r always fails when the buffer length argument dnl is less than 80. dnl FreeBSD 8.s strerror_r claims failure on 0 - dnl MacOS X 10.5 strerror_r treats 0 like -1 + dnl Mac OS X 10.5 strerror_r treats 0 like -1 dnl Solaris 10 strerror_r corrupts errno on failure AC_CACHE_CHECK([whether strerror_r works], [gl_cv_func_strerror_r_works], diff -Nru ttfautohint-0.9/gnulib/m4/threadlib.m4 ttfautohint-0.94/gnulib/m4/threadlib.m4 --- ttfautohint-0.9/gnulib/m4/threadlib.m4 2012-01-21 10:26:12.000000000 +0000 +++ ttfautohint-0.94/gnulib/m4/threadlib.m4 2012-11-29 07:21:52.000000000 +0000 @@ -1,4 +1,4 @@ -# threadlib.m4 serial 9 (gettext-0.18.2) +# threadlib.m4 serial 10 (gettext-0.18.2) dnl Copyright (C) 2005-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -319,50 +319,50 @@ dnl Survey of platforms: dnl -dnl Platform Available Compiler Supports test-lock -dnl flavours option weak result -dnl --------------- --------- --------- -------- --------- -dnl Linux 2.4/glibc posix -lpthread Y OK +dnl Platform Available Compiler Supports test-lock +dnl flavours option weak result +dnl --------------- --------- --------- -------- --------- +dnl Linux 2.4/glibc posix -lpthread Y OK dnl -dnl GNU Hurd/glibc posix +dnl GNU Hurd/glibc posix dnl -dnl FreeBSD 5.3 posix -lc_r Y -dnl posix -lkse ? Y -dnl posix -lpthread ? Y -dnl posix -lthr Y +dnl FreeBSD 5.3 posix -lc_r Y +dnl posix -lkse ? Y +dnl posix -lpthread ? Y +dnl posix -lthr Y dnl -dnl FreeBSD 5.2 posix -lc_r Y -dnl posix -lkse Y -dnl posix -lthr Y +dnl FreeBSD 5.2 posix -lc_r Y +dnl posix -lkse Y +dnl posix -lthr Y dnl -dnl FreeBSD 4.0,4.10 posix -lc_r Y OK +dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl -dnl NetBSD 1.6 -- +dnl NetBSD 1.6 -- dnl -dnl OpenBSD 3.4 posix -lpthread Y OK +dnl OpenBSD 3.4 posix -lpthread Y OK dnl -dnl MacOS X 10.[123] posix -lpthread Y OK +dnl Mac OS X 10.[123] posix -lpthread Y OK dnl -dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK -dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK +dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK +dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl -dnl HP-UX 11 posix -lpthread N (cc) OK +dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl -dnl IRIX 6.5 posix -lpthread Y 0.5 +dnl IRIX 6.5 posix -lpthread Y 0.5 dnl -dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK +dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl -dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK +dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl -dnl Cygwin posix -lpthread Y OK +dnl Cygwin posix -lpthread Y OK dnl -dnl Any of the above pth -lpth 0.0 +dnl Any of the above pth -lpth 0.0 dnl -dnl Mingw windows N OK +dnl Mingw windows N OK dnl -dnl BeOS 5 -- +dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: diff -Nru ttfautohint-0.9/gnulib/missing ttfautohint-0.94/gnulib/missing --- ttfautohint-0.9/gnulib/missing 2012-01-21 10:26:35.000000000 +0000 +++ ttfautohint-0.94/gnulib/missing 2012-11-29 07:22:16.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.18; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -26,7 +25,7 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi @@ -34,7 +33,7 @@ sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' -# In the cases where this matters, `missing' is being run in the +# In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac @@ -65,7 +64,7 @@ echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: @@ -74,21 +73,20 @@ --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' + aclocal touch file 'aclocal.m4' + autoconf touch file 'configure' + autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c + automake touch all 'Makefile.in' files + bison create 'y.tab.[ch]', if possible, from existing .[ch] + flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c + lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + yacc create 'y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -100,8 +98,8 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: Unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; @@ -122,22 +120,13 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether + # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi @@ -149,27 +138,27 @@ case $program in aclocal*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from +WARNING: '$1' is $msg. You should only need it if + you modified 'acinclude.m4' or '${configure_ac}'. You might want + to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU +WARNING: '$1' is $msg. You should only need it if + you modified '${configure_ac}'. You might want to install the + Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them +WARNING: '$1' is $msg. You should only need it if + you modified 'acconfig.h' or '${configure_ac}'. You might want + to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" @@ -186,9 +175,9 @@ automake*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. +WARNING: '$1' is $msg. You should only need it if + you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. + You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | @@ -197,10 +186,10 @@ autom4te*) echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. +WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU + You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` @@ -220,13 +209,13 @@ bison*|yacc*) echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package +WARNING: '$1' $msg. You should only need it if + you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." + Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -250,13 +239,13 @@ lex*|flex*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package +WARNING: '$1' is $msg. You should only need it if + you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." + Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -273,10 +262,10 @@ help2man*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." + Help2man package in order for those modifications to take + effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -291,12 +280,12 @@ makeinfo*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file +WARNING: '$1' is $msg. You should only need it if + you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." + call might also be the consequence of using a buggy 'make' (AIX, + DU, IRIX). You might want to install the Texinfo package or + the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -318,49 +307,14 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. +WARNING: '$1' is needed, and is $msg. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, + proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." + some other package would contain this missing '$1' program." exit 1 ;; esac diff -Nru ttfautohint-0.9/gnulib/src/Makefile.am ttfautohint-0.94/gnulib/src/Makefile.am --- ttfautohint-0.9/gnulib/src/Makefile.am 2012-06-06 05:22:01.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/Makefile.am 2012-11-29 07:21:54.000000000 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl getopt-gnu git-version-gen strerror_r-posix +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl fcntl-h getopt-gnu git-version-gen isatty memmem-simple strerror_r-posix AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -86,6 +86,41 @@ ## end gnulib module errno +## begin gnulib module fcntl-h + +BUILT_SOURCES += fcntl.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += fcntl.h fcntl.h-t + +EXTRA_DIST += fcntl.in.h + +## end gnulib module fcntl-h + ## begin gnulib module getopt-posix BUILT_SOURCES += $(GETOPT_H) @@ -133,12 +168,57 @@ ## end gnulib module havelib +## begin gnulib module isatty + + +EXTRA_DIST += isatty.c + +EXTRA_libgnu_la_SOURCES += isatty.c + +## end gnulib module isatty + ## begin gnulib module lock libgnu_la_SOURCES += glthread/lock.h glthread/lock.c ## end gnulib module lock +## begin gnulib module memchr + + +EXTRA_DIST += memchr.c memchr.valgrind + +EXTRA_libgnu_la_SOURCES += memchr.c + +## end gnulib module memchr + +## begin gnulib module memmem-simple + + +EXTRA_DIST += memmem.c str-two-way.h + +EXTRA_libgnu_la_SOURCES += memmem.c + +## end gnulib module memmem-simple + +## begin gnulib module msvc-inval + + +EXTRA_DIST += msvc-inval.c msvc-inval.h + +EXTRA_libgnu_la_SOURCES += msvc-inval.c + +## end gnulib module msvc-inval + +## begin gnulib module msvc-nothrow + + +EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h + +EXTRA_libgnu_la_SOURCES += msvc-nothrow.c + +## end gnulib module msvc-nothrow + ## begin gnulib module snippet/arg-nonnull # The BUILT_SOURCES created by this Makefile snippet are not used via #include @@ -238,6 +318,56 @@ ## end gnulib module stddef +## begin gnulib module stdint + +BUILT_SOURCES += $(STDINT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDINT_H +stdint.h: stdint.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + < $(srcdir)/stdint.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdint.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdint.h stdint.h-t + +EXTRA_DIST += stdint.in.h + +## end gnulib module stdint + ## begin gnulib module strerror-override diff -Nru ttfautohint-0.9/gnulib/src/Makefile.in ttfautohint-0.94/gnulib/src/Makefile.in --- ttfautohint-0.9/gnulib/src/Makefile.in 2012-06-06 05:22:21.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/Makefile.in 2012-11-29 07:22:17.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.1 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -35,7 +35,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl getopt-gnu git-version-gen strerror_r-posix +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=gnulib/src --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=gnulib --no-conditional-dependencies --libtool --macro-prefix=gl fcntl-h getopt-gnu git-version-gen isatty memmem-simple strerror_r-posix @@ -84,24 +84,35 @@ $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ + $(top_srcdir)/gnulib/m4/fcntl-o.m4 \ + $(top_srcdir)/gnulib/m4/fcntl_h.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ + $(top_srcdir)/gnulib/m4/isatty.m4 \ $(top_srcdir)/gnulib/m4/lib-ld.m4 \ $(top_srcdir)/gnulib/m4/lib-link.m4 \ $(top_srcdir)/gnulib/m4/lib-prefix.m4 \ $(top_srcdir)/gnulib/m4/libtool.m4 \ $(top_srcdir)/gnulib/m4/lock.m4 \ + $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/ltoptions.m4 \ $(top_srcdir)/gnulib/m4/ltsugar.m4 \ $(top_srcdir)/gnulib/m4/ltversion.m4 \ $(top_srcdir)/gnulib/m4/lt~obsolete.m4 \ + $(top_srcdir)/gnulib/m4/memchr.m4 \ + $(top_srcdir)/gnulib/m4/memmem.m4 \ + $(top_srcdir)/gnulib/m4/mmap-anon.m4 \ + $(top_srcdir)/gnulib/m4/msvc-inval.m4 \ + $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gnulib/m4/multiarch.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ + $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/strerror_r.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ @@ -126,9 +137,22 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libgnu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/gnulib/depcomp am__depfiles_maybe = depfiles @@ -142,9 +166,7 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -152,9 +174,7 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_1 = SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES) DIST_SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -207,12 +227,18 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -244,6 +270,7 @@ FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GETOPT_H = @GETOPT_H@ +GHC = @GHC@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ @@ -255,6 +282,7 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ @@ -294,6 +322,9 @@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -355,6 +386,7 @@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ @@ -367,12 +399,16 @@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ @@ -382,7 +418,11 @@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ @@ -392,10 +432,15 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HELP2MAN = @HELP2MAN@ @@ -430,14 +475,18 @@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ @@ -459,6 +508,7 @@ PDFLATEX = @PDFLATEX@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QMAKE = @QMAKE@ QT_CFLAGS = @QT_CFLAGS@ QT_CPPFLAGS = @QT_CPPFLAGS@ @@ -478,6 +528,7 @@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ @@ -492,6 +543,8 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_READ = @REPLACE_READ@ @@ -519,14 +572,19 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ UIC = @UIC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -572,6 +630,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -590,15 +649,17 @@ noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = libgnu.la -EXTRA_DIST = errno.in.h getopt.c getopt.in.h getopt1.c getopt_int.h \ - $(top_srcdir)/gnulib/git-version-gen \ - $(top_srcdir)/gnulib/config.rpath \ +EXTRA_DIST = errno.in.h fcntl.in.h getopt.c getopt.in.h getopt1.c \ + getopt_int.h $(top_srcdir)/gnulib/git-version-gen \ + $(top_srcdir)/gnulib/config.rpath isatty.c memchr.c \ + memchr.valgrind memmem.c str-two-way.h msvc-inval.c \ + msvc-inval.h msvc-nothrow.c msvc-nothrow.h \ $(top_srcdir)/gnulib/snippet/arg-nonnull.h \ $(top_srcdir)/gnulib/snippet/c++defs.h \ $(top_srcdir)/gnulib/snippet/warn-on-use.h stddef.in.h \ - strerror-override.c strerror-override.h strerror_r.c \ - string.in.h sys_types.in.h $(top_srcdir)/gnulib/config.rpath \ - unistd.in.h + stdint.in.h strerror-override.c strerror-override.h \ + strerror_r.c string.in.h sys_types.in.h \ + $(top_srcdir)/gnulib/config.rpath unistd.in.h # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be @@ -609,13 +670,15 @@ # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. -BUILT_SOURCES = $(ERRNO_H) $(GETOPT_H) arg-nonnull.h c++defs.h \ - warn-on-use.h $(STDDEF_H) string.h sys/types.h unistd.h +BUILT_SOURCES = $(ERRNO_H) fcntl.h $(GETOPT_H) arg-nonnull.h c++defs.h \ + warn-on-use.h $(STDDEF_H) $(STDINT_H) string.h sys/types.h \ + unistd.h SUFFIXES = -MOSTLYCLEANFILES = core *.stackdump errno.h errno.h-t getopt.h \ - getopt.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ - warn-on-use.h warn-on-use.h-t stddef.h stddef.h-t string.h \ - string.h-t sys/types.h sys/types.h-t unistd.h unistd.h-t +MOSTLYCLEANFILES = core *.stackdump errno.h errno.h-t fcntl.h \ + fcntl.h-t getopt.h getopt.h-t arg-nonnull.h arg-nonnull.h-t \ + c++defs.h c++defs.h-t warn-on-use.h warn-on-use.h-t stddef.h \ + stddef.h-t stdint.h stdint.h-t string.h string.h-t sys/types.h \ + sys/types.h-t unistd.h unistd.h-t MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = @@ -626,7 +689,8 @@ glthread/threadlib.c libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) -EXTRA_libgnu_la_SOURCES = getopt.c getopt1.c strerror-override.c \ +EXTRA_libgnu_la_SOURCES = getopt.c getopt1.c isatty.c memchr.c \ + memmem.c msvc-inval.c msvc-nothrow.c strerror-override.c \ strerror_r.c libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LTLIBINTL) \ $(LTLIBTHREAD) @@ -697,16 +761,19 @@ mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f glthread/lock.$(OBJEXT) - -rm -f glthread/lock.lo - -rm -f glthread/threadlib.$(OBJEXT) - -rm -f glthread/threadlib.lo + -rm -f glthread/*.$(OBJEXT) + -rm -f glthread/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isatty.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/lock.Plo@am__quote@ @@ -749,7 +816,7 @@ # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. -$(RECURSIVE_TARGETS): +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -759,7 +826,11 @@ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -773,37 +844,6 @@ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ @@ -1109,6 +1149,32 @@ @GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status @GL_GENERATE_ERRNO_H_FALSE@ rm -f $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) @@ -1169,6 +1235,44 @@ @GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status @GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ +@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_FALSE@ rm -f $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) diff -Nru ttfautohint-0.9/gnulib/src/errno.in.h ttfautohint-0.94/gnulib/src/errno.in.h --- ttfautohint-0.9/gnulib/src/errno.in.h 2012-06-06 05:21:58.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/errno.in.h 2012-11-29 07:21:52.000000000 +0000 @@ -270,5 +270,10 @@ # define GNULIB_defined_ENOTRECOVERABLE 1 # endif +# ifndef EILSEQ +# define EILSEQ 2015 +# define GNULIB_defined_EILSEQ 1 +# endif + #endif /* _@GUARD_PREFIX@_ERRNO_H */ #endif /* _@GUARD_PREFIX@_ERRNO_H */ diff -Nru ttfautohint-0.9/gnulib/src/fcntl.in.h ttfautohint-0.94/gnulib/src/fcntl.in.h --- ttfautohint-0.9/gnulib/src/fcntl.in.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/fcntl.in.h 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,347 @@ +/* Like , but with non-working flags defined to 0. + + Copyright (C) 2006-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* written by Paul Eggert */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_fcntl_h +/* Special invocation convention. */ + +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ +#include +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +# include +#endif +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_FCNTL_H + +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ +#include +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +# include +#endif +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#ifndef _@GUARD_PREFIX@_FCNTL_H +#define _@GUARD_PREFIX@_FCNTL_H + +#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ +# include +#endif + +/* Native Windows platforms declare open(), creat() in . */ +#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Declare overridden functions. */ + +#if @GNULIB_FCNTL@ +# if @REPLACE_FCNTL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcntl +# define fcntl rpl_fcntl +# endif +_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); +_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); +# else +# if !@HAVE_FCNTL@ +_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIASWARN (fcntl); +#elif defined GNULIB_POSIXCHECK +# undef fcntl +# if HAVE_RAW_DECL_FCNTL +_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " + "use gnulib module fcntl for portability"); +# endif +#endif + +#if @GNULIB_OPEN@ +# if @REPLACE_OPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open rpl_open +# endif +_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); +# endif +/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a + default argument. _GL_CXXALIASWARN does not work in this case. */ +# if !defined __hpux +_GL_CXXALIASWARN (open); +# endif +#elif defined GNULIB_POSIXCHECK +# undef open +/* Assume open is always declared. */ +_GL_WARN_ON_USE (open, "open is not always POSIX compliant - " + "use gnulib module open for portability"); +#endif + +#if @GNULIB_OPENAT@ +# if @REPLACE_OPENAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef openat +# define openat rpl_openat +# endif +_GL_FUNCDECL_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# else +# if !@HAVE_OPENAT@ +_GL_FUNCDECL_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# endif +_GL_CXXALIASWARN (openat); +#elif defined GNULIB_POSIXCHECK +# undef openat +# if HAVE_RAW_DECL_OPENAT +_GL_WARN_ON_USE (openat, "openat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +/* Fix up the FD_* macros, only known to be missing on mingw. */ + +#ifndef FD_CLOEXEC +# define FD_CLOEXEC 1 +#endif + +/* Fix up the supported F_* macros. Intentionally leave other F_* + macros undefined. Only known to be missing on mingw. */ + +#ifndef F_DUPFD_CLOEXEC +# define F_DUPFD_CLOEXEC 0x40000000 +/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */ +# define GNULIB_defined_F_DUPFD_CLOEXEC 1 +#else +# define GNULIB_defined_F_DUPFD_CLOEXEC 0 +#endif + +#ifndef F_DUPFD +# define F_DUPFD 1 +#endif + +#ifndef F_GETFD +# define F_GETFD 2 +#endif + +/* Fix up the O_* macros. */ + +#if !defined O_DIRECT && defined O_DIRECTIO +/* Tru64 spells it 'O_DIRECTIO'. */ +# define O_DIRECT O_DIRECTIO +#endif + +#if !defined O_CLOEXEC && defined O_NOINHERIT +/* Mingw spells it 'O_NOINHERIT'. */ +# define O_CLOEXEC O_NOINHERIT +#endif + +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + +#ifndef O_DIRECT +# define O_DIRECT 0 +#endif + +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif + +#ifndef O_DSYNC +# define O_DSYNC 0 +#endif + +#ifndef O_EXEC +# define O_EXEC O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_IGNORE_CTTY +# define O_IGNORE_CTTY 0 +#endif + +#ifndef O_NDELAY +# define O_NDELAY 0 +#endif + +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif + +#ifndef O_NONBLOCK +# define O_NONBLOCK O_NDELAY +#endif + +/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero + value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY + or to 0 as fallback. */ +#if @GNULIB_NONBLOCKING@ +# if O_NONBLOCK +# define GNULIB_defined_O_NONBLOCK 0 +# else +# define GNULIB_defined_O_NONBLOCK 1 +# undef O_NONBLOCK +# define O_NONBLOCK 0x40000000 +# endif +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#ifndef O_NOLINK +# define O_NOLINK 0 +#endif + +#ifndef O_NOLINKS +# define O_NOLINKS 0 +#endif + +#ifndef O_NOTRANS +# define O_NOTRANS 0 +#endif + +#ifndef O_RSYNC +# define O_RSYNC 0 +#endif + +#ifndef O_SEARCH +# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_SYNC +# define O_SYNC 0 +#endif + +#ifndef O_TTY_INIT +# define O_TTY_INIT 0 +#endif + +#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +# undef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in fcntl.h */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +# define O_TEXT 0 +#endif + +/* Fix up the AT_* macros. */ + +/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its + value exceeds INT_MAX, so its use as an int doesn't conform to the + C standard, and GCC and Sun C complain in some cases. If the bug + is present, undef AT_FDCWD here, so it can be redefined below. */ +#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 +# undef AT_FDCWD +#endif + +/* Use the same bit pattern as Solaris 9, but with the proper + signedness. The bit pattern is important, in case this actually is + Solaris with the above workaround. */ +#ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +#endif + +/* Use the same values as Solaris 9. This shouldn't matter, but + there's no real reason to differ. */ +#ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 4096 +#endif + +#ifndef AT_REMOVEDIR +# define AT_REMOVEDIR 1 +#endif + +/* Solaris 9 lacks these two, so just pick unique values. */ +#ifndef AT_SYMLINK_FOLLOW +# define AT_SYMLINK_FOLLOW 2 +#endif + +#ifndef AT_EACCESS +# define AT_EACCESS 4 +#endif + + +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif diff -Nru ttfautohint-0.9/gnulib/src/gettext.h ttfautohint-0.94/gnulib/src/gettext.h --- ttfautohint-0.9/gnulib/src/gettext.h 2012-05-01 06:46:32.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/gettext.h 2012-11-29 07:21:52.000000000 +0000 @@ -183,9 +183,12 @@ #include -#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) +#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 +#else +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 +#endif #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include diff -Nru ttfautohint-0.9/gnulib/src/isatty.c ttfautohint-0.94/gnulib/src/isatty.c --- ttfautohint-0.9/gnulib/src/isatty.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/isatty.c 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* isatty() replacement. + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +#include + +/* Specification. */ +#include + +/* This replacement is enabled on native Windows. */ + +#include + +/* Get declarations of the Win32 API functions. */ +#define WIN32_LEAN_AND_MEAN +#include + +#include "msvc-inval.h" + +/* Get _get_osfhandle(). */ +#include "msvc-nothrow.h" + +/* Optimized test whether a HANDLE refers to a console. + See . */ +#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3) + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static inline int +_isatty_nothrow (int fd) +{ + int result; + + TRY_MSVC_INVAL + { + result = _isatty (fd); + } + CATCH_MSVC_INVAL + { + result = 0; + } + DONE_MSVC_INVAL; + + return result; +} +#else +# define _isatty_nothrow _isatty +#endif + +/* Determine whether FD refers to a console device. Return 1 if yes. + Return 0 and set errno if no. (ptsname_r relies on the errno value.) */ +int +isatty (int fd) +{ + HANDLE h = (HANDLE) _get_osfhandle (fd); + if (h == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return 0; + } + /* _isatty (fd) tests whether GetFileType of the handle is FILE_TYPE_CHAR. + But it does not set errno when it returns 0. */ + if (_isatty_nothrow (fd)) + { + if (IsConsoleHandle (h)) + return 1; + } + errno = ENOTTY; + return 0; +} diff -Nru ttfautohint-0.9/gnulib/src/memchr.c ttfautohint-0.94/gnulib/src/memchr.c --- ttfautohint-0.9/gnulib/src/memchr.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/memchr.c 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,172 @@ +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2012 + Free Software Foundation, Inc. + + Based on strlen implementation by Torbjorn Granlund (tege@sics.se), + with help from Dan Sahlin (dan@sics.se) and + commentary by Jim Blandy (jimb@ai.mit.edu); + adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), + and implemented by Roland McGrath (roland@ai.mit.edu). + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 . */ + +#ifndef _LIBC +# include +#endif + +#include + +#include + +#if defined _LIBC +# include +#else +# define reg_char char +#endif + +#include + +#if HAVE_BP_SYM_H || defined _LIBC +# include +#else +# define BP_SYM(sym) sym +#endif + +#undef __memchr +#ifdef _LIBC +# undef memchr +#endif + +#ifndef weak_alias +# define __memchr memchr +#endif + +/* Search no more than N bytes of S for C. */ +void * +__memchr (void const *s, int c_in, size_t n) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned reg_char c; + + c = (unsigned char) c_in; + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; + --n, ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c. We first use an xor + with repeated_c. This reduces the task to testing whether *any of the + four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + So, the test whether any byte in longword1 is zero is equivalent to + testing whether tmp is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c. On little-endian + machines, we could determine the first such byte without any further + memory accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. Choose code + that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) + { + if (*char_ptr == c) + return (void *) char_ptr; + } + + return NULL; +} +#ifdef weak_alias +weak_alias (__memchr, BP_SYM (memchr)) +#endif diff -Nru ttfautohint-0.9/gnulib/src/memchr.valgrind ttfautohint-0.94/gnulib/src/memchr.valgrind --- ttfautohint-0.9/gnulib/src/memchr.valgrind 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/memchr.valgrind 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,14 @@ +# Suppress a valgrind message about use of uninitialized memory in memchr(). +# POSIX states that when the character is found, memchr must not read extra +# bytes in an overestimated length (for example, where memchr is used to +# implement strnlen). However, we use a safe word read to provide a speedup. +{ + memchr-value4 + Memcheck:Value4 + fun:rpl_memchr +} +{ + memchr-value8 + Memcheck:Value8 + fun:rpl_memchr +} diff -Nru ttfautohint-0.9/gnulib/src/memmem.c ttfautohint-0.94/gnulib/src/memmem.c --- ttfautohint-0.9/gnulib/src/memmem.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/memmem.c 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,75 @@ +/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2012 Free Software + Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* This particular implementation was written by Eric Blake, 2008. */ + +#ifndef _LIBC +# include +#endif + +/* Specification of memmem. */ +#include + +#ifndef _LIBC +# define __builtin_expect(expr, val) (expr) +#endif + +#define RETURN_TYPE void * +#define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l)) +#include "str-two-way.h" + +/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK + if NEEDLE_LEN is 0, otherwise NULL if NEEDLE is not found in + HAYSTACK. */ +void * +memmem (const void *haystack_start, size_t haystack_len, + const void *needle_start, size_t needle_len) +{ + /* Abstract memory is considered to be an array of 'unsigned char' values, + not an array of 'char' values. See ISO C 99 section 6.2.6.1. */ + const unsigned char *haystack = (const unsigned char *) haystack_start; + const unsigned char *needle = (const unsigned char *) needle_start; + + if (needle_len == 0) + /* The first occurrence of the empty string is deemed to occur at + the beginning of the string. */ + return (void *) haystack; + + /* Sanity check, otherwise the loop might search through the whole + memory. */ + if (__builtin_expect (haystack_len < needle_len, 0)) + return NULL; + + /* Use optimizations in memchr when possible, to reduce the search + size of haystack using a linear algorithm with a smaller + coefficient. However, avoid memchr for long needles, since we + can often achieve sublinear performance. */ + if (needle_len < LONG_NEEDLE_THRESHOLD) + { + haystack = memchr (haystack, *needle, haystack_len); + if (!haystack || __builtin_expect (needle_len == 1, 0)) + return (void *) haystack; + haystack_len -= haystack - (const unsigned char *) haystack_start; + if (haystack_len < needle_len) + return NULL; + return two_way_short_needle (haystack, haystack_len, needle, needle_len); + } + else + return two_way_long_needle (haystack, haystack_len, needle, needle_len); +} + +#undef LONG_NEEDLE_THRESHOLD diff -Nru ttfautohint-0.9/gnulib/src/msvc-inval.c ttfautohint-0.94/gnulib/src/msvc-inval.c --- ttfautohint-0.9/gnulib/src/msvc-inval.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/msvc-inval.c 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,129 @@ +/* Invalid parameter handler for MSVC runtime libraries. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +#include + +/* Specification. */ +#include "msvc-inval.h" + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING) + +/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler + declaration. */ +# include + +# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + +static void cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ +} + +# else + +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include + +# if defined _MSC_VER + +static void cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ + RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL); +} + +# else + +/* An index to thread-local storage. */ +static DWORD tls_index; +static int tls_initialized /* = 0 */; + +/* Used as a fallback only. */ +static struct gl_msvc_inval_per_thread not_per_thread; + +struct gl_msvc_inval_per_thread * +gl_msvc_inval_current (void) +{ + if (!tls_initialized) + { + tls_index = TlsAlloc (); + tls_initialized = 1; + } + if (tls_index == TLS_OUT_OF_INDEXES) + /* TlsAlloc had failed. */ + return ¬_per_thread; + else + { + struct gl_msvc_inval_per_thread *pointer = + (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index); + if (pointer == NULL) + { + /* First call. Allocate a new 'struct gl_msvc_inval_per_thread'. */ + pointer = + (struct gl_msvc_inval_per_thread *) + malloc (sizeof (struct gl_msvc_inval_per_thread)); + if (pointer == NULL) + /* Could not allocate memory. Use the global storage. */ + pointer = ¬_per_thread; + TlsSetValue (tls_index, pointer); + } + return pointer; + } +} + +static void cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ + struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current (); + if (current->restart_valid) + longjmp (current->restart, 1); + else + /* An invalid parameter notification from outside the gnulib code. + Give the caller a chance to intervene. */ + RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL); +} + +# endif + +# endif + +static int gl_msvc_inval_initialized /* = 0 */; + +void +gl_msvc_inval_ensure_handler (void) +{ + if (gl_msvc_inval_initialized == 0) + { + _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler); + gl_msvc_inval_initialized = 1; + } +} + +#endif diff -Nru ttfautohint-0.9/gnulib/src/msvc-inval.h ttfautohint-0.94/gnulib/src/msvc-inval.h --- ttfautohint-0.9/gnulib/src/msvc-inval.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/msvc-inval.h 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,222 @@ +/* Invalid parameter handler for MSVC runtime libraries. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +#ifndef _MSVC_INVAL_H +#define _MSVC_INVAL_H + +/* With MSVC runtime libraries with the "invalid parameter handler" concept, + functions like fprintf(), dup2(), or close() crash when the caller passes + an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF) + instead. + This file defines macros that turn such an invalid parameter notification + into a non-local exit. An error code can then be produced at the target + of this exit. You can thus write code like + + TRY_MSVC_INVAL + { + + } + CATCH_MSVC_INVAL + { + + } + DONE_MSVC_INVAL; + + This entire block expands to a single statement. + + The handling of invalid parameters can be done in three ways: + + * The default way, which is reasonable for programs (not libraries): + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING]) + + * The way for libraries that make "hairy" calls (like close(-1), or + fclose(fp) where fileno(fp) is closed, or simply getdtablesize()): + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING]) + + * The way for libraries that make no "hairy" calls: + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING]) + */ + +#define DEFAULT_HANDLING 0 +#define HAIRY_LIBRARY_HANDLING 1 +#define SANE_LIBRARY_HANDLING 2 + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING) +/* A native Windows platform with the "invalid parameter handler" concept, + and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING. */ + +# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING +/* Default handling. */ + +# ifdef __cplusplus +extern "C" { +# endif + +/* Ensure that the invalid parameter handler in installed that just returns. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + gl_msvc_inval_ensure_handler (); \ + if (1) +# define CATCH_MSVC_INVAL \ + else +# define DONE_MSVC_INVAL \ + } \ + while (0) + +# else +/* Handling for hairy libraries. */ + +# include + +/* Gnulib can define its own status codes, as described in the page + "Raising Software Exceptions" on microsoft.com + . + Our status codes are composed of + - 0xE0000000, mandatory for all user-defined status codes, + - 0x474E550, a API identifier ("GNU"), + - 0, 1, 2, ..., used to distinguish different status codes from the + same API. */ +# define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0) + +# if defined _MSC_VER +/* A compiler that supports __try/__except, as described in the page + "try-except statement" on microsoft.com + . + With __try/__except, we can use the multithread-safe exception handling. */ + +# ifdef __cplusplus +extern "C" { +# endif + +/* Ensure that the invalid parameter handler in installed that raises a + software exception with code STATUS_GNULIB_INVALID_PARAMETER. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + gl_msvc_inval_ensure_handler (); \ + __try +# define CATCH_MSVC_INVAL \ + __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER \ + ? EXCEPTION_EXECUTE_HANDLER \ + : EXCEPTION_CONTINUE_SEARCH) +# define DONE_MSVC_INVAL \ + } \ + while (0) + +# else +/* Any compiler. + We can only use setjmp/longjmp. */ + +# include + +# ifdef __cplusplus +extern "C" { +# endif + +struct gl_msvc_inval_per_thread +{ + /* The restart that will resume execution at the code between + CATCH_MSVC_INVAL and DONE_MSVC_INVAL. It is enabled only between + TRY_MSVC_INVAL and CATCH_MSVC_INVAL. */ + jmp_buf restart; + + /* Tells whether the contents of restart is valid. */ + int restart_valid; +}; + +/* Ensure that the invalid parameter handler in installed that passes + control to the gl_msvc_inval_restart if it is valid, or raises a + software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +/* Return a pointer to the per-thread data for the current thread. */ +extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + struct gl_msvc_inval_per_thread *msvc_inval_current; \ + gl_msvc_inval_ensure_handler (); \ + msvc_inval_current = gl_msvc_inval_current (); \ + /* First, initialize gl_msvc_inval_restart. */ \ + if (setjmp (msvc_inval_current->restart) == 0) \ + { \ + /* Then, mark it as valid. */ \ + msvc_inval_current->restart_valid = 1; +# define CATCH_MSVC_INVAL \ + /* Execution completed. \ + Mark gl_msvc_inval_restart as invalid. */ \ + msvc_inval_current->restart_valid = 0; \ + } \ + else \ + { \ + /* Execution triggered an invalid parameter notification. \ + Mark gl_msvc_inval_restart as invalid. */ \ + msvc_inval_current->restart_valid = 0; +# define DONE_MSVC_INVAL \ + } \ + } \ + while (0) + +# endif + +# endif + +#else +/* A platform that does not need to the invalid parameter handler, + or when SANE_LIBRARY_HANDLING is desired. */ + +/* The braces here avoid GCC warnings like + "warning: suggest explicit braces to avoid ambiguous 'else'". */ +# define TRY_MSVC_INVAL \ + do \ + { \ + if (1) +# define CATCH_MSVC_INVAL \ + else +# define DONE_MSVC_INVAL \ + } \ + while (0) + +#endif + +#endif /* _MSVC_INVAL_H */ diff -Nru ttfautohint-0.9/gnulib/src/msvc-nothrow.c ttfautohint-0.94/gnulib/src/msvc-nothrow.c --- ttfautohint-0.9/gnulib/src/msvc-nothrow.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/msvc-nothrow.c 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* Wrappers that don't throw invalid parameter notifications + with MSVC runtime libraries. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +#include + +/* Specification. */ +#include "msvc-nothrow.h" + +/* Get declarations of the native Windows API functions. */ +#define WIN32_LEAN_AND_MEAN +#include + +#include "msvc-inval.h" + +#undef _get_osfhandle + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +intptr_t +_gl_nothrow_get_osfhandle (int fd) +{ + intptr_t result; + + TRY_MSVC_INVAL + { + result = _get_osfhandle (fd); + } + CATCH_MSVC_INVAL + { + result = (intptr_t) INVALID_HANDLE_VALUE; + } + DONE_MSVC_INVAL; + + return result; +} +#endif diff -Nru ttfautohint-0.9/gnulib/src/msvc-nothrow.h ttfautohint-0.94/gnulib/src/msvc-nothrow.h --- ttfautohint-0.9/gnulib/src/msvc-nothrow.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/msvc-nothrow.h 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* Wrappers that don't throw invalid parameter notifications + with MSVC runtime libraries. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +#ifndef _MSVC_NOTHROW_H +#define _MSVC_NOTHROW_H + +/* With MSVC runtime libraries with the "invalid parameter handler" concept, + functions like fprintf(), dup2(), or close() crash when the caller passes + an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF) + instead. + This file defines wrappers that turn such an invalid parameter notification + into an error code. */ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* Get original declaration of _get_osfhandle. */ +# include + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER + +/* Override _get_osfhandle. */ +extern intptr_t _gl_nothrow_get_osfhandle (int fd); +# define _get_osfhandle _gl_nothrow_get_osfhandle + +# endif + +#endif + +#endif /* _MSVC_NOTHROW_H */ diff -Nru ttfautohint-0.9/gnulib/src/stdint.in.h ttfautohint-0.94/gnulib/src/stdint.in.h --- ttfautohint-0.9/gnulib/src/stdint.in.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/stdint.in.h 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,636 @@ +/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc. + Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. + This file is part of gnulib. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* + * ISO C 99 for platforms that lack it. + * + */ + +#ifndef _@GUARD_PREFIX@_STDINT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* When including a system file that in turn includes , + use the system , not our substitute. This avoids + problems with (for example) VMS, whose includes + . */ +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* On Android (Bionic libc), includes this file before + having defined 'time_t'. Therefore in this case avoid including + other system header files; just include the system's . + Ideally we should test __BIONIC__ here, but it is only defined after + has been included; hence test __ANDROID__ instead. */ +#if defined __ANDROID__ \ + && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_ +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#else + +/* Get those types that are already defined in other system include + files, so that we can "#define int8_t signed char" below without + worrying about a later system include file containing a "typedef + signed char int8_t;" that will get messed up by our macro. Our + macros should all be consistent with the system versions, except + for the "fast" types and macros, which we recommend against using + in public interfaces due to compiler differences. */ + +#if @HAVE_STDINT_H@ +# if defined __sgi && ! defined __c99 + /* Bypass IRIX's if in C89 mode, since it merely annoys users + with "This header file is to be used only for c99 mode compilations" + diagnostics. */ +# define __STDINT_H__ +# endif + + /* Some pre-C++11 implementations need this. */ +# ifdef __cplusplus +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 +# endif +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +# endif +# endif + + /* Other systems may have an incomplete or buggy . + Include it before , since any "#include " + in would reinclude us, skipping our contents because + _@GUARD_PREFIX@_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#endif + +#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _@GUARD_PREFIX@_STDINT_H + +/* defines some of the stdint.h types as well, on glibc, + IRIX 6.5, and OpenBSD 3.8 (via ). + AIX 5.2 isn't needed and causes troubles. + Mac OS X 10.4.6 includes (which is us), but + relies on the system definitions, so include + after @NEXT_STDINT_H@. */ +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include +#endif + +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX. */ +#include + +#if @HAVE_INTTYPES_H@ + /* In OpenBSD 3.8, includes , which defines + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. + also defines intptr_t and uintptr_t. */ +# include +#elif @HAVE_SYS_INTTYPES_H@ + /* Solaris 7 has the types except the *_fast*_t types, and + the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ +# include +#endif + +#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ + /* Linux libc4 >= 4.6.7 and libc5 have a that defines + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is + included by . */ +# include +#endif + +#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* Minimum and maximum values for an integer type under the usual assumption. + Return an unspecified value if BITS == 0, adding a check to pacify + picky compilers. */ + +#define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) + +#define _STDINT_MAX(signed, bits, zero) \ + ((signed) \ + ? ~ _STDINT_MIN (signed, bits, zero) \ + : /* The expression for the unsigned case. The subtraction of (signed) \ + is a nop in the unsigned case and avoids "signed integer overflow" \ + warnings in the signed case. */ \ + ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) + +#if !GNULIB_defined_stdint_types + +/* 7.18.1.1. Exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef int8_t +#undef uint8_t +typedef signed char gl_int8_t; +typedef unsigned char gl_uint8_t; +#define int8_t gl_int8_t +#define uint8_t gl_uint8_t + +#undef int16_t +#undef uint16_t +typedef short int gl_int16_t; +typedef unsigned short int gl_uint16_t; +#define int16_t gl_int16_t +#define uint16_t gl_uint16_t + +#undef int32_t +#undef uint32_t +typedef int gl_int32_t; +typedef unsigned int gl_uint32_t; +#define int32_t gl_int32_t +#define uint32_t gl_uint32_t + +/* If the system defines INT64_MAX, assume int64_t works. That way, + if the underlying platform defines int64_t to be a 64-bit long long + int, the code below won't mistakenly define it to be a 64-bit long + int, which would mess up C++ name mangling. We must use #ifdef + rather than #if, to avoid an error with HP-UX 10.20 cc. */ + +#ifdef INT64_MAX +# define GL_INT64_T +#else +/* Do not undefine int64_t if gnulib is not being used with 64-bit + types, since otherwise it breaks platforms like Tandem/NSK. */ +# if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t +typedef long int gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# elif defined _MSC_VER +# undef int64_t +typedef __int64 gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# elif @HAVE_LONG_LONG_INT@ +# undef int64_t +typedef long long int gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# endif +#endif + +#ifdef UINT64_MAX +# define GL_UINT64_T +#else +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif defined _MSC_VER +# undef uint64_t +typedef unsigned __int64 gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t +typedef unsigned long long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# endif +#endif + +/* Avoid collision with Solaris 2.5.1 etc. */ +#define _UINT8_T +#define _UINT32_T +#define _UINT64_T + + +/* 7.18.1.2. Minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef int_least8_t +#undef uint_least8_t +#undef int_least16_t +#undef uint_least16_t +#undef int_least32_t +#undef uint_least32_t +#undef int_least64_t +#undef uint_least64_t +#define int_least8_t int8_t +#define uint_least8_t uint8_t +#define int_least16_t int16_t +#define uint_least16_t uint16_t +#define int_least32_t int32_t +#define uint_least32_t uint32_t +#ifdef GL_INT64_T +# define int_least64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_least64_t uint64_t +#endif + +/* 7.18.1.3. Fastest minimum-width integer types */ + +/* Note: Other substitutes may define these types differently. + It is not recommended to use these types in public header files. */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. The following code normally + uses types consistent with glibc, as that lessens the chance of + incompatibility with older GNU hosts. */ + +#undef int_fast8_t +#undef uint_fast8_t +#undef int_fast16_t +#undef uint_fast16_t +#undef int_fast32_t +#undef uint_fast32_t +#undef int_fast64_t +#undef uint_fast64_t +typedef signed char gl_int_fast8_t; +typedef unsigned char gl_uint_fast8_t; + +#ifdef __sun +/* Define types compatible with SunOS 5.10, so that code compiled under + earlier SunOS versions works with code compiled under SunOS 5.10. */ +typedef int gl_int_fast32_t; +typedef unsigned int gl_uint_fast32_t; +#else +typedef long int gl_int_fast32_t; +typedef unsigned long int gl_uint_fast32_t; +#endif +typedef gl_int_fast32_t gl_int_fast16_t; +typedef gl_uint_fast32_t gl_uint_fast16_t; + +#define int_fast8_t gl_int_fast8_t +#define uint_fast8_t gl_uint_fast8_t +#define int_fast16_t gl_int_fast16_t +#define uint_fast16_t gl_uint_fast16_t +#define int_fast32_t gl_int_fast32_t +#define uint_fast32_t gl_uint_fast32_t +#ifdef GL_INT64_T +# define int_fast64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +#endif + +/* 7.18.1.4. Integer types capable of holding object pointers */ + +#undef intptr_t +#undef uintptr_t +typedef long int gl_intptr_t; +typedef unsigned long int gl_uintptr_t; +#define intptr_t gl_intptr_t +#define uintptr_t gl_uintptr_t + +/* 7.18.1.5. Greatest-width integer types */ + +/* Note: These types are compiler dependent. It may be unwise to use them in + public header files. */ + +/* If the system defines INTMAX_MAX, assume that intmax_t works, and + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with + assuming one type where another is used by the system. */ + +#ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +typedef long long int gl_intmax_t; +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else +typedef long int gl_intmax_t; +# define intmax_t gl_intmax_t +# endif +#endif + +#ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +typedef unsigned long long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else +typedef unsigned long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t +# endif +#endif + +/* Verify that intmax_t and uintmax_t have the same size. Too much code + breaks if this is not the case. If this check fails, the reason is likely + to be found in the autoconf macros. */ +typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) + ? 1 : -1]; + +#define GNULIB_defined_stdint_types 1 +#endif /* !GNULIB_defined_stdint_types */ + +/* 7.18.2. Limits of specified-width integer types */ + +/* 7.18.2.1. Limits of exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef INT8_MIN +#undef INT8_MAX +#undef UINT8_MAX +#define INT8_MIN (~ INT8_MAX) +#define INT8_MAX 127 +#define UINT8_MAX 255 + +#undef INT16_MIN +#undef INT16_MAX +#undef UINT16_MAX +#define INT16_MIN (~ INT16_MAX) +#define INT16_MAX 32767 +#define UINT16_MAX 65535 + +#undef INT32_MIN +#undef INT32_MAX +#undef UINT32_MAX +#define INT32_MIN (~ INT32_MAX) +#define INT32_MAX 2147483647 +#define UINT32_MAX 4294967295U + +#if defined GL_INT64_T && ! defined INT64_MAX +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 + evaluates the latter incorrectly in preprocessor expressions. */ +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +#endif + +#if defined GL_UINT64_T && ! defined UINT64_MAX +# define UINT64_MAX UINTMAX_C (18446744073709551615) +#endif + +/* 7.18.2.2. Limits of minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef INT_LEAST8_MIN +#undef INT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define UINT_LEAST8_MAX UINT8_MAX + +#undef INT_LEAST16_MIN +#undef INT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define UINT_LEAST16_MAX UINT16_MAX + +#undef INT_LEAST32_MIN +#undef INT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define UINT_LEAST32_MAX UINT32_MAX + +#undef INT_LEAST64_MIN +#undef INT_LEAST64_MAX +#ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +#endif + +#undef UINT_LEAST64_MAX +#ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.3. Limits of fastest minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. */ + +#undef INT_FAST8_MIN +#undef INT_FAST8_MAX +#undef UINT_FAST8_MAX +#define INT_FAST8_MIN SCHAR_MIN +#define INT_FAST8_MAX SCHAR_MAX +#define UINT_FAST8_MAX UCHAR_MAX + +#undef INT_FAST16_MIN +#undef INT_FAST16_MAX +#undef UINT_FAST16_MAX +#define INT_FAST16_MIN INT_FAST32_MIN +#define INT_FAST16_MAX INT_FAST32_MAX +#define UINT_FAST16_MAX UINT_FAST32_MAX + +#undef INT_FAST32_MIN +#undef INT_FAST32_MAX +#undef UINT_FAST32_MAX +#ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +#else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +#endif + +#undef INT_FAST64_MIN +#undef INT_FAST64_MAX +#ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +#endif + +#undef UINT_FAST64_MAX +#ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.4. Limits of integer types capable of holding object pointers */ + +#undef INTPTR_MIN +#undef INTPTR_MAX +#undef UINTPTR_MAX +#define INTPTR_MIN LONG_MIN +#define INTPTR_MAX LONG_MAX +#define UINTPTR_MAX ULONG_MAX + +/* 7.18.2.5. Limits of greatest-width integer types */ + +#ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif +#endif + +#ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif +#endif + +/* 7.18.3. Limits of other integer types */ + +/* ptrdiff_t limits */ +#undef PTRDIFF_MIN +#undef PTRDIFF_MAX +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif +#else +# define PTRDIFF_MIN \ + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +# define PTRDIFF_MAX \ + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#endif + +/* sig_atomic_t limits */ +#undef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MAX +#define SIG_ATOMIC_MIN \ + _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) +#define SIG_ATOMIC_MAX \ + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) + + +/* size_t limit */ +#undef SIZE_MAX +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif +#else +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#endif + +/* wchar_t limits */ +/* Get WCHAR_MIN, WCHAR_MAX. + This include is not on the top, above, because on OSF/1 4.0 we have a + sequence of nested includes + -> -> -> , and the latter includes + and assumes its types are already defined. */ +#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ +# include +# include +# include +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +#endif +#undef WCHAR_MIN +#undef WCHAR_MAX +#define WCHAR_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) +#define WCHAR_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) + +/* wint_t limits */ +#undef WINT_MIN +#undef WINT_MAX +#define WINT_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +#define WINT_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) + +/* 7.18.4. Macros for integer constants */ + +/* 7.18.4.1. Macros for minimum-width integer constants */ +/* According to ISO C 99 Technical Corrigendum 1 */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ + +#undef INT8_C +#undef UINT8_C +#define INT8_C(x) x +#define UINT8_C(x) x + +#undef INT16_C +#undef UINT16_C +#define INT16_C(x) x +#define UINT16_C(x) x + +#undef INT32_C +#undef UINT32_C +#define INT32_C(x) x +#define UINT32_C(x) x ## U + +#undef INT64_C +#undef UINT64_C +#if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +#elif defined _MSC_VER +# define INT64_C(x) x##i64 +#elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +#endif +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +#elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +#endif + +/* 7.18.4.2. Macros for greatest-width integer constants */ + +#ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif +#endif + +#ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif +#endif + +#endif /* _@GUARD_PREFIX@_STDINT_H */ +#endif /* !(defined __ANDROID__ && ...) */ +#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff -Nru ttfautohint-0.9/gnulib/src/str-two-way.h ttfautohint-0.94/gnulib/src/str-two-way.h --- ttfautohint-0.9/gnulib/src/str-two-way.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/str-two-way.h 2012-11-29 07:21:52.000000000 +0000 @@ -0,0 +1,452 @@ +/* Byte-wise substring search, using the Two-Way algorithm. + Copyright (C) 2008-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Eric Blake , 2008. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Before including this file, you need to include and + , and define: + RESULT_TYPE A macro that expands to the return type. + AVAILABLE(h, h_l, j, n_l) + A macro that returns nonzero if there are + at least N_L bytes left starting at H[J]. + H is 'unsigned char *', H_L, J, and N_L + are 'size_t'; H_L is an lvalue. For + NUL-terminated searches, H_L can be + modified each iteration to avoid having + to compute the end of H up front. + + For case-insensitivity, you may optionally define: + CMP_FUNC(p1, p2, l) A macro that returns 0 iff the first L + characters of P1 and P2 are equal. + CANON_ELEMENT(c) A macro that canonicalizes an element right after + it has been fetched from one of the two strings. + The argument is an 'unsigned char'; the result + must be an 'unsigned char' as well. + + This file undefines the macros documented above, and defines + LONG_NEEDLE_THRESHOLD. +*/ + +#include +#include + +/* We use the Two-Way string matching algorithm (also known as + Chrochemore-Perrin), which guarantees linear complexity with + constant space. Additionally, for long needles, we also use a bad + character shift table similar to the Boyer-Moore algorithm to + achieve improved (potentially sub-linear) performance. + + See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260, + http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm, + http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf +*/ + +/* Point at which computing a bad-byte shift table is likely to be + worthwhile. Small needles should not compute a table, since it + adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a + speedup no greater than a factor of NEEDLE_LEN. The larger the + needle, the better the potential performance gain. On the other + hand, on non-POSIX systems with CHAR_BIT larger than eight, the + memory required for the table is prohibitive. */ +#if CHAR_BIT < 10 +# define LONG_NEEDLE_THRESHOLD 32U +#else +# define LONG_NEEDLE_THRESHOLD SIZE_MAX +#endif + +#ifndef MAX +# define MAX(a, b) ((a < b) ? (b) : (a)) +#endif + +#ifndef CANON_ELEMENT +# define CANON_ELEMENT(c) c +#endif +#ifndef CMP_FUNC +# define CMP_FUNC memcmp +#endif + +/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN. + Return the index of the first byte in the right half, and set + *PERIOD to the global period of the right half. + + The global period of a string is the smallest index (possibly its + length) at which all remaining bytes in the string are repetitions + of the prefix (the last repetition may be a subset of the prefix). + + When NEEDLE is factored into two halves, a local period is the + length of the smallest word that shares a suffix with the left half + and shares a prefix with the right half. All factorizations of a + non-empty NEEDLE have a local period of at least 1 and no greater + than NEEDLE_LEN. + + A critical factorization has the property that the local period + equals the global period. All strings have at least one critical + factorization with the left half smaller than the global period. + And while some strings have more than one critical factorization, + it is provable that with an ordered alphabet, at least one of the + critical factorizations corresponds to a maximal suffix. + + Given an ordered alphabet, a critical factorization can be computed + in linear time, with 2 * NEEDLE_LEN comparisons, by computing the + shorter of two ordered maximal suffixes. The ordered maximal + suffixes are determined by lexicographic comparison while tracking + periodicity. */ +static size_t +critical_factorization (const unsigned char *needle, size_t needle_len, + size_t *period) +{ + /* Index of last byte of left half, or SIZE_MAX. */ + size_t max_suffix, max_suffix_rev; + size_t j; /* Index into NEEDLE for current candidate suffix. */ + size_t k; /* Offset into current period. */ + size_t p; /* Intermediate period. */ + unsigned char a, b; /* Current comparison bytes. */ + + /* Special case NEEDLE_LEN of 1 or 2 (all callers already filtered + out 0-length needles. */ + if (needle_len < 3) + { + *period = 1; + return needle_len - 1; + } + + /* Invariants: + 0 <= j < NEEDLE_LEN - 1 + -1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed) + min(max_suffix, max_suffix_rev) < global period of NEEDLE + 1 <= p <= global period of NEEDLE + p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j] + 1 <= k <= p + */ + + /* Perform lexicographic search. */ + max_suffix = SIZE_MAX; + j = 0; + k = p = 1; + while (j + k < needle_len) + { + a = CANON_ELEMENT (needle[j + k]); + b = CANON_ELEMENT (needle[max_suffix + k]); + if (a < b) + { + /* Suffix is smaller, period is entire prefix so far. */ + j += k; + k = 1; + p = j - max_suffix; + } + else if (a == b) + { + /* Advance through repetition of the current period. */ + if (k != p) + ++k; + else + { + j += p; + k = 1; + } + } + else /* b < a */ + { + /* Suffix is larger, start over from current location. */ + max_suffix = j++; + k = p = 1; + } + } + *period = p; + + /* Perform reverse lexicographic search. */ + max_suffix_rev = SIZE_MAX; + j = 0; + k = p = 1; + while (j + k < needle_len) + { + a = CANON_ELEMENT (needle[j + k]); + b = CANON_ELEMENT (needle[max_suffix_rev + k]); + if (b < a) + { + /* Suffix is smaller, period is entire prefix so far. */ + j += k; + k = 1; + p = j - max_suffix_rev; + } + else if (a == b) + { + /* Advance through repetition of the current period. */ + if (k != p) + ++k; + else + { + j += p; + k = 1; + } + } + else /* a < b */ + { + /* Suffix is larger, start over from current location. */ + max_suffix_rev = j++; + k = p = 1; + } + } + + /* Choose the shorter suffix. Return the index of the first byte of + the right half, rather than the last byte of the left half. + + For some examples, 'banana' has two critical factorizations, both + exposed by the two lexicographic extreme suffixes of 'anana' and + 'nana', where both suffixes have a period of 2. On the other + hand, with 'aab' and 'bba', both strings have a single critical + factorization of the last byte, with the suffix having a period + of 1. While the maximal lexicographic suffix of 'aab' is 'b', + the maximal lexicographic suffix of 'bba' is 'ba', which is not a + critical factorization. Conversely, the maximal reverse + lexicographic suffix of 'a' works for 'bba', but not 'ab' for + 'aab'. The shorter suffix of the two will always be a critical + factorization. */ + if (max_suffix_rev + 1 < max_suffix + 1) + return max_suffix + 1; + *period = p; + return max_suffix_rev + 1; +} + +/* Return the first location of non-empty NEEDLE within HAYSTACK, or + NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This + method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD. + Performance is guaranteed to be linear, with an initialization cost + of 2 * NEEDLE_LEN comparisons. + + If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at + most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. + If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * + HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */ +static RETURN_TYPE +two_way_short_needle (const unsigned char *haystack, size_t haystack_len, + const unsigned char *needle, size_t needle_len) +{ + size_t i; /* Index into current byte of NEEDLE. */ + size_t j; /* Index into current window of HAYSTACK. */ + size_t period; /* The period of the right half of needle. */ + size_t suffix; /* The index of the right half of needle. */ + + /* Factor the needle into two halves, such that the left half is + smaller than the global period, and the right half is + periodic (with a period as large as NEEDLE_LEN - suffix). */ + suffix = critical_factorization (needle, needle_len, &period); + + /* Perform the search. Each iteration compares the right half + first. */ + if (CMP_FUNC (needle, needle + period, suffix) == 0) + { + /* Entire needle is periodic; a mismatch in the left half can + only advance by the period, so use memory to avoid rescanning + known occurrences of the period in the right half. */ + size_t memory = 0; + j = 0; + while (AVAILABLE (haystack, haystack_len, j, needle_len)) + { + /* Scan for matches in right half. */ + i = MAX (suffix, memory); + while (i < needle_len && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (memory < i + 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i + 1 < memory + 1) + return (RETURN_TYPE) (haystack + j); + /* No match, so remember how many repetitions of period + on the right half were scanned. */ + j += period; + memory = needle_len - period; + } + else + { + j += i - suffix + 1; + memory = 0; + } + } + } + else + { + /* The two halves of needle are distinct; no extra memory is + required, and any mismatch results in a maximal shift. */ + period = MAX (suffix, needle_len - suffix) + 1; + j = 0; + while (AVAILABLE (haystack, haystack_len, j, needle_len)) + { + /* Scan for matches in right half. */ + i = suffix; + while (i < needle_len && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (i != SIZE_MAX && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i == SIZE_MAX) + return (RETURN_TYPE) (haystack + j); + j += period; + } + else + j += i - suffix + 1; + } + } + return NULL; +} + +/* Return the first location of non-empty NEEDLE within HAYSTACK, or + NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This + method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN. + Performance is guaranteed to be linear, with an initialization cost + of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations. + + If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at + most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, + and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible. + If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * + HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and + sublinear performance is not possible. */ +static RETURN_TYPE +two_way_long_needle (const unsigned char *haystack, size_t haystack_len, + const unsigned char *needle, size_t needle_len) +{ + size_t i; /* Index into current byte of NEEDLE. */ + size_t j; /* Index into current window of HAYSTACK. */ + size_t period; /* The period of the right half of needle. */ + size_t suffix; /* The index of the right half of needle. */ + size_t shift_table[1U << CHAR_BIT]; /* See below. */ + + /* Factor the needle into two halves, such that the left half is + smaller than the global period, and the right half is + periodic (with a period as large as NEEDLE_LEN - suffix). */ + suffix = critical_factorization (needle, needle_len, &period); + + /* Populate shift_table. For each possible byte value c, + shift_table[c] is the distance from the last occurrence of c to + the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE. + shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */ + for (i = 0; i < 1U << CHAR_BIT; i++) + shift_table[i] = needle_len; + for (i = 0; i < needle_len; i++) + shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1; + + /* Perform the search. Each iteration compares the right half + first. */ + if (CMP_FUNC (needle, needle + period, suffix) == 0) + { + /* Entire needle is periodic; a mismatch in the left half can + only advance by the period, so use memory to avoid rescanning + known occurrences of the period in the right half. */ + size_t memory = 0; + size_t shift; + j = 0; + while (AVAILABLE (haystack, haystack_len, j, needle_len)) + { + /* Check the last byte first; if it does not match, then + shift to the next possible match location. */ + shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; + if (0 < shift) + { + if (memory && shift < period) + { + /* Since needle is periodic, but the last period has + a byte out of place, there can be no match until + after the mismatch. */ + shift = needle_len - period; + } + memory = 0; + j += shift; + continue; + } + /* Scan for matches in right half. The last byte has + already been matched, by virtue of the shift table. */ + i = MAX (suffix, memory); + while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len - 1 <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (memory < i + 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i + 1 < memory + 1) + return (RETURN_TYPE) (haystack + j); + /* No match, so remember how many repetitions of period + on the right half were scanned. */ + j += period; + memory = needle_len - period; + } + else + { + j += i - suffix + 1; + memory = 0; + } + } + } + else + { + /* The two halves of needle are distinct; no extra memory is + required, and any mismatch results in a maximal shift. */ + size_t shift; + period = MAX (suffix, needle_len - suffix) + 1; + j = 0; + while (AVAILABLE (haystack, haystack_len, j, needle_len)) + { + /* Check the last byte first; if it does not match, then + shift to the next possible match location. */ + shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; + if (0 < shift) + { + j += shift; + continue; + } + /* Scan for matches in right half. The last byte has + already been matched, by virtue of the shift table. */ + i = suffix; + while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len - 1 <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (i != SIZE_MAX && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i == SIZE_MAX) + return (RETURN_TYPE) (haystack + j); + j += period; + } + else + j += i - suffix + 1; + } + } + return NULL; +} + +#undef AVAILABLE +#undef CANON_ELEMENT +#undef CMP_FUNC +#undef MAX +#undef RETURN_TYPE diff -Nru ttfautohint-0.9/gnulib/src/strerror-override.c ttfautohint-0.94/gnulib/src/strerror-override.c --- ttfautohint-0.9/gnulib/src/strerror-override.c 2012-06-06 05:21:59.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/strerror-override.c 2012-11-29 07:21:52.000000000 +0000 @@ -291,6 +291,11 @@ return "State not recoverable"; #endif +#if GNULIB_defined_EILSEQ + case EILSEQ: + return "Invalid or incomplete multibyte or wide character"; +#endif + default: return NULL; } diff -Nru ttfautohint-0.9/gnulib/src/strerror-override.h ttfautohint-0.94/gnulib/src/strerror-override.h --- ttfautohint-0.9/gnulib/src/strerror-override.h 2012-06-06 05:21:59.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/strerror-override.h 2012-11-29 07:21:52.000000000 +0000 @@ -46,7 +46,8 @@ || GNULIB_defined_EDQUOT \ || GNULIB_defined_ECANCELED \ || GNULIB_defined_EOWNERDEAD \ - || GNULIB_defined_ENOTRECOVERABLE + || GNULIB_defined_ENOTRECOVERABLE \ + || GNULIB_defined_EILSEQ extern const char *strerror_override (int errnum); # else # define strerror_override(ignored) NULL diff -Nru ttfautohint-0.9/gnulib/src/unistd.in.h ttfautohint-0.94/gnulib/src/unistd.in.h --- ttfautohint-0.9/gnulib/src/unistd.in.h 2012-06-06 05:21:59.000000000 +0000 +++ ttfautohint-0.94/gnulib/src/unistd.in.h 2012-11-29 07:21:52.000000000 +0000 @@ -1318,7 +1318,7 @@ _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) _GL_ARG_NONNULL ((1))); # endif -/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5 +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 and FreeBSD 6.4 the second parameter is int. On Solaris 11 2011-10, the first parameter is not const. */ _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); diff -Nru ttfautohint-0.9/lib/Makefile.am ttfautohint-0.94/lib/Makefile.am --- ttfautohint-0.9/lib/Makefile.am 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/Makefile.am 2012-11-17 09:46:46.000000000 +0000 @@ -12,37 +12,47 @@ AM_CPPFLAGS = $(FREETYPE_CPPFLAGS) -noinst_LIBRARIES = libttfautohint.a -libttfautohint_a_SOURCES = ta.h \ - tabytecode.c tabytecode.h \ - tacvt.c \ - tadsig.c \ - tadummy.c tadummy.h \ - taerror.c \ - tafile.c \ - tafont.c \ - tafpgm.c \ - tagasp.c \ - tagloadr.c tagloadr.h \ - taglobal.c taglobal.h \ - taglyf.c \ - tagpos.c \ - tahints.c tahints.h \ - tahmtx.c \ - talatin.c talatin.h \ - taloader.c taloader.h \ - taloca.c \ - tamaxp.c \ - taname.c \ - tapost.c \ - taprep.c \ - tasfnt.c \ - tasort.c tasort.h \ - tatables.c tatables.h \ - tatime.c \ - tattc.c \ - tattf.c \ - tatypes.h \ - ttfautohint.c ttfautohint.h ttfautohint-errors.h +noinst_LTLIBRARIES = \ + libttfautohint.la \ + libnumberset.la + +libnumberset_la_SOURCES = \ + numberset.c numberset.h + +libttfautohint_la_SOURCES = \ + ta.h \ + tabytecode.c tabytecode.h \ + tacvt.c \ + tadsig.c \ + tadummy.c tadummy.h \ + taerror.c \ + tafile.c \ + tafont.c \ + tafpgm.c \ + tagasp.c \ + tagloadr.c tagloadr.h \ + taglobal.c taglobal.h \ + taglyf.c \ + tagpos.c \ + tahints.c tahints.h \ + tahmtx.c \ + talatin.c talatin.h \ + taloader.c taloader.h \ + taloca.c \ + tamaxp.c \ + taname.c \ + tapost.c \ + taprep.c \ + tasfnt.c \ + tasort.c tasort.h \ + tatables.c tatables.h \ + tatime.c \ + tattc.c \ + tattf.c \ + tatypes.h \ + ttfautohint.c ttfautohint.h ttfautohint-errors.h + +libttfautohint_la_LIBADD = \ + libnumberset.la ## end of Makefile.am diff -Nru ttfautohint-0.9/lib/Makefile.in ttfautohint-0.94/lib/Makefile.in --- ttfautohint-0.9/lib/Makefile.in 2012-06-06 05:36:59.000000000 +0000 +++ ttfautohint-0.94/lib/Makefile.in 2012-11-29 07:22:17.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.1 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -69,24 +69,35 @@ $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ + $(top_srcdir)/gnulib/m4/fcntl-o.m4 \ + $(top_srcdir)/gnulib/m4/fcntl_h.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ + $(top_srcdir)/gnulib/m4/isatty.m4 \ $(top_srcdir)/gnulib/m4/lib-ld.m4 \ $(top_srcdir)/gnulib/m4/lib-link.m4 \ $(top_srcdir)/gnulib/m4/lib-prefix.m4 \ $(top_srcdir)/gnulib/m4/libtool.m4 \ $(top_srcdir)/gnulib/m4/lock.m4 \ + $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/ltoptions.m4 \ $(top_srcdir)/gnulib/m4/ltsugar.m4 \ $(top_srcdir)/gnulib/m4/ltversion.m4 \ $(top_srcdir)/gnulib/m4/lt~obsolete.m4 \ + $(top_srcdir)/gnulib/m4/memchr.m4 \ + $(top_srcdir)/gnulib/m4/memmem.m4 \ + $(top_srcdir)/gnulib/m4/mmap-anon.m4 \ + $(top_srcdir)/gnulib/m4/msvc-inval.m4 \ + $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gnulib/m4/multiarch.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ + $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/strerror_r.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ @@ -102,35 +113,40 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AM_V_AR = $(am__v_AR_@AM_V@) -am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) -am__v_AR_0 = @echo " AR " $@; +LTLIBRARIES = $(noinst_LTLIBRARIES) +libnumberset_la_LIBADD = +am_libnumberset_la_OBJECTS = numberset.lo +libnumberset_la_OBJECTS = $(am_libnumberset_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libttfautohint_la_DEPENDENCIES = libnumberset.la +am_libttfautohint_la_OBJECTS = tabytecode.lo tacvt.lo tadsig.lo \ + tadummy.lo taerror.lo tafile.lo tafont.lo tafpgm.lo tagasp.lo \ + tagloadr.lo taglobal.lo taglyf.lo tagpos.lo tahints.lo \ + tahmtx.lo talatin.lo taloader.lo taloca.lo tamaxp.lo taname.lo \ + tapost.lo taprep.lo tasfnt.lo tasort.lo tatables.lo tatime.lo \ + tattc.lo tattf.lo ttfautohint.lo +libttfautohint_la_OBJECTS = $(am_libttfautohint_la_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ -libttfautohint_a_AR = $(AR) $(ARFLAGS) -libttfautohint_a_LIBADD = -am_libttfautohint_a_OBJECTS = tabytecode.$(OBJEXT) tacvt.$(OBJEXT) \ - tadsig.$(OBJEXT) tadummy.$(OBJEXT) taerror.$(OBJEXT) \ - tafile.$(OBJEXT) tafont.$(OBJEXT) tafpgm.$(OBJEXT) \ - tagasp.$(OBJEXT) tagloadr.$(OBJEXT) taglobal.$(OBJEXT) \ - taglyf.$(OBJEXT) tagpos.$(OBJEXT) tahints.$(OBJEXT) \ - tahmtx.$(OBJEXT) talatin.$(OBJEXT) taloader.$(OBJEXT) \ - taloca.$(OBJEXT) tamaxp.$(OBJEXT) taname.$(OBJEXT) \ - tapost.$(OBJEXT) taprep.$(OBJEXT) tasfnt.$(OBJEXT) \ - tasort.$(OBJEXT) tatables.$(OBJEXT) tatime.$(OBJEXT) \ - tattc.$(OBJEXT) tattf.$(OBJEXT) ttfautohint.$(OBJEXT) -libttfautohint_a_OBJECTS = $(am_libttfautohint_a_OBJECTS) +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/gnulib/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ @@ -138,6 +154,7 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -145,11 +162,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libttfautohint_a_SOURCES) -DIST_SOURCES = $(libttfautohint_a_SOURCES) +am__v_CCLD_1 = +SOURCES = $(libnumberset_la_SOURCES) $(libttfautohint_la_SOURCES) +DIST_SOURCES = $(libnumberset_la_SOURCES) $(libttfautohint_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -161,12 +176,18 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -198,6 +219,7 @@ FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GETOPT_H = @GETOPT_H@ +GHC = @GHC@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ @@ -209,6 +231,7 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ @@ -248,6 +271,9 @@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -309,6 +335,7 @@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ @@ -321,12 +348,16 @@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ @@ -336,7 +367,11 @@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ @@ -346,10 +381,15 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HELP2MAN = @HELP2MAN@ @@ -384,14 +424,18 @@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ @@ -413,6 +457,7 @@ PDFLATEX = @PDFLATEX@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QMAKE = @QMAKE@ QT_CFLAGS = @QT_CFLAGS@ QT_CPPFLAGS = @QT_CPPFLAGS@ @@ -432,6 +477,7 @@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ @@ -446,6 +492,8 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_READ = @REPLACE_READ@ @@ -473,14 +521,19 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ UIC = @UIC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -526,6 +579,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -540,38 +594,48 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = $(FREETYPE_CPPFLAGS) -noinst_LIBRARIES = libttfautohint.a -libttfautohint_a_SOURCES = ta.h \ - tabytecode.c tabytecode.h \ - tacvt.c \ - tadsig.c \ - tadummy.c tadummy.h \ - taerror.c \ - tafile.c \ - tafont.c \ - tafpgm.c \ - tagasp.c \ - tagloadr.c tagloadr.h \ - taglobal.c taglobal.h \ - taglyf.c \ - tagpos.c \ - tahints.c tahints.h \ - tahmtx.c \ - talatin.c talatin.h \ - taloader.c taloader.h \ - taloca.c \ - tamaxp.c \ - taname.c \ - tapost.c \ - taprep.c \ - tasfnt.c \ - tasort.c tasort.h \ - tatables.c tatables.h \ - tatime.c \ - tattc.c \ - tattf.c \ - tatypes.h \ - ttfautohint.c ttfautohint.h ttfautohint-errors.h +noinst_LTLIBRARIES = \ + libttfautohint.la \ + libnumberset.la + +libnumberset_la_SOURCES = \ + numberset.c numberset.h + +libttfautohint_la_SOURCES = \ + ta.h \ + tabytecode.c tabytecode.h \ + tacvt.c \ + tadsig.c \ + tadummy.c tadummy.h \ + taerror.c \ + tafile.c \ + tafont.c \ + tafpgm.c \ + tagasp.c \ + tagloadr.c tagloadr.h \ + taglobal.c taglobal.h \ + taglyf.c \ + tagpos.c \ + tahints.c tahints.h \ + tahmtx.c \ + talatin.c talatin.h \ + taloader.c taloader.h \ + taloca.c \ + tamaxp.c \ + taname.c \ + tapost.c \ + taprep.c \ + tasfnt.c \ + tasort.c tasort.h \ + tatables.c tatables.h \ + tatime.c \ + tattc.c \ + tattf.c \ + tatypes.h \ + ttfautohint.c ttfautohint.h ttfautohint-errors.h + +libttfautohint_la_LIBADD = \ + libnumberset.la all: all-am @@ -608,12 +672,20 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libttfautohint.a: $(libttfautohint_a_OBJECTS) $(libttfautohint_a_DEPENDENCIES) $(EXTRA_libttfautohint_a_DEPENDENCIES) - $(AM_V_at)-rm -f libttfautohint.a - $(AM_V_AR)$(libttfautohint_a_AR) libttfautohint.a $(libttfautohint_a_OBJECTS) $(libttfautohint_a_LIBADD) - $(AM_V_at)$(RANLIB) libttfautohint.a +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libnumberset.la: $(libnumberset_la_OBJECTS) $(libnumberset_la_DEPENDENCIES) $(EXTRA_libnumberset_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libnumberset_la_OBJECTS) $(libnumberset_la_LIBADD) $(LIBS) +libttfautohint.la: $(libttfautohint_la_OBJECTS) $(libttfautohint_la_DEPENDENCIES) $(EXTRA_libttfautohint_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libttfautohint_la_OBJECTS) $(libttfautohint_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -621,35 +693,36 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabytecode.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tacvt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadsig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadummy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafont.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafpgm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagasp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagloadr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taglobal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taglyf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagpos.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tahints.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tahmtx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/talatin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taloader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taloca.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tamaxp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapost.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taprep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasfnt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasort.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatables.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tattc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tattf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numberset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabytecode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tacvt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadsig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taerror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafont.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tafpgm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagasp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagloadr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taglobal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taglyf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tagpos.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tahints.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tahmtx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/talatin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taloader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taloca.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tamaxp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapost.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taprep.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasfnt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatables.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tattc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tattf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttfautohint.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -776,7 +849,7 @@ done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) +all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am @@ -810,7 +883,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am @@ -882,17 +955,18 @@ .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES cscopelist ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru ttfautohint-0.9/lib/numberset.c ttfautohint-0.94/lib/numberset.c --- ttfautohint-0.9/lib/numberset.c 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/lib/numberset.c 2012-11-25 12:26:32.000000000 +0000 @@ -0,0 +1,350 @@ +/* numberset.c */ + +/* + * Copyright (C) 2012 by Werner Lemberg. + * + * This file is part of the ttfautohint library, and may only be used, + * modified, and distributed under the terms given in `COPYING'. By + * continuing to use, modify, or distribute this file you indicate that you + * have read `COPYING' and understand and accept it fully. + * + * The file `COPYING' mentioned in the previous paragraph is distributed + * with the ttfautohint library. + */ + + +#include +#include +#include +#include +#include + +#include + + +const char* +number_set_parse(const char* s, + number_range** number_set, + int min, + int max) +{ + number_range* cur = NULL; + number_range* new_range; + number_range* tmp; + + const char* last_pos = s; + int last_start = -1; + int last_end = -1; + int t; + number_range* error_code = NULL; + + + if (!s) + return NULL; + + if (min < 0) + min = 0; + if (max < 0) + max = INT_MAX; + if (min > max) + { + t = min; + min = max; + max = t; + } + + for (;;) + { + int digit; + int n = -1; + int m = -1; + + + while (isspace(*s)) + s++; + + if (*s == ',') + { + s++; + continue; + } + else if (*s == '-') + { + last_pos = s; + n = min; + } + else if (isdigit(*s)) + { + last_pos = s; + n = 0; + do + { + digit = *s - '0'; + if (n > INT_MAX / 10 + || (n == INT_MAX / 10 && digit > 5)) + { + error_code = NUMBERSET_OVERFLOW; + break; + } + + n = n * 10 + digit; + s++; + } while (isdigit(*s)); + + if (error_code) + break; + + while (isspace(*s)) + s++; + } + else if (*s == '\0') + break; /* end of data */ + else + { + error_code = NUMBERSET_INVALID_CHARACTER; + break; + } + + if (*s == '-') + { + s++; + + while (isspace(*s)) + s++; + + if (isdigit(*s)) + { + m = 0; + do + { + digit = *s - '0'; + if (m > INT_MAX / 10 + || (m == INT_MAX / 10 && digit > 5)) + { + error_code = NUMBERSET_OVERFLOW; + break; + } + + m = m * 10 + digit; + s++; + } while (isdigit(*s)); + + if (error_code) + break; + } + } + else + m = n; + + if (m == -1) + m = max; + + if (m < n) + { + t = n; + n = m; + m = t; + } + + if (n < min || m > max) + { + error_code = NUMBERSET_INVALID_RANGE; + break; + } + + if (last_end >= n) + { + if (last_start >= m) + error_code = NUMBERSET_NOT_ASCENDING; + else + error_code = NUMBERSET_OVERLAPPING_RANGES; + break; + } + + if (cur + && last_end + 1 == n) + { + /* merge adjacent ranges */ + cur->end = m; + } + else + { + if (number_set) + { + new_range = (number_range*)malloc(sizeof (number_range)); + if (!new_range) + { + error_code = NUMBERSET_ALLOCATION_ERROR; + break; + } + + /* prepend new range to list */ + new_range->start = n; + new_range->end = m; + new_range->next = cur; + cur = new_range; + } + } + + last_start = n; + last_end = m; + } /* end of loop */ + + if (error_code) + { + /* deallocate data */ + while (cur) + { + tmp = cur; + cur = cur->next; + free(tmp); + } + + s = last_pos; + if (number_set) + *number_set = error_code; + } + else + { + /* success; now reverse list to have elements in ascending order */ + number_range* list = NULL; + + + while (cur) + { + tmp = cur; + cur = cur->next; + tmp->next = list; + list = tmp; + } + + if (number_set) + *number_set = list; + } + + return s; +} + + +void +number_set_free(number_range* number_set) +{ + number_range* nr = number_set; + number_range* tmp; + + + while (nr) + { + tmp = nr; + nr = nr->next; + free(tmp); + } +} + + +char* +number_set_show(number_range* number_set, + int min, + int max) +{ + char* s; + char* s_new; + size_t s_len; + size_t s_len_new; + + number_range* nr = number_set; + + char tmp[256]; + int tmp_len; + int t; + const char *comma; + + + if (min < 0) + min = 0; + if (max < 0) + max = INT_MAX; + if (min > max) + { + t = min; + min = max; + max = t; + } + + /* we return an empty string for an empty number set */ + /* (this is, number_set == NULL or unsuitable `min' and `max' values) */ + s = (char*)malloc(1); + if (!s) + return NULL; + *s = '\0'; + + s_len = 1; + + while (nr) + { + if (nr->start > max) + return s; + if (nr->end < min) + goto Again; + + comma = (s_len == 1) ? "" : ", "; + + if (nr->start <= min + && nr->end >= max) + tmp_len = sprintf(tmp, "-"); + else if (nr->start <= min) + tmp_len = sprintf(tmp, "-%i", + nr->end); + else if (nr->end >= max) + tmp_len = sprintf(tmp, "%s%i-", + comma, nr->start); + else + { + if (nr->start == nr->end) + tmp_len = sprintf(tmp, "%s%i", + comma, nr->start); + else + tmp_len = sprintf(tmp, "%s%i-%i", + comma, nr->start, nr->end); + } + + s_len_new = s_len + tmp_len; + s_new = (char*)realloc(s, s_len_new); + if (!s_new) + { + free(s); + return NULL; + } + strcpy(s_new + s_len - 1, tmp); + s_len = s_len_new; + s = s_new; + + Again: + nr = nr->next; + } + + return s; +} + + +int +number_set_is_element(number_range* number_set, + int number) +{ + number_range* nr = number_set; + + + while (nr) + { + if (number < nr->start) + return 0; + if (nr->start <= number + && number <= nr->end) + return 1; + nr = nr->next; + } + + return 0; +} + +/* end of numberset.c */ diff -Nru ttfautohint-0.9/lib/numberset.h ttfautohint-0.94/lib/numberset.h --- ttfautohint-0.9/lib/numberset.h 1970-01-01 00:00:00.000000000 +0000 +++ ttfautohint-0.94/lib/numberset.h 2012-11-25 12:27:54.000000000 +0000 @@ -0,0 +1,141 @@ +/* numberset.h */ + +/* + * Copyright (C) 2012 by Werner Lemberg. + * + * This file is part of the ttfautohint library, and may only be used, + * modified, and distributed under the terms given in `COPYING'. By + * continuing to use, modify, or distribute this file you indicate that you + * have read `COPYING' and understand and accept it fully. + * + * The file `COPYING' mentioned in the previous paragraph is distributed + * with the ttfautohint library. + */ + + +#ifndef __NUMBERSET_H__ +#define __NUMBERSET_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A structure defining an integer range, to be used as a linked list. It + * gets allocated by a successful call to `parse_number_set'. Use + * `number_set_free' to deallocate it. + */ + +typedef struct number_range_ +{ + int start; + int end; + + struct number_range_* next; +} number_range; + + +/* + * Parse a description in string `s' for a set of non-negative integers + * within the limits given by the input parameters `min' and `max', and + * which consists of the following ranges, separated by commas (`n' and `m' + * are non-negative integers): + * + * -n min <= x <= n + * n x = n; this is a shorthand for `n-n' + * n-m n <= x <= m (or m <= x <= n if m < n) + * m- m <= x <= max + * - min <= x <= max + * + * Superfluous commas are ignored, as is whitespace around numbers, dashes, + * and commas. The ranges must be ordered, without overlaps. As a + * consequence, `-n' and `m-' can occur at most once and must be then the + * first and last range, respectively; similarly, `-' cannot be paired with + * any other range. + * + * In the following examples, `min' is 4 and `max' is 12: + * + * - -> 4, 5, 6, 7, 8, 9, 10, 11, 12 + * -3, 5- -> invalid first range + * 4, 6-8, 10- -> 4, 6, 7, 8, 10, 11, 12 + * 4-8, 6-10 -> invalid overlapping ranges + * + * In case of success (this is, the number set description in `s' is valid) + * the return value is a pointer to the final zero byte in string `s'. In + * case of an error, the return value is a pointer to the beginning position + * of the offending range in string `s'. + * + * If s is NULL, the function exits immediately with NULL as the return + * value. + * + * If the user provides a non-NULL `number_set' value, `number_set_parse' + * stores a linked list of ordered number ranges in `*number_set', allocated + * with `malloc'. If there is no range at all (for example, an empty string + * or whitespace and commas only) no data gets allocated, and `*number_set' + * is set to NULL. In case of error, `*number_set' returns an error code; + * you should use the following macros to compare with. + * + * NUMBERSET_INVALID_CHARACTER invalid character in description string + * NUMBERSET_OVERFLOW numerical overflow + * NUMBERSET_INVALID_RANGE invalid range, exceeding `min' or `max' + * NUMBERSET_OVERLAPPING_RANGES overlapping ranges + * NUMBERSET_NOT_ASCENDING not ascending ranges or values + * NUMBERSET_ALLOCATION_ERROR allocation error + * + * Note that a negative value for `min' is replaced with zero, and a + * negative value for `max' with the largest representable integer, INT_MAX. + */ + +#define NUMBERSET_INVALID_CHARACTER (number_range*)-1 +#define NUMBERSET_OVERFLOW (number_range*)-2 +#define NUMBERSET_INVALID_RANGE (number_range*)-3 +#define NUMBERSET_OVERLAPPING_RANGES (number_range*)-4 +#define NUMBERSET_NOT_ASCENDING (number_range*)-5 +#define NUMBERSET_ALLOCATION_ERROR (number_range*)-6 + +const char* +number_set_parse(const char* s, + number_range** number_set, + int min, + int max); + + +/* + * Free the allocated data in `number_set'. + */ + +void +number_set_free(number_range* number_set); + + +/* + * Return a string representation of `number_set', viewed through a + * `window', so to say, spanned up by the parameters `min' and `max'. After + * use, the string should be deallocated with a call to `free'. In case of + * an allocation error, the return value is NULL. + * + * Note that a negative value for `min' is replaced with zero, and a + * negative value for `max' with the largest representable integer, INT_MAX. + */ + +char* +number_set_show(number_range* number_set, + int min, + int max); + + +/* + * Return value 1 if `number' is element of `number_set', zero otherwise. + */ + +int +number_set_is_element(number_range* number_set, + int number); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __NUMBERSET_H__ */ + +/* end of numberset.h */ diff -Nru ttfautohint-0.9/lib/ta.h ttfautohint-0.94/lib/ta.h --- ttfautohint-0.9/lib/ta.h 2012-06-04 13:14:08.000000000 +0000 +++ ttfautohint-0.94/lib/ta.h 2012-11-19 19:02:46.000000000 +0000 @@ -24,10 +24,12 @@ #include FT_TRUETYPE_TAGS_H #include "taloader.h" +#include "taglobal.h" #include "tadummy.h" #include "talatin.h" #include +#include #define TTFAUTOHINT_GLYPH ".ttfautohint" @@ -125,6 +127,17 @@ { FT_UShort num_glyphs; GLYPH* glyphs; + + /* this index gives the `master' globals for a `glyf' table; */ + /* see function `TA_sfnt_handle_coverage' */ + TA_FaceGlobals master_globals; + + /* if a `glyf' table gets used in more than one subfont, */ + /* so do `cvt', `fpgm', and `prep' tables: */ + /* these four tables are always handled in parallel */ + FT_ULong cvt_idx; + FT_ULong fpgm_idx; + FT_ULong prep_idx; } glyf_Data; /* an SFNT table */ @@ -173,7 +186,7 @@ } SFNT; /* our font object */ -typedef struct FONT_ +struct FONT_ { FT_Library lib; @@ -191,6 +204,9 @@ FT_Bool have_DSIG; + /* we have a single `gasp' table for all subfonts */ + FT_ULong gasp_idx; + TA_LoaderRec loader[1]; /* the interface to the autohinter */ /* configuration options */ @@ -202,13 +218,18 @@ FT_UInt hinting_range_max; FT_UInt hinting_limit; FT_UInt increase_x_height; + number_range* x_height_snapping_exceptions; + FT_Bool gray_strong_stem_width; + FT_Bool gdi_cleartype_strong_stem_width; + FT_Bool dw_cleartype_strong_stem_width; + FT_Bool windows_compatibility; FT_Bool pre_hinting; - FT_Bool no_x_height_snapping; - FT_Byte* x_height_snapping_exceptions; + FT_Bool hint_with_components; FT_Bool ignore_restrictions; FT_UInt fallback_script; FT_Bool symbol; -} FONT; + FT_Bool debug; +}; #include "tatables.h" @@ -222,6 +243,13 @@ TA_get_current_time(FT_ULong* high, FT_ULong* low); +FT_Byte* +TA_build_push(FT_Byte* bufp, + FT_UInt* args, + FT_UInt num_args, + FT_Bool need_words, + FT_Bool optimize); + FT_Error TA_font_init(FONT* font); void @@ -261,9 +289,6 @@ FONT* font); FT_Error -TA_sfnt_build_glyf_hints(SFNT* sfnt, - FONT* font); -FT_Error TA_sfnt_split_glyf_table(SFNT* sfnt, FONT* font); FT_Error @@ -272,6 +297,17 @@ FT_Error TA_sfnt_create_glyf_data(SFNT* sfnt, FONT* font); +FT_Error +TA_sfnt_handle_coverage(SFNT* sfnt, + FONT* font); +void +TA_sfnt_adjust_master_coverage(SFNT* sfnt, + FONT* font); +#if 0 +void +TA_sfnt_copy_master_coverage(SFNT* sfnt, + FONT* font); +#endif FT_Error TA_sfnt_update_GPOS_table(SFNT* sfnt, diff -Nru ttfautohint-0.9/lib/tabytecode.c ttfautohint-0.94/lib/tabytecode.c --- ttfautohint-0.9/lib/tabytecode.c 2012-06-04 13:41:50.000000000 +0000 +++ ttfautohint-0.94/lib/tabytecode.c 2012-11-21 16:59:00.000000000 +0000 @@ -18,20 +18,14 @@ #undef MISSING -#define MISSING (FT_UInt)~0 +#define MISSING (FT_UShort)~0 -/* a simple macro to emit bytecode instructions */ -#define BCI(code) *(bufp++) = (code) -/* we increase the stack depth by this amount */ -#define ADDITIONAL_STACK_ELEMENTS 20 - - -/* #define DEBUGGING */ +#define DEBUGGING #ifdef TA_DEBUG -int _ta_debug = 1; +int _ta_debug = 0; int _ta_debug_disable_horz_hints; int _ta_debug_disable_vert_hints; int _ta_debug_disable_blue_hints; @@ -58,22 +52,103 @@ /* (there can be at most one such segment per contour); */ /* later on we append additional records */ /* to split them into 24-26 and 0-2 */ - FT_UInt* wrap_around_segments; - FT_UInt num_wrap_around_segments; + FT_UShort* wrap_around_segments; + FT_UShort num_wrap_around_segments; FT_UShort num_stack_elements; /* the necessary stack depth so far */ /* data necessary for strong point interpolation */ - FT_UInt* ip_before_points; - FT_UInt* ip_after_points; - FT_UInt* ip_on_point_array; - FT_UInt* ip_between_point_array; + FT_UShort* ip_before_points; + FT_UShort* ip_after_points; + FT_UShort* ip_on_point_array; + FT_UShort* ip_between_point_array; - FT_UInt num_strong_points; - FT_UInt num_segments; + FT_UShort num_strong_points; + FT_UShort num_segments; } Recorder; +/* this is the bytecode of the `.ttfautohint' glyph */ + +FT_Byte ttfautohint_glyph_bytecode[7] = +{ + + /* increment `cvtl_is_subglyph' counter */ + PUSHB_3, + cvtl_is_subglyph, + 1, + cvtl_is_subglyph, + RCVT, + ADD, + WCVTP, + +}; + + +/* + * convert array `args' into a sequence of NPUSHB, NPUSHW, PUSHB_X, and + * PUSHW_X instructions to be stored in `bufp' (the latter two instructions + * only if `optimize' is not set); if `need_words' is set, NPUSHW and + * PUSHW_X gets used + */ + +FT_Byte* +TA_build_push(FT_Byte* bufp, + FT_UInt* args, + FT_UInt num_args, + FT_Bool need_words, + FT_Bool optimize) +{ + FT_UInt* arg = args; + FT_UInt i, j, nargs; + + + if (need_words) + { + for (i = 0; i < num_args; i += 255) + { + nargs = (num_args - i > 255) ? 255 : num_args - i; + + if (optimize && nargs <= 8) + BCI(PUSHW_1 - 1 + nargs); + else + { + BCI(NPUSHW); + BCI(nargs); + } + for (j = 0; j < nargs; j++) + { + BCI(HIGH(*arg)); + BCI(LOW(*arg)); + arg++; + } + } + } + else + { + for (i = 0; i < num_args; i += 255) + { + nargs = (num_args - i > 255) ? 255 : num_args - i; + + if (optimize && nargs <= 8) + BCI(PUSHB_1 - 1 + nargs); + else + { + BCI(NPUSHB); + BCI(nargs); + } + for (j = 0; j < nargs; j++) + { + BCI(*arg); + arg++; + } + } + } + + return bufp; +} + + /* We add a subglyph for each composite glyph. */ /* Since subglyphs must contain at least one point, */ /* we have to adjust all point indices accordingly. */ @@ -87,11 +162,12 @@ TA_adjust_point_index(Recorder* recorder, FT_UInt idx) { + FONT* font = recorder->font; GLYPH* glyph = recorder->glyph; FT_UShort i; - if (!glyph->num_components) + if (!glyph->num_components || !font->hint_with_components) return idx; /* not a composite glyph */ for (i = 0; i < glyph->num_pointsums; i++) @@ -124,18 +200,16 @@ FT_UInt* args; FT_UInt* arg; FT_UInt num_args; - FT_UInt nargs; - FT_UInt num_segments; + FT_UShort num_segments; FT_Bool need_words = 0; FT_Int n; - FT_UInt i, j; FT_UInt base; - FT_UInt num_packed_segments; - FT_UInt num_storage; - FT_UInt num_stack_elements; - FT_UInt num_twilight_points; + FT_UShort num_packed_segments; + FT_UShort num_storage; + FT_UShort num_stack_elements; + FT_UShort num_twilight_points; seg_limit = segments + axis->num_segments; @@ -188,7 +262,7 @@ need_words = 1; /* the number of packed segments is indicated by the function number */ - if (recorder->glyph->num_components) + if (recorder->glyph->num_components && font->hint_with_components) *(arg--) = bci_create_segments_composite_0 + num_packed_segments; else *(arg--) = bci_create_segments_0 + num_packed_segments; @@ -278,54 +352,11 @@ *(arg--) = TA_adjust_point_index(recorder, last); } } + /* with most fonts it is very rare */ /* that any of the pushed arguments is larger than 0xFF, */ /* thus we refrain from further optimizing this case */ - - arg = args; - - if (need_words) - { - for (i = 0; i < num_args; i += 255) - { - nargs = (num_args - i > 255) ? 255 : num_args - i; - - - if (optimize && nargs <= 8) - BCI(PUSHW_1 - 1 + nargs); - else - { - BCI(NPUSHW); - BCI(nargs); - } - for (j = 0; j < nargs; j++) - { - BCI(HIGH(*arg)); - BCI(LOW(*arg)); - arg++; - } - } - } - else - { - for (i = 0; i < num_args; i += 255) - { - nargs = (num_args - i > 255) ? 255 : num_args - i; - - if (optimize && nargs <= 8) - BCI(PUSHB_1 - 1 + nargs); - else - { - BCI(NPUSHB); - BCI(nargs); - } - for (j = 0; j < nargs; j++) - { - BCI(*arg); - arg++; - } - } - } + bufp = TA_build_push(bufp, args, num_args, need_words, optimize); BCI(CALL); @@ -355,6 +386,7 @@ Recorder* recorder, FT_Byte* bufp) { + FONT* font = recorder->font; FT_GlyphSlot glyph = sfnt->face->glyph; FT_Vector* points = glyph->outline.points; FT_Int num_contours = glyph->outline.n_contours; @@ -362,13 +394,11 @@ FT_UInt* args; FT_UInt* arg; FT_UInt num_args; - FT_UInt nargs; FT_Bool need_words = 0; FT_Int p, q; - FT_UInt i, j; FT_Int start, end; - FT_UInt num_stack_elements; + FT_UShort num_stack_elements; num_args = 2 * num_contours + 2; @@ -385,7 +415,7 @@ if (num_args > 0xFF) need_words = 1; - if (recorder->glyph->num_components) + if (recorder->glyph->num_components && font->hint_with_components) *(arg--) = bci_scale_composite_glyph; else *(arg--) = bci_scale_glyph; @@ -430,50 +460,7 @@ /* with most fonts it is very rare */ /* that any of the pushed arguments is larger than 0xFF, */ /* thus we refrain from further optimizing this case */ - - arg = args; - - if (need_words) - { - for (i = 0; i < num_args; i += 255) - { - nargs = (num_args - i > 255) ? 255 : num_args - i; - - if (nargs <= 8) - BCI(PUSHW_1 - 1 + nargs); - else - { - BCI(NPUSHW); - BCI(nargs); - } - for (j = 0; j < nargs; j++) - { - BCI(HIGH(*arg)); - BCI(LOW(*arg)); - arg++; - } - } - } - else - { - for (i = 0; i < num_args; i += 255) - { - nargs = (num_args - i > 255) ? 255 : num_args - i; - - if (nargs <= 8) - BCI(PUSHB_1 - 1 + nargs); - else - { - BCI(NPUSHB); - BCI(nargs); - } - for (j = 0; j < nargs; j++) - { - BCI(*arg); - arg++; - } - } - } + bufp = TA_build_push(bufp, args, num_args, need_words, 1); BCI(CALL); @@ -602,19 +589,19 @@ TA_Edge after; FT_Byte* p = recorder->hints_record.buf; - FT_UInt num_edges = axis->num_edges; - FT_UInt num_strong_points = recorder->num_strong_points; + FT_UShort num_edges = axis->num_edges; + FT_UShort num_strong_points = recorder->num_strong_points; - FT_UInt i; - FT_UInt j; - FT_UInt k; + FT_UShort i; + FT_UShort j; + FT_UShort k; - FT_UInt* ip; - FT_UInt* iq; - FT_UInt* ir; - FT_UInt* ip_limit; - FT_UInt* iq_limit; - FT_UInt* ir_limit; + FT_UShort* ip; + FT_UShort* iq; + FT_UShort* ir; + FT_UShort* ip_limit; + FT_UShort* iq_limit; + FT_UShort* ir_limit; /* we store everything as 16bit numbers; */ @@ -1038,13 +1025,13 @@ TA_hints_recorder_handle_segments(FT_Byte* bufp, TA_AxisHints axis, TA_Edge edge, - FT_UInt* wraps) + FT_UShort* wraps) { TA_Segment segments = axis->segments; TA_Segment seg; - FT_UInt seg_idx; - FT_UInt num_segs = 0; - FT_UInt* wrap; + FT_UShort seg_idx; + FT_UShort num_segs = 0; + FT_UShort* wrap; seg_idx = edge->first - segments; @@ -1133,11 +1120,11 @@ Recorder* recorder = (Recorder*)hints->user; FONT* font = recorder->font; - FT_UInt* wraps = recorder->wrap_around_segments; + FT_UShort* wraps = recorder->wrap_around_segments; FT_Byte* p = recorder->hints_record.buf; - FT_UInt* ip; - FT_UInt* limit; + FT_UShort* ip; + FT_UShort* limit; if (dim == TA_DIMENSION_HORZ) @@ -1517,8 +1504,8 @@ TA_Segment seg_limit = segments + axis->num_segments; TA_Segment seg; - FT_UInt num_strong_points = 0; - FT_UInt* wrap_around_segment; + FT_UShort num_strong_points = 0; + FT_UShort* wrap_around_segment; recorder->font = font; recorder->glyph = glyph; @@ -1540,7 +1527,8 @@ recorder->num_wrap_around_segments++; recorder->wrap_around_segments = - (FT_UInt*)malloc(recorder->num_wrap_around_segments * sizeof (FT_UInt)); + (FT_UShort*)malloc(recorder->num_wrap_around_segments + * sizeof (FT_UShort)); if (!recorder->wrap_around_segments) return FT_Err_Out_Of_Memory; @@ -1564,12 +1552,12 @@ recorder->num_strong_points = num_strong_points; recorder->ip_before_points = - (FT_UInt*)malloc(num_strong_points * sizeof (FT_UInt)); + (FT_UShort*)malloc(num_strong_points * sizeof (FT_UShort)); if (!recorder->ip_before_points) return FT_Err_Out_Of_Memory; recorder->ip_after_points = - (FT_UInt*)malloc(num_strong_points * sizeof (FT_UInt)); + (FT_UShort*)malloc(num_strong_points * sizeof (FT_UShort)); if (!recorder->ip_after_points) return FT_Err_Out_Of_Memory; @@ -1577,14 +1565,14 @@ /* however, this value isn't known yet */ /* (or rather, it can vary between different pixel sizes) */ recorder->ip_on_point_array = - (FT_UInt*)malloc(axis->num_segments - * num_strong_points * sizeof (FT_UInt)); + (FT_UShort*)malloc(axis->num_segments + * num_strong_points * sizeof (FT_UShort)); if (!recorder->ip_on_point_array) return FT_Err_Out_Of_Memory; recorder->ip_between_point_array = - (FT_UInt*)malloc(axis->num_segments * axis->num_segments - * num_strong_points * sizeof (FT_UInt)); + (FT_UShort*)malloc(axis->num_segments * axis->num_segments + * num_strong_points * sizeof (FT_UShort)); if (!recorder->ip_between_point_array) return FT_Err_Out_Of_Memory; @@ -1613,16 +1601,16 @@ /* We later check with MISSING (which expands to 0xFF bytes) */ memset(recorder->ip_before_points, 0xFF, - recorder->num_strong_points * sizeof (FT_UInt)); + recorder->num_strong_points * sizeof (FT_UShort)); memset(recorder->ip_after_points, 0xFF, - recorder->num_strong_points * sizeof (FT_UInt)); + recorder->num_strong_points * sizeof (FT_UShort)); memset(recorder->ip_on_point_array, 0xFF, recorder->num_segments - * recorder->num_strong_points * sizeof (FT_UInt)); + * recorder->num_strong_points * sizeof (FT_UShort)); memset(recorder->ip_between_point_array, 0xFF, recorder->num_segments * recorder->num_segments - * recorder->num_strong_points * sizeof (FT_UInt)); + * recorder->num_strong_points * sizeof (FT_UShort)); } @@ -1658,13 +1646,13 @@ TA_GlyphHints hints; - FT_UInt num_action_hints_records; - FT_UInt num_point_hints_records; - Hints_Record* action_hints_records; - Hints_Record* point_hints_records; + FT_UInt num_action_hints_records = 0; + FT_UInt num_point_hints_records = 0; + Hints_Record* action_hints_records = NULL; + Hints_Record* point_hints_records = NULL; Recorder recorder; - FT_UInt num_stack_elements; + FT_UShort num_stack_elements; FT_Bool optimize = 0; FT_Int32 load_flags; @@ -1672,16 +1660,21 @@ FT_Byte* pos[3]; +#ifdef TA_DEBUG + int _ta_debug_save; +#endif + /* XXX: right now, we abuse this flag to control */ /* the global behaviour of the auto-hinter */ - load_flags = font->fallback_script << 30; - load_flags |= 1 << 29; /* vertical hinting only */ - /* values 0 and 6-20 compressed to 4 bits */ - if (font->increase_x_height) - load_flags |= (font->increase_x_height - 5) << 25; + load_flags = 1 << 29; /* vertical hinting only */ if (!font->pre_hinting) - load_flags |= FT_LOAD_NO_SCALE; + { + if (font->hint_with_components) + load_flags |= FT_LOAD_NO_SCALE; + else + load_flags |= FT_LOAD_NO_RECURSE; + } /* computing the segments is resolution independent, */ /* thus the pixel size in this call is arbitrary */ @@ -1689,8 +1682,20 @@ if (error) return error; +#ifdef TA_DEBUG + /* temporarily disable debugging output */ + /* to avoid getting the information twice */ + _ta_debug_save = _ta_debug; + _ta_debug = 0; +#endif + ta_loader_register_hints_recorder(font->loader, NULL, NULL); - error = ta_loader_load_glyph(font->loader, face, (FT_UInt)idx, load_flags); + error = ta_loader_load_glyph(font, face, (FT_UInt)idx, load_flags); + +#ifdef TA_DEBUG + _ta_debug = _ta_debug_save; +#endif + if (error) return error; @@ -1733,7 +1738,8 @@ if (font->loader->metrics->clazz == &ta_dummy_script_class) { /* since `TA_init_recorder' hasn't been called yet, */ - /* we manually initialize the `glyph' field */ + /* we manually initialize the `font' and `glyph' fields */ + recorder.font = font; recorder.glyph = glyph; bufp = TA_sfnt_build_glyph_scaler(sfnt, &recorder, ins_buf); @@ -1754,12 +1760,19 @@ /* to find hints records which get pushed onto the bytecode stack */ #ifdef DEBUGGING + if (font->debug) { int num_chars, i; + char buf[256]; + + (void)FT_Get_Glyph_Name(face, idx, buf, 256); - num_chars = fprintf(stderr, "glyph %ld\n", idx); - for (i = 0; i < num_chars - 1; i++) + num_chars = fprintf(stderr, "glyph %ld", idx); + if (*buf) + num_chars += fprintf(stderr, " (%s)", buf); + fprintf(stderr, "\n"); + for (i = 0; i < num_chars; i++) putc('=', stderr); fprintf(stderr, "\n\n"); @@ -1771,11 +1784,6 @@ TA_hints_recorder, (void*)&recorder); - num_action_hints_records = 0; - num_point_hints_records = 0; - action_hints_records = NULL; - point_hints_records = NULL; - for (size = font->hinting_range_min; size <= font->hinting_range_max; size++) @@ -1791,10 +1799,23 @@ if (error) goto Err; +#ifdef DEBUGGING + if (font->debug) + { + int num_chars, i; + + + num_chars = fprintf(stderr, "size %d\n", size); + for (i = 0; i < num_chars - 1; i++) + putc('-', stderr); + fprintf(stderr, "\n\n"); + } +#endif + /* calling `ta_loader_load_glyph' uses the */ /* `TA_hints_recorder' function as a callback, */ /* modifying `hints_record' */ - error = ta_loader_load_glyph(font->loader, face, idx, load_flags); + error = ta_loader_load_glyph(font, face, idx, load_flags); if (error) goto Err; @@ -1803,18 +1824,23 @@ ins_buf, recorder.hints_record.buf)) { #ifdef DEBUGGING + if (font->debug) { have_dumps = 1; - fprintf(stderr, " size %d:\n", size); - ta_glyph_hints_dump_edges(_ta_debug_hints); ta_glyph_hints_dump_segments(_ta_debug_hints); ta_glyph_hints_dump_points(_ta_debug_hints); - fprintf(stderr, " action hints record:\n"); - for (p = ins_buf; p < recorder.hints_record.buf; p += 2) - fprintf(stderr, " %2d", *p * 256 + *(p + 1)); + fprintf(stderr, "action hints record:\n"); + if (ins_buf == recorder.hints_record.buf) + fprintf(stderr, " (none)"); + else + { + fprintf(stderr, " "); + for (p = ins_buf; p < recorder.hints_record.buf; p += 2) + fprintf(stderr, " %2d", *p * 256 + *(p + 1)); + } fprintf(stderr, "\n"); } #endif @@ -1838,20 +1864,33 @@ ins_buf, recorder.hints_record.buf)) { #ifdef DEBUGGING + if (font->debug) { if (!have_dumps) { - fprintf(stderr, " size %d:\n", size); + int num_chars, i; + + + num_chars = fprintf(stderr, "size %d\n", size); + for (i = 0; i < num_chars - 1; i++) + putc('-', stderr); + fprintf(stderr, "\n\n"); ta_glyph_hints_dump_edges(_ta_debug_hints); ta_glyph_hints_dump_segments(_ta_debug_hints); ta_glyph_hints_dump_points(_ta_debug_hints); } - fprintf(stderr, " point hints record:\n"); - for (p = ins_buf; p < recorder.hints_record.buf; p += 2) - fprintf(stderr, " %2d", *p * 256 + *(p + 1)); - fprintf(stderr, "\n"); + fprintf(stderr, "point hints record:\n"); + if (ins_buf == recorder.hints_record.buf) + fprintf(stderr, " (none)"); + else + { + fprintf(stderr, " "); + for (p = ins_buf; p < recorder.hints_record.buf; p += 2) + fprintf(stderr, " %2d", *p * 256 + *(p + 1)); + } + fprintf(stderr, "\n\n"); } #endif @@ -2024,6 +2063,7 @@ Done: TA_free_hints_records(action_hints_records, num_action_hints_records); + TA_free_hints_records(point_hints_records, num_point_hints_records); TA_free_recorder(&recorder); /* we are done, so reallocate the instruction array to its real size */ @@ -2054,6 +2094,7 @@ Err: TA_free_hints_records(action_hints_records, num_action_hints_records); + TA_free_hints_records(point_hints_records, num_point_hints_records); TA_free_recorder(&recorder); free(ins_buf); diff -Nru ttfautohint-0.9/lib/tabytecode.h ttfautohint-0.94/lib/tabytecode.h --- ttfautohint-0.9/lib/tabytecode.h 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tabytecode.h 2012-11-21 16:57:35.000000000 +0000 @@ -292,15 +292,23 @@ #define MIRP_rp0_keep_round_3 0xFF +/* a simple macro to emit bytecode instructions */ +#define BCI(code) *(bufp++) = (code) + +/* we increase the stack depth by this amount */ +#define ADDITIONAL_STACK_ELEMENTS 20 + + /* symbolic names for storage area locations */ #define sal_i 0 #define sal_j sal_i + 1 -#define sal_k sal_j + 1 -#define sal_temp1 sal_k + 1 +#define sal_temp1 sal_j + 1 #define sal_temp2 sal_temp1 + 1 #define sal_temp3 sal_temp2 + 1 -#define sal_limit sal_temp3 + 1 +#define sal_best sal_temp3 + 1 +#define sal_ref sal_best + 1 +#define sal_limit sal_ref + 1 #define sal_func sal_limit +1 #define sal_anchor sal_func + 1 #define sal_point_min sal_anchor + 1 @@ -314,19 +322,23 @@ /* 0 */ #define bci_round 0 -#define bci_compute_stem_width bci_round + 1 -#define bci_loop bci_compute_stem_width + 1 +#define bci_smooth_stem_width bci_round + 1 +#define bci_get_best_width bci_smooth_stem_width + 1 +#define bci_strong_stem_width bci_get_best_width + 1 +#define bci_loop bci_strong_stem_width + 1 #define bci_cvt_rescale bci_loop + 1 #define bci_blue_round bci_cvt_rescale + 1 #define bci_decrement_component_counter bci_blue_round + 1 #define bci_get_point_extrema bci_decrement_component_counter + 1 #define bci_nibbles bci_get_point_extrema + 1 +#define bci_number_set_is_element bci_nibbles + 1 +#define bci_number_set_is_element2 bci_number_set_is_element + 1 -/* 8 */ -#define bci_create_segment bci_nibbles + 1 +/* 12 */ +#define bci_create_segment bci_number_set_is_element2 + 1 #define bci_create_segments bci_create_segment + 1 -/* 10 */ +/* 14 */ /* the next ten entries must stay in this order */ #define bci_create_segments_0 bci_create_segments + 1 #define bci_create_segments_1 bci_create_segments_0 + 1 @@ -341,7 +353,7 @@ #define bci_create_segments_composite bci_create_segments_9 + 1 -/* 21 */ +/* 25 */ /* the next ten entries must stay in this order */ #define bci_create_segments_composite_0 bci_create_segments_composite + 1 #define bci_create_segments_composite_1 bci_create_segments_composite_0 + 1 @@ -354,24 +366,24 @@ #define bci_create_segments_composite_8 bci_create_segments_composite_7 + 1 #define bci_create_segments_composite_9 bci_create_segments_composite_8 + 1 -/* 31 */ +/* 35 */ #define bci_align_segment bci_create_segments_composite_9 + 1 #define bci_align_segments bci_align_segment + 1 -/* 33 */ +/* 37 */ #define bci_scale_contour bci_align_segments + 1 #define bci_scale_glyph bci_scale_contour + 1 #define bci_scale_composite_glyph bci_scale_glyph + 1 #define bci_shift_contour bci_scale_composite_glyph + 1 #define bci_shift_subglyph bci_shift_contour + 1 -/* 38 */ +/* 42 */ #define bci_ip_outer_align_point bci_shift_subglyph + 1 #define bci_ip_on_align_points bci_ip_outer_align_point + 1 #define bci_ip_between_align_point bci_ip_on_align_points + 1 #define bci_ip_between_align_points bci_ip_between_align_point + 1 -/* 42 */ +/* 46 */ #define bci_adjust_common bci_ip_between_align_points + 1 #define bci_stem_common bci_adjust_common + 1 #define bci_serif_common bci_stem_common + 1 @@ -379,12 +391,12 @@ #define bci_serif_link1_common bci_serif_anchor_common + 1 #define bci_serif_link2_common bci_serif_link1_common + 1 -/* 48 */ +/* 52 */ #define bci_lower_bound bci_serif_link2_common + 1 #define bci_upper_bound bci_lower_bound + 1 #define bci_upper_lower_bound bci_upper_bound + 1 -/* 51 */ +/* 55 */ #define bci_adjust_bound bci_upper_lower_bound + 1 #define bci_stem_bound bci_adjust_bound + 1 #define bci_link bci_stem_bound + 1 @@ -395,23 +407,23 @@ /* the order of the `bci_action_*' entries must correspond */ /* to the order of the TA_Action enumeration entries (in `tahints.h') */ -/* 57 */ +/* 61 */ #define bci_action_ip_before bci_stem + 1 #define bci_action_ip_after bci_action_ip_before + 1 #define bci_action_ip_on bci_action_ip_after + 1 #define bci_action_ip_between bci_action_ip_on + 1 -/* 61 */ +/* 65 */ #define bci_action_blue bci_action_ip_between + 1 #define bci_action_blue_anchor bci_action_blue + 1 -/* 63 */ +/* 67 */ #define bci_action_anchor bci_action_blue_anchor + 1 #define bci_action_anchor_serif bci_action_anchor + 1 #define bci_action_anchor_round bci_action_anchor_serif + 1 #define bci_action_anchor_round_serif bci_action_anchor_round + 1 -/* 67 */ +/* 71 */ #define bci_action_adjust bci_action_anchor_round_serif + 1 #define bci_action_adjust_serif bci_action_adjust + 1 #define bci_action_adjust_round bci_action_adjust_serif + 1 @@ -421,13 +433,13 @@ #define bci_action_adjust_bound_round bci_action_adjust_bound_serif + 1 #define bci_action_adjust_bound_round_serif bci_action_adjust_bound_round + 1 -/* 75 */ +/* 79 */ #define bci_action_link bci_action_adjust_bound_round_serif + 1 #define bci_action_link_serif bci_action_link + 1 #define bci_action_link_round bci_action_link_serif + 1 #define bci_action_link_round_serif bci_action_link_round + 1 -/* 79 */ +/* 83 */ #define bci_action_stem bci_action_link_round_serif + 1 #define bci_action_stem_serif bci_action_stem + 1 #define bci_action_stem_round bci_action_stem_serif + 1 @@ -437,31 +449,31 @@ #define bci_action_stem_bound_round bci_action_stem_bound_serif + 1 #define bci_action_stem_bound_round_serif bci_action_stem_bound_round + 1 -/* 87 */ +/* 91 */ #define bci_action_serif bci_action_stem_bound_round_serif + 1 #define bci_action_serif_lower_bound bci_action_serif + 1 #define bci_action_serif_upper_bound bci_action_serif_lower_bound + 1 #define bci_action_serif_upper_lower_bound bci_action_serif_upper_bound + 1 -/* 91 */ +/* 95 */ #define bci_action_serif_anchor bci_action_serif_upper_lower_bound + 1 #define bci_action_serif_anchor_lower_bound bci_action_serif_anchor + 1 #define bci_action_serif_anchor_upper_bound bci_action_serif_anchor_lower_bound + 1 #define bci_action_serif_anchor_upper_lower_bound bci_action_serif_anchor_upper_bound + 1 -/* 95 */ +/* 99 */ #define bci_action_serif_link1 bci_action_serif_anchor_upper_lower_bound + 1 #define bci_action_serif_link1_lower_bound bci_action_serif_link1 + 1 #define bci_action_serif_link1_upper_bound bci_action_serif_link1_lower_bound + 1 #define bci_action_serif_link1_upper_lower_bound bci_action_serif_link1_upper_bound + 1 -/* 99 */ +/* 103 */ #define bci_action_serif_link2 bci_action_serif_link1_upper_lower_bound + 1 #define bci_action_serif_link2_lower_bound bci_action_serif_link2 + 1 #define bci_action_serif_link2_upper_bound bci_action_serif_link2_lower_bound + 1 #define bci_action_serif_link2_upper_lower_bound bci_action_serif_link2_upper_bound + 1 -/* 103 */ +/* 107 */ #define bci_hint_glyph bci_action_serif_link2_upper_lower_bound + 1 #define NUM_FDEFS bci_hint_glyph + 1 /* must be last */ @@ -479,7 +491,10 @@ #define cvtl_funits_to_pixels cvtl_scale + 1 #define cvtl_is_extra_light cvtl_funits_to_pixels + 1 #define cvtl_is_subglyph cvtl_is_extra_light + 1 -#define cvtl_max_runtime cvtl_is_subglyph + 1 /* must be last */ +#define cvtl_stem_width_function cvtl_is_subglyph + 1 +#define cvtl_is_element cvtl_stem_width_function + 1 + +#define cvtl_max_runtime cvtl_is_element + 1 /* must be last */ /* symbolic names for compile-time CVT locations */ /* (assigned in `cvt') */ @@ -493,7 +508,7 @@ #define CVT_HORZ_WIDTHS_OFFSET(font) \ CVT_VERT_STANDARD_WIDTH_OFFSET(font) + 1 #define CVT_HORZ_WIDTHS_SIZE(font) \ - ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_NONE) \ + ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_DUMMY) \ ? 0 \ : ((TA_LatinMetrics)font->loader->hints.metrics)->axis[0].width_count) @@ -501,15 +516,15 @@ #define CVT_VERT_WIDTHS_OFFSET(font) \ CVT_HORZ_WIDTHS_OFFSET(font) + CVT_HORZ_WIDTHS_SIZE(font) #define CVT_VERT_WIDTHS_SIZE(font) \ - ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_NONE) \ + ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_DUMMY) \ ? 0 \ : ((TA_LatinMetrics)font->loader->hints.metrics)->axis[1].width_count) -/* the number of blue zones */ +/* the number of blue zones (including the artificial ones) */ #define CVT_BLUES_SIZE(font) \ - ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_NONE) \ + ((font->loader->hints.metrics->clazz->script == TA_SCRIPT_DUMMY) \ ? 0 \ - : ((TA_LatinMetrics)font->loader->hints.metrics)->axis[1].blue_count) + : ((TA_LatinMetrics)font->loader->hints.metrics)->axis[1].blue_count + 2) /* the blue zone values for flat and round edges */ #define CVT_BLUE_REFS_OFFSET(font) \ @@ -517,6 +532,9 @@ #define CVT_BLUE_SHOOTS_OFFSET(font) \ CVT_BLUE_REFS_OFFSET(font) + CVT_BLUES_SIZE(font) + +extern FT_Byte ttfautohint_glyph_bytecode[7]; + #endif /* __TABYTECODE_H__ */ /* end of tabytecode.h */ diff -Nru ttfautohint-0.9/lib/tacvt.c ttfautohint-0.94/lib/tacvt.c --- ttfautohint-0.9/lib/tacvt.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tacvt.c 2012-11-11 18:29:22.000000000 +0000 @@ -23,15 +23,21 @@ FT_Error error; FT_Face face = sfnt->face; FT_UInt idx; + FT_Int32 load_flags; - error = ta_loader_init(font->loader); - if (error) - return error; - error = FT_Select_Charmap(face, FT_ENCODING_UNICODE); if (error) - return TA_Err_Missing_Unicode_CMap; + { + if (font->symbol) + { + error = FT_Select_Charmap(face, FT_ENCODING_MS_SYMBOL); + if (error) + return TA_Err_Missing_Symbol_CMap; + } + else + return TA_Err_Missing_Unicode_CMap; + } if (font->symbol) idx = 0; @@ -45,8 +51,8 @@ return TA_Err_Missing_Glyph; } - error = ta_loader_load_glyph(font->loader, face, idx, - font->fallback_script << 30); + load_flags = 1 << 29; /* vertical hinting only */ + error = ta_loader_load_glyph(font, face, idx, load_flags); return error; } @@ -78,7 +84,7 @@ if (error) return error; - if (font->loader->hints.metrics->clazz->script == TA_SCRIPT_NONE) + if (font->loader->hints.metrics->clazz->script == TA_SCRIPT_DUMMY) { haxis = NULL; vaxis = NULL; @@ -94,7 +100,7 @@ hwidth_count = haxis->width_count; vwidth_count = vaxis->width_count; - blue_count = vaxis->blue_count; + blue_count = vaxis->blue_count + 2; /* with artificial blue zones */ } buf_len = 2 * (cvtl_max_runtime /* runtime values */ @@ -192,7 +198,10 @@ TA_sfnt_build_cvt_table(SFNT* sfnt, FONT* font) { - FT_Error error; + FT_Error error = FT_Err_Ok; + + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; FT_Byte* cvt_buf; FT_ULong cvt_len; @@ -200,11 +209,18 @@ error = TA_sfnt_add_table_info(sfnt); if (error) - return error; + goto Exit; + + /* `glyf', `cvt', `fpgm', and `prep' are always used in parallel */ + if (glyf_table->processed) + { + sfnt->table_infos[sfnt->num_table_infos - 1] = data->cvt_idx; + goto Exit; + } error = TA_table_build_cvt(&cvt_buf, &cvt_len, sfnt, font); if (error) - return error; + goto Exit; /* in case of success, `cvt_buf' gets linked */ /* and is eventually freed in `TA_font_unload' */ @@ -212,12 +228,12 @@ &sfnt->table_infos[sfnt->num_table_infos - 1], TTAG_cvt, cvt_len, cvt_buf); if (error) - { free(cvt_buf); - return error; - } + else + data->cvt_idx = sfnt->table_infos[sfnt->num_table_infos - 1]; - return FT_Err_Ok; +Exit: + return error; } /* end of tacvt.c */ diff -Nru ttfautohint-0.9/lib/tadummy.c ttfautohint-0.94/lib/tadummy.c --- ttfautohint-0.9/lib/tadummy.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tadummy.c 2012-11-11 18:29:05.000000000 +0000 @@ -43,8 +43,9 @@ const TA_ScriptClassRec ta_dummy_script_class = { - TA_SCRIPT_NONE, + TA_SCRIPT_DUMMY, NULL, + 0, sizeof (TA_ScriptMetricsRec), diff -Nru ttfautohint-0.9/lib/tafile.c ttfautohint-0.94/lib/tafile.c --- ttfautohint-0.9/lib/tafile.c 2012-05-10 05:23:47.000000000 +0000 +++ ttfautohint-0.94/lib/tafile.c 2012-11-11 18:29:05.000000000 +0000 @@ -16,25 +16,46 @@ #include "ta.h" +#define BUF_SIZE 0x10000 + FT_Error TA_font_file_read(FONT* font, FILE* in_file) { - fseek(in_file, 0, SEEK_END); - font->in_len = ftell(in_file); - fseek(in_file, 0, SEEK_SET); + FT_Byte buf[BUF_SIZE]; + size_t in_len = 0; + size_t read_bytes; - /* a valid TTF can never be that small */ - if (font->in_len < 100) - return TA_Err_Invalid_Font_Type; - font->in_buf = (FT_Byte*)malloc(font->in_len); + font->in_buf = (FT_Byte*)malloc(BUF_SIZE); if (!font->in_buf) return FT_Err_Out_Of_Memory; - if (fread(font->in_buf, 1, font->in_len, in_file) != font->in_len) + while ((read_bytes = fread(buf, 1, BUF_SIZE, in_file)) > 0) + { + FT_Byte* in_buf_new; + + + in_buf_new = (FT_Byte*)realloc(font->in_buf, in_len + read_bytes); + if (!in_buf_new) + return FT_Err_Out_Of_Memory; + else + font->in_buf = in_buf_new; + + memcpy(font->in_buf + in_len, buf, read_bytes); + + in_len += read_bytes; + } + + if (ferror(in_file)) return FT_Err_Invalid_Stream_Read; + /* a valid TTF can never be that small */ + if (in_len < 100) + return TA_Err_Invalid_Font_Type; + + font->in_len = in_len; + return TA_Err_Ok; } diff -Nru ttfautohint-0.9/lib/tafont.c ttfautohint-0.94/lib/tafont.c --- ttfautohint-0.9/lib/tafont.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tafont.c 2012-11-19 10:38:36.000000000 +0000 @@ -61,7 +61,7 @@ return; if (font->loader) - ta_loader_done(font->loader); + ta_loader_done(font); if (font->tables) { @@ -107,6 +107,8 @@ free(font->sfnts); } + number_set_free(font->x_height_snapping_exceptions); + FT_Done_FreeType(font->lib); if (!in_buf) free(font->in_buf); diff -Nru ttfautohint-0.9/lib/tafpgm.c ttfautohint-0.94/lib/tafpgm.c --- ttfautohint-0.9/lib/tafpgm.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tafpgm.c 2012-11-22 20:40:03.000000000 +0000 @@ -84,19 +84,10 @@ bci_round, FDEF, - DUP, - ABS, PUSHB_1, 32, ADD, FLOOR, - SWAP, - PUSHB_1, - 0, - LT, - IF, - NEG, - EIF, ENDF, @@ -104,7 +95,7 @@ /* - * bci_compute_stem_width + * bci_smooth_stem_width * * This is the equivalent to the following code from function * `ta_latin_compute_stem_width': @@ -161,11 +152,11 @@ * std_width */ -unsigned char FPGM(bci_compute_stem_width_a) [] = +unsigned char FPGM(bci_smooth_stem_width_a) [] = { PUSHB_1, - bci_compute_stem_width, + bci_smooth_stem_width, FDEF, DUP, @@ -223,7 +214,7 @@ /* %c, index of std_width */ -unsigned char FPGM(bci_compute_stem_width_b) [] = +unsigned char FPGM(bci_smooth_stem_width_b) [] = { RCVT, @@ -241,7 +232,7 @@ /* %c, index of std_width */ -unsigned char FPGM(bci_compute_stem_width_c) [] = +unsigned char FPGM(bci_smooth_stem_width_c) [] = { RCVT, /* dist = std_width */ @@ -327,6 +318,209 @@ /* + * bci_get_best_width + * + * An auxiliary function for `bci_strong_stem_width'. + * + * in: n (initialized with CVT index for first vertical width) + * dist + * + * out: n+1 + * dist + * + * CVT: widths[] + * + * sal: sal_best + * sal_ref + */ + +unsigned char FPGM(bci_get_best_width) [] = +{ + + PUSHB_1, + bci_get_best_width, + FDEF, + + DUP, + RCVT, /* s: dist n w */ + DUP, + PUSHB_1, + 4, + CINDEX, /* s: dist n w w dist */ + SUB, + ABS, /* s: dist n w d */ + DUP, + PUSHB_1, + sal_best, + RS, /* s: dist n w d d best */ + LT, /* d < best */ + IF, + PUSHB_1, + sal_best, + SWAP, + WS, /* best = d */ + PUSHB_1, + sal_ref, + SWAP, + WS, /* reference = w */ + + ELSE, + POP, + POP, + EIF, + + PUSHB_1, + 1, + ADD, /* n = n + 1 */ + + ENDF, + +}; + + +/* + * bci_strong_stem_width + * + * This is the equivalent to the following code (function + * `ta_latin_snap_width' and some lines from + * `ta_latin_compute_stem_width'): + * + * best = 64 + 32 + 2; + * reference = width + * dist = ABS(width) + * + * for n in 0 .. num_widths: + * w = widths[n] + * d = ABS(dist - w) + * + * if d < best: + * best = d + * reference = w; + * + * if dist >= reference: + * if dist < ROUND(reference) + 48: + * dist = reference + * else + * if dist > ROUND(reference) - 48: + * dist = reference + * + * if dist >= 64: + * dist = ROUND(dist) + * else + * dist = 64 + * + * if width < 0: + * dist = -dist + * return dist + * + * in: width + * stem_is_serif (unused) + * base_is_round (unused) + * + * out: new_width + * + * CVT: widths[] + */ + +unsigned char FPGM(bci_strong_stem_width_a) [] = +{ + + PUSHB_1, + bci_strong_stem_width, + FDEF, + + SWAP, + POP, + SWAP, + POP, + DUP, + ABS, /* s: width dist */ + + PUSHB_2, + sal_best, + 64 + 32 + 2, + WS, /* sal_best = 98 */ + + DUP, + PUSHB_1, + sal_ref, + SWAP, + WS, /* sal_ref = width */ + + PUSHB_3, +}; + +/* %c, first index of vertical widths */ +/* %c, number of vertical widths */ + +unsigned char FPGM(bci_strong_stem_width_b) [] = +{ + + bci_get_best_width, + LOOPCALL, + + POP, /* s: width dist */ + DUP, + PUSHB_1, + sal_ref, + RS, /* s: width dist dist reference */ + DUP, + ROLL, + DUP, + ROLL, + PUSHB_1, + bci_round, + CALL, /* s: width dist reference dist dist ROUND(reference) */ + PUSHB_2, + 48, + 5, + CINDEX, + ROLL, /* s: width dist reference dist ROUND(reference) 48 reference dist */ + + LTEQ, /* dist >= reference */ + IF, /* s: width dist reference dist ROUND(reference) 48 */ + ADD, + LT, /* dist < ROUND(reference) + 48 */ + + ELSE, + SUB, + GT, /* dist > ROUND(reference) - 48 */ + EIF, + + IF, + SWAP, /* s: width reference dist */ + EIF, + POP, + + DUP, + PUSHB_1, + 64, + GTEQ, /* dist >= 64 */ + IF, + PUSHB_1, + bci_round, + CALL, /* dist = ROUND(dist) */ + + ELSE, + POP, + PUSHB_1, + 64, /* dist = 64 */ + EIF, + + SWAP, /* s: dist width */ + PUSHB_1, + 0, + LT, /* width < 0 */ + IF, + NEG, /* dist = -dist */ + EIF, + + ENDF, + +}; + + +/* * bci_loop * * Take a range and a function number and apply the function to all @@ -673,6 +867,100 @@ /* + * bci_number_set_is_element + * + * Pop values from stack until it is empty. If one of them is equal to + * the current PPEM value, set `cvtl_is_element' to 1 (and to 0 + * otherwise). + * + * in: ppem_value_1 + * ppem_value_2 + * ... + * + * CVT: cvtl_is_element + */ + +unsigned char FPGM(bci_number_set_is_element) [] = +{ + + PUSHB_1, + bci_number_set_is_element, + FDEF, + +/* start_loop: */ + MPPEM, + EQ, + IF, + PUSHB_2, + cvtl_is_element, + 1, + WCVTP, + EIF, + + DEPTH, + PUSHB_1, + 13, + NEG, + SWAP, + JROT, /* goto start_loop if stack depth != 0 */ + + ENDF, + +}; + + +/* + * bci_number_set_is_element2 + * + * Pop value ranges from stack until it is empty. If one of them contains + * the current PPEM value, set `cvtl_is_element' to 1 (and to 0 + * otherwise). + * + * in: ppem_range_1_start + * ppem_range_1_end + * ppem_range_2_start + * ppem_range_2_end + * ... + * + * CVT: cvtl_is_element + */ + +unsigned char FPGM(bci_number_set_is_element2) [] = +{ + + PUSHB_1, + bci_number_set_is_element2, + FDEF, + +/* start_loop: */ + MPPEM, + LTEQ, + IF, + MPPEM, + GTEQ, + IF, + PUSHB_2, + cvtl_is_element, + 1, + WCVTP, + EIF, + ELSE, + POP, + EIF, + + DEPTH, + PUSHB_1, + 19, + NEG, + SWAP, + JROT, /* goto start_loop if stack depth != 0 */ + + ENDF, + +}; + + +/* * bci_create_segment * * Store start and end point of a segment in the storage area, @@ -1958,11 +2246,18 @@ PUSHB_1, 2, CINDEX, /* s: ... before after before after */ - MD_cur, /* b = after_pos - before_pos */ + MD_cur, /* a = after_pos - before_pos */ ROLL, ROLL, - MD_orig_ZP2_0, /* a = after_orig_pos - before_orig_pos */ - DIV, /* s: a/b */ + MD_orig_ZP2_0, /* b = after_orig_pos - before_orig_pos */ + + DUP, + IF, /* b != 0 ? */ + DIV, /* s: a/b */ + ELSE, + POP, /* avoid division by zero */ + EIF, + PUSHB_1, sal_j, SWAP, @@ -2215,7 +2510,8 @@ MD_orig_ZP2_0, /* s: [...] edge2 edge is_round is_serif org_len */ PUSHB_1, - bci_compute_stem_width, + cvtl_stem_width_function, + RCVT, CALL, NEG, /* s: [...] edge2 edge -cur_len */ @@ -2526,7 +2822,8 @@ WS, PUSHB_1, - bci_compute_stem_width, + cvtl_stem_width_function, + RCVT, CALL, /* s: [...] edge2 edge cur_len */ DUP, @@ -3097,7 +3394,8 @@ MD_orig_ZP2_0, /* s: stem is_round is_serif dist_orig */ PUSHB_1, - bci_compute_stem_width, + cvtl_stem_width_function, + RCVT, CALL, /* s: stem new_dist */ SWAP, @@ -3284,7 +3582,8 @@ WS, PUSHB_1, - bci_compute_stem_width, + cvtl_stem_width_function, + RCVT, CALL, /* s: edge2 edge cur_len */ DUP, @@ -4157,7 +4456,13 @@ RCVT, MUL, /* (b-c) in 16.16 format */ SWAP, - DIV, /* s: [...] after edge before a a (b-c)/c */ + + DUP, + IF, /* c != 0 ? */ + DIV, /* s: [...] after edge before a a (b-c)/c */ + ELSE, + POP, /* avoid division by zero */ + EIF, MUL, /* a * (b-c)/c * 2^10 */ PUSHB_1, @@ -4641,12 +4946,22 @@ FT_Byte* buf_p; + /* for compatibility with dumb bytecode interpreters or analyzers, */ + /* FDEFs are stored in ascending index order, without holes -- */ + /* note that some FDEFs are not always needed */ + /* (depending on options of `TTFautohint'), */ + /* but implementing dynamic FDEF indices would be a lot of work */ + buf_len = sizeof (FPGM(bci_round)) - + sizeof (FPGM(bci_compute_stem_width_a)) + + sizeof (FPGM(bci_smooth_stem_width_a)) + 1 - + sizeof (FPGM(bci_compute_stem_width_b)) + + sizeof (FPGM(bci_smooth_stem_width_b)) + 1 - + sizeof (FPGM(bci_compute_stem_width_c)) + + sizeof (FPGM(bci_smooth_stem_width_c)) + + sizeof (FPGM(bci_get_best_width)) + + sizeof (FPGM(bci_strong_stem_width_a)) + + 2 + + sizeof (FPGM(bci_strong_stem_width_b)) + sizeof (FPGM(bci_loop)) + sizeof (FPGM(bci_cvt_rescale)) + sizeof (FPGM(bci_blue_round_a)) @@ -4655,9 +4970,12 @@ + sizeof (FPGM(bci_decrement_component_counter)) + sizeof (FPGM(bci_get_point_extrema)) + sizeof (FPGM(bci_nibbles)) + + sizeof (FPGM(bci_number_set_is_element)) + + sizeof (FPGM(bci_number_set_is_element2)) + sizeof (FPGM(bci_create_segment)) + sizeof (FPGM(bci_create_segments)) + + sizeof (FPGM(bci_create_segments_0)) + sizeof (FPGM(bci_create_segments_1)) + sizeof (FPGM(bci_create_segments_2)) @@ -4668,7 +4986,9 @@ + sizeof (FPGM(bci_create_segments_7)) + sizeof (FPGM(bci_create_segments_8)) + sizeof (FPGM(bci_create_segments_9)) + + sizeof (FPGM(bci_create_segments_composite)) + + sizeof (FPGM(bci_create_segments_composite_0)) + sizeof (FPGM(bci_create_segments_composite_1)) + sizeof (FPGM(bci_create_segments_composite_2)) @@ -4679,6 +4999,7 @@ + sizeof (FPGM(bci_create_segments_composite_7)) + sizeof (FPGM(bci_create_segments_composite_8)) + sizeof (FPGM(bci_create_segments_composite_9)) + + sizeof (FPGM(bci_align_segment)) + sizeof (FPGM(bci_align_segments)) @@ -4704,55 +5025,64 @@ + sizeof (FPGM(bci_upper_bound)) + sizeof (FPGM(bci_upper_lower_bound)) + + sizeof (FPGM(bci_adjust_bound)) + + sizeof (FPGM(bci_stem_bound)) + + sizeof (FPGM(bci_link)) + + sizeof (FPGM(bci_anchor)) + + sizeof (FPGM(bci_adjust)) + + sizeof (FPGM(bci_stem)) + + sizeof (FPGM(bci_action_ip_before)) + sizeof (FPGM(bci_action_ip_after)) + sizeof (FPGM(bci_action_ip_on)) + sizeof (FPGM(bci_action_ip_between)) - + sizeof (FPGM(bci_adjust_bound)) - + sizeof (FPGM(bci_action_adjust_bound)) - + sizeof (FPGM(bci_action_adjust_bound_serif)) - + sizeof (FPGM(bci_action_adjust_bound_round)) - + sizeof (FPGM(bci_action_adjust_bound_round_serif)) - + sizeof (FPGM(bci_stem_bound)) - + sizeof (FPGM(bci_action_stem_bound)) - + sizeof (FPGM(bci_action_stem_bound_serif)) - + sizeof (FPGM(bci_action_stem_bound_round)) - + sizeof (FPGM(bci_action_stem_bound_round_serif)) - + sizeof (FPGM(bci_link)) - + sizeof (FPGM(bci_action_link)) - + sizeof (FPGM(bci_action_link_serif)) - + sizeof (FPGM(bci_action_link_round)) - + sizeof (FPGM(bci_action_link_round_serif)) - + sizeof (FPGM(bci_anchor)) + + sizeof (FPGM(bci_action_blue)) + + sizeof (FPGM(bci_action_blue_anchor)) + + sizeof (FPGM(bci_action_anchor)) + sizeof (FPGM(bci_action_anchor_serif)) + sizeof (FPGM(bci_action_anchor_round)) + sizeof (FPGM(bci_action_anchor_round_serif)) - + sizeof (FPGM(bci_action_blue_anchor)) - + sizeof (FPGM(bci_adjust)) + + sizeof (FPGM(bci_action_adjust)) + sizeof (FPGM(bci_action_adjust_serif)) + sizeof (FPGM(bci_action_adjust_round)) + sizeof (FPGM(bci_action_adjust_round_serif)) - + sizeof (FPGM(bci_stem)) + + sizeof (FPGM(bci_action_adjust_bound)) + + sizeof (FPGM(bci_action_adjust_bound_serif)) + + sizeof (FPGM(bci_action_adjust_bound_round)) + + sizeof (FPGM(bci_action_adjust_bound_round_serif)) + + + sizeof (FPGM(bci_action_link)) + + sizeof (FPGM(bci_action_link_serif)) + + sizeof (FPGM(bci_action_link_round)) + + sizeof (FPGM(bci_action_link_round_serif)) + + sizeof (FPGM(bci_action_stem)) + sizeof (FPGM(bci_action_stem_serif)) + sizeof (FPGM(bci_action_stem_round)) + sizeof (FPGM(bci_action_stem_round_serif)) - + sizeof (FPGM(bci_action_blue)) + + sizeof (FPGM(bci_action_stem_bound)) + + sizeof (FPGM(bci_action_stem_bound_serif)) + + sizeof (FPGM(bci_action_stem_bound_round)) + + sizeof (FPGM(bci_action_stem_bound_round_serif)) + + sizeof (FPGM(bci_action_serif)) + sizeof (FPGM(bci_action_serif_lower_bound)) + sizeof (FPGM(bci_action_serif_upper_bound)) + sizeof (FPGM(bci_action_serif_upper_lower_bound)) + + sizeof (FPGM(bci_action_serif_anchor)) + sizeof (FPGM(bci_action_serif_anchor_lower_bound)) + sizeof (FPGM(bci_action_serif_anchor_upper_bound)) + sizeof (FPGM(bci_action_serif_anchor_upper_lower_bound)) + + sizeof (FPGM(bci_action_serif_link1)) + sizeof (FPGM(bci_action_serif_link1_lower_bound)) + sizeof (FPGM(bci_action_serif_link1_upper_bound)) + sizeof (FPGM(bci_action_serif_link1_upper_lower_bound)) + + sizeof (FPGM(bci_action_serif_link2)) + sizeof (FPGM(bci_action_serif_link2_lower_bound)) + sizeof (FPGM(bci_action_serif_link2_upper_bound)) @@ -4775,11 +5105,16 @@ buf_p = buf; COPY_FPGM(bci_round); - COPY_FPGM(bci_compute_stem_width_a); + COPY_FPGM(bci_smooth_stem_width_a); *(buf_p++) = (unsigned char)CVT_VERT_WIDTHS_OFFSET(font); - COPY_FPGM(bci_compute_stem_width_b); + COPY_FPGM(bci_smooth_stem_width_b); *(buf_p++) = (unsigned char)CVT_VERT_WIDTHS_OFFSET(font); - COPY_FPGM(bci_compute_stem_width_c); + COPY_FPGM(bci_smooth_stem_width_c); + COPY_FPGM(bci_get_best_width); + COPY_FPGM(bci_strong_stem_width_a); + *(buf_p++) = (unsigned char)CVT_VERT_WIDTHS_OFFSET(font); + *(buf_p++) = (unsigned char)CVT_VERT_WIDTHS_SIZE(font); + COPY_FPGM(bci_strong_stem_width_b); COPY_FPGM(bci_loop); COPY_FPGM(bci_cvt_rescale); COPY_FPGM(bci_blue_round_a); @@ -4788,9 +5123,12 @@ COPY_FPGM(bci_decrement_component_counter); COPY_FPGM(bci_get_point_extrema); COPY_FPGM(bci_nibbles); + COPY_FPGM(bci_number_set_is_element); + COPY_FPGM(bci_number_set_is_element2); COPY_FPGM(bci_create_segment); COPY_FPGM(bci_create_segments); + COPY_FPGM(bci_create_segments_0); COPY_FPGM(bci_create_segments_1); COPY_FPGM(bci_create_segments_2); @@ -4801,7 +5139,9 @@ COPY_FPGM(bci_create_segments_7); COPY_FPGM(bci_create_segments_8); COPY_FPGM(bci_create_segments_9); + COPY_FPGM(bci_create_segments_composite); + COPY_FPGM(bci_create_segments_composite_0); COPY_FPGM(bci_create_segments_composite_1); COPY_FPGM(bci_create_segments_composite_2); @@ -4812,6 +5152,7 @@ COPY_FPGM(bci_create_segments_composite_7); COPY_FPGM(bci_create_segments_composite_8); COPY_FPGM(bci_create_segments_composite_9); + COPY_FPGM(bci_align_segment); COPY_FPGM(bci_align_segments); @@ -4837,55 +5178,64 @@ COPY_FPGM(bci_upper_bound); COPY_FPGM(bci_upper_lower_bound); + COPY_FPGM(bci_adjust_bound); + COPY_FPGM(bci_stem_bound); + COPY_FPGM(bci_link); + COPY_FPGM(bci_anchor); + COPY_FPGM(bci_adjust); + COPY_FPGM(bci_stem); + COPY_FPGM(bci_action_ip_before); COPY_FPGM(bci_action_ip_after); COPY_FPGM(bci_action_ip_on); COPY_FPGM(bci_action_ip_between); - COPY_FPGM(bci_adjust_bound); - COPY_FPGM(bci_action_adjust_bound); - COPY_FPGM(bci_action_adjust_bound_serif); - COPY_FPGM(bci_action_adjust_bound_round); - COPY_FPGM(bci_action_adjust_bound_round_serif); - COPY_FPGM(bci_stem_bound); - COPY_FPGM(bci_action_stem_bound); - COPY_FPGM(bci_action_stem_bound_serif); - COPY_FPGM(bci_action_stem_bound_round); - COPY_FPGM(bci_action_stem_bound_round_serif); - COPY_FPGM(bci_link); - COPY_FPGM(bci_action_link); - COPY_FPGM(bci_action_link_serif); - COPY_FPGM(bci_action_link_round); - COPY_FPGM(bci_action_link_round_serif); - COPY_FPGM(bci_anchor); + COPY_FPGM(bci_action_blue); + COPY_FPGM(bci_action_blue_anchor); + COPY_FPGM(bci_action_anchor); COPY_FPGM(bci_action_anchor_serif); COPY_FPGM(bci_action_anchor_round); COPY_FPGM(bci_action_anchor_round_serif); - COPY_FPGM(bci_action_blue_anchor); - COPY_FPGM(bci_adjust); + COPY_FPGM(bci_action_adjust); COPY_FPGM(bci_action_adjust_serif); COPY_FPGM(bci_action_adjust_round); COPY_FPGM(bci_action_adjust_round_serif); - COPY_FPGM(bci_stem); + COPY_FPGM(bci_action_adjust_bound); + COPY_FPGM(bci_action_adjust_bound_serif); + COPY_FPGM(bci_action_adjust_bound_round); + COPY_FPGM(bci_action_adjust_bound_round_serif); + + COPY_FPGM(bci_action_link); + COPY_FPGM(bci_action_link_serif); + COPY_FPGM(bci_action_link_round); + COPY_FPGM(bci_action_link_round_serif); + COPY_FPGM(bci_action_stem); COPY_FPGM(bci_action_stem_serif); COPY_FPGM(bci_action_stem_round); COPY_FPGM(bci_action_stem_round_serif); - COPY_FPGM(bci_action_blue); + COPY_FPGM(bci_action_stem_bound); + COPY_FPGM(bci_action_stem_bound_serif); + COPY_FPGM(bci_action_stem_bound_round); + COPY_FPGM(bci_action_stem_bound_round_serif); + COPY_FPGM(bci_action_serif); COPY_FPGM(bci_action_serif_lower_bound); COPY_FPGM(bci_action_serif_upper_bound); COPY_FPGM(bci_action_serif_upper_lower_bound); + COPY_FPGM(bci_action_serif_anchor); COPY_FPGM(bci_action_serif_anchor_lower_bound); COPY_FPGM(bci_action_serif_anchor_upper_bound); COPY_FPGM(bci_action_serif_anchor_upper_lower_bound); + COPY_FPGM(bci_action_serif_link1); COPY_FPGM(bci_action_serif_link1_lower_bound); COPY_FPGM(bci_action_serif_link1_upper_bound); COPY_FPGM(bci_action_serif_link1_upper_lower_bound); + COPY_FPGM(bci_action_serif_link2); COPY_FPGM(bci_action_serif_link2_lower_bound); COPY_FPGM(bci_action_serif_link2_upper_bound); @@ -4904,7 +5254,10 @@ TA_sfnt_build_fpgm_table(SFNT* sfnt, FONT* font) { - FT_Error error; + FT_Error error = FT_Err_Ok; + + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; FT_Byte* fpgm_buf; FT_ULong fpgm_len; @@ -4912,11 +5265,18 @@ error = TA_sfnt_add_table_info(sfnt); if (error) - return error; + goto Exit; + + /* `glyf', `cvt', `fpgm', and `prep' are always used in parallel */ + if (glyf_table->processed) + { + sfnt->table_infos[sfnt->num_table_infos - 1] = data->fpgm_idx; + goto Exit; + } error = TA_table_build_fpgm(&fpgm_buf, &fpgm_len, font); if (error) - return error; + goto Exit; if (fpgm_len > sfnt->max_instructions) sfnt->max_instructions = fpgm_len; @@ -4927,12 +5287,12 @@ &sfnt->table_infos[sfnt->num_table_infos - 1], TTAG_fpgm, fpgm_len, fpgm_buf); if (error) - { free(fpgm_buf); - return error; - } + else + data->fpgm_idx = sfnt->table_infos[sfnt->num_table_infos - 1]; - return FT_Err_Ok; +Exit: + return error; } /* end of tafpgm.c */ diff -Nru ttfautohint-0.9/lib/tagasp.c ttfautohint-0.94/lib/tagasp.c --- ttfautohint-0.9/lib/tagasp.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tagasp.c 2012-11-11 18:29:05.000000000 +0000 @@ -51,18 +51,24 @@ TA_sfnt_build_gasp_table(SFNT* sfnt, FONT* font) { - FT_Error error; + FT_Error error = FT_Err_Ok; FT_Byte* gasp_buf; error = TA_sfnt_add_table_info(sfnt); if (error) - return error; + goto Exit; + + if (font->gasp_idx != MISSING) + { + sfnt->table_infos[sfnt->num_table_infos - 1] = font->gasp_idx; + goto Exit; + } error = TA_table_build_gasp(&gasp_buf); if (error) - return error; + goto Exit; /* in case of success, `gasp_buf' gets linked */ /* and is eventually freed in `TA_font_unload' */ @@ -70,12 +76,12 @@ &sfnt->table_infos[sfnt->num_table_infos - 1], TTAG_gasp, GASP_LEN, gasp_buf); if (error) - { free(gasp_buf); - return error; - } + else + font->gasp_idx = sfnt->table_infos[sfnt->num_table_infos - 1]; - return FT_Err_Ok; +Exit: + return error; } /* end of tagasp.c */ diff -Nru ttfautohint-0.9/lib/taglobal.c ttfautohint-0.94/lib/taglobal.c --- ttfautohint-0.9/lib/taglobal.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/taglobal.c 2012-11-11 18:29:05.000000000 +0000 @@ -49,29 +49,10 @@ }; -/* a bit mask indicating an uncovered glyph */ -#define TA_SCRIPT_LIST_NONE 0x7F -/* if this flag is set, we have an ASCII digit */ -#define TA_DIGIT 0x80 - - -/* note that glyph_scripts[] is used to map each glyph into */ -/* an index into the `ta_script_classes' array. */ -typedef struct TA_FaceGlobalsRec_ -{ - FT_Face face; - FT_Long glyph_count; /* same as face->num_glyphs */ - FT_Byte* glyph_scripts; - - TA_ScriptMetrics metrics[TA_SCRIPT_MAX]; -} TA_FaceGlobalsRec; - - /* Compute the script index of each glyph within a given face. */ static FT_Error -ta_face_globals_compute_script_coverage(TA_FaceGlobals globals, - FT_UInt fallback_script) +ta_face_globals_compute_script_coverage(TA_FaceGlobals globals) { FT_Error error = FT_Err_Ok; FT_Face face = globals->face; @@ -81,8 +62,8 @@ FT_UInt i; - /* the value TA_SCRIPT_LIST_NONE means `uncovered glyph' */ - memset(globals->glyph_scripts, TA_SCRIPT_LIST_NONE, globals->glyph_count); + /* the value TA_SCRIPT_NONE means `uncovered glyph' */ + memset(globals->glyph_scripts, TA_SCRIPT_NONE, globals->glyph_count); error = FT_Select_Charmap(face, FT_ENCODING_UNICODE); if (error) @@ -115,7 +96,7 @@ if (gindex != 0 && gindex < (FT_ULong)globals->glyph_count - && gscripts[gindex] == TA_SCRIPT_LIST_NONE) + && gscripts[gindex] == TA_SCRIPT_NONE) gscripts[gindex] = (FT_Byte)ss; for (;;) @@ -126,7 +107,7 @@ break; if (gindex < (FT_ULong)globals->glyph_count - && gscripts[gindex] == TA_SCRIPT_LIST_NONE) + && gscripts[gindex] == TA_SCRIPT_NONE) gscripts[gindex] = (FT_Byte)ss; } } @@ -146,16 +127,17 @@ Exit: /* by default, all uncovered glyphs are set to the fallback script */ /* XXX: Shouldn't we disable hinting or do something similar? */ + if (globals->font->fallback_script != TA_SCRIPT_NONE) { FT_Long nn; for (nn = 0; nn < globals->glyph_count; nn++) { - if ((gscripts[nn] & ~TA_DIGIT) == TA_SCRIPT_LIST_NONE) + if ((gscripts[nn] & ~TA_DIGIT) == TA_SCRIPT_NONE) { - gscripts[nn] &= ~TA_SCRIPT_LIST_NONE; - gscripts[nn] |= fallback_script; + gscripts[nn] &= ~TA_SCRIPT_NONE; + gscripts[nn] |= globals->font->fallback_script; } } } @@ -168,7 +150,7 @@ FT_Error ta_face_globals_new(FT_Face face, TA_FaceGlobals *aglobals, - FT_UInt fallback_script) + FONT* font) { FT_Error error; TA_FaceGlobals globals; @@ -185,14 +167,17 @@ globals->face = face; globals->glyph_count = face->num_glyphs; globals->glyph_scripts = (FT_Byte*)(globals + 1); + globals->font = font; - error = ta_face_globals_compute_script_coverage(globals, fallback_script); + error = ta_face_globals_compute_script_coverage(globals); if (error) { ta_face_globals_free(globals); globals = NULL; } + globals->increase_x_height = TA_PROP_INCREASE_X_HEIGHT_MAX; + Err: *aglobals = globals; return error; @@ -260,7 +245,7 @@ gidx = script; if (gidx == 0 || gidx + 1 >= script_max) - gidx = globals->glyph_scripts[gindex] & TA_SCRIPT_LIST_NONE; + gidx = globals->glyph_scripts[gindex] & TA_SCRIPT_NONE; clazz = ta_script_classes[gidx]; if (script == 0) @@ -278,6 +263,7 @@ } metrics->clazz = clazz; + metrics->globals = globals; if (clazz->script_metrics_init) { diff -Nru ttfautohint-0.9/lib/taglobal.h ttfautohint-0.94/lib/taglobal.h --- ttfautohint-0.9/lib/taglobal.h 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/taglobal.h 2012-11-11 18:29:05.000000000 +0000 @@ -20,17 +20,50 @@ #ifndef __TAGLOBAL_H__ #define __TAGLOBAL_H__ +#include "ta.h" #include "tatypes.h" +/* Default values and flags for both autofitter globals */ +/* (originally found in AF_ModuleRec, we use FONT instead) */ +/* and face globals (in TA_FaceGlobalsRec). */ + +/* index of fallback script in `ta_script_classes' */ +#define TA_SCRIPT_FALLBACK 0 +/* a bit mask indicating an uncovered glyph */ +#define TA_SCRIPT_NONE 0x7F +/* if this flag is set, we have an ASCII digit */ +#define TA_DIGIT 0x80 + +/* `increase-x-height' property */ +#define TA_PROP_INCREASE_X_HEIGHT_MIN 6 +#define TA_PROP_INCREASE_X_HEIGHT_MAX 0 + + +/* note that glyph_scripts[] is used to map each glyph into */ +/* an index into the `ta_script_classes' array. */ +typedef struct TA_FaceGlobalsRec_ +{ + FT_Face face; + FT_Long glyph_count; /* same as face->num_glyphs */ + FT_Byte* glyph_scripts; + + /* per-face auto-hinter properties */ + FT_UInt increase_x_height; + + TA_ScriptMetrics metrics[TA_SCRIPT_MAX]; + + FONT* font; /* to access global properties */ +} TA_FaceGlobalsRec; + + /* this models the global hints data for a given face, */ /* decomposed into script-specific items */ -typedef struct TA_FaceGlobalsRec_* TA_FaceGlobals; FT_Error ta_face_globals_new(FT_Face face, TA_FaceGlobals *aglobals, - FT_UInt fallback_script); + FONT* font); FT_Error ta_face_globals_get_metrics(TA_FaceGlobals globals, diff -Nru ttfautohint-0.9/lib/taglyf.c ttfautohint-0.94/lib/taglyf.c --- ttfautohint-0.9/lib/taglyf.c 2012-05-10 21:48:10.000000000 +0000 +++ ttfautohint-0.94/lib/taglyf.c 2012-11-11 18:29:05.000000000 +0000 @@ -16,7 +16,7 @@ #include "ta.h" -FT_Error +static FT_Error TA_sfnt_build_glyf_hints(SFNT* sfnt, FONT* font) { @@ -116,7 +116,8 @@ TA_glyph_parse_composite(GLYPH* glyph, FT_Byte* buf, FT_ULong len, - FT_UShort num_glyphs) + FT_UShort num_glyphs, + FT_Bool hint_with_components) { FT_ULong flags_offset; /* after the loop, this is the offset */ /* to the last element in the flags array */ @@ -147,7 +148,7 @@ /* which eventually becomes the last glyph in the `glyf' table; */ /* for convenience, however, it is not added to the `components' array */ /* (doing so simplifies the conversion of point indices later on) */ - if (glyph->num_composite_contours) + if (glyph->num_composite_contours && hint_with_components) { FT_Short x_min; FT_Short x_max; @@ -345,6 +346,18 @@ num_ins = *(p++) << 8; num_ins += *(p++); + /* assure that we don't process a font */ + /* which already contains a `.ttfautohint' glyph */ + /* (a font with a `post' table version 3.0 doesn't contain glyph names, */ + /* so we have to check it this way) */ + if (glyph->num_points == 1 + && num_ins >= sizeof (ttfautohint_glyph_bytecode)) + { + if (!strncmp((char*)p, (char*)ttfautohint_glyph_bytecode, + sizeof (ttfautohint_glyph_bytecode))) + return TA_Err_Already_Processed; + } + p += num_ins; if (p > endp) @@ -521,17 +534,20 @@ glyph->num_composite_contours = num_composite_contours; - /* update maximum values, */ - /* including the subglyphs not in `components' array */ - /* (each of them has a single point in a single contour) */ - if (num_composite_points + glyph->num_pointsums - > sfnt->max_composite_points) - sfnt->max_composite_points = num_composite_points - + glyph->num_pointsums; - if (num_composite_contours + glyph->num_pointsums - > sfnt->max_composite_contours) - sfnt->max_composite_contours = num_composite_contours + if (font->hint_with_components) + { + /* update maximum values, */ + /* including the subglyphs not in `components' array */ + /* (each of them has a single point in a single contour) */ + if (num_composite_points + glyph->num_pointsums + > sfnt->max_composite_points) + sfnt->max_composite_points = num_composite_points + glyph->num_pointsums; + if (num_composite_contours + glyph->num_pointsums + > sfnt->max_composite_contours) + sfnt->max_composite_contours = num_composite_contours + + glyph->num_pointsums; + } } } @@ -580,12 +596,17 @@ loop_count = data->num_glyphs - 1; /* allocate one more glyph slot if we have composite glyphs */ - if (!sfnt->max_components) + if (!sfnt->max_components || !font->hint_with_components) data->num_glyphs -= 1; data->glyphs = (GLYPH*)calloc(1, data->num_glyphs * sizeof (GLYPH)); if (!data->glyphs) return FT_Err_Out_Of_Memory; + data->master_globals = NULL; + data->cvt_idx = MISSING; + data->fpgm_idx = MISSING; + data->prep_idx = MISSING; + /* first loop over `loca' and `glyf' data */ p = loca_table->buf; @@ -669,7 +690,7 @@ } } - if (sfnt->max_components) + if (sfnt->max_components && font->hint_with_components) { error = TA_sfnt_compute_composite_pointsums(sfnt, font); if (error) @@ -734,7 +755,9 @@ /* is more or less invalid. */ if (glyph->num_contours < 0) - error = TA_glyph_parse_composite(glyph, buf, len, data->num_glyphs); + error = TA_glyph_parse_composite(glyph, buf, len, + data->num_glyphs, + font->hint_with_components); else error = TA_glyph_parse_simple(glyph, buf, len); if (error) @@ -742,26 +765,12 @@ } } - if (sfnt->max_components) + if (sfnt->max_components && font->hint_with_components) { /* construct and append our special glyph used as a composite element */ GLYPH* glyph = &data->glyphs[data->num_glyphs - 1]; FT_Byte* buf; - FT_Byte bytecode[] = - { - - /* increment `cvtl_is_subglyph' counter */ - PUSHB_3, - cvtl_is_subglyph, - 1, - cvtl_is_subglyph, - RCVT, - ADD, - WCVTP, - - }; - glyph->len1 = 12; glyph->len2 = 1; glyph->buf = (FT_Byte*)malloc(glyph->len1 + glyph->len2); @@ -788,11 +797,11 @@ /* add bytecode also; */ /* this works because the loop in `TA_sfnt_build_glyf_hints' */ /* doesn't include the newly appended glyph */ - glyph->ins_len = sizeof (bytecode); + glyph->ins_len = sizeof (ttfautohint_glyph_bytecode); glyph->ins_buf = (FT_Byte*)malloc(glyph->ins_len); if (!glyph->ins_buf) return FT_Err_Out_Of_Memory; - memcpy(glyph->ins_buf, bytecode, glyph->ins_len); + memcpy(glyph->ins_buf, ttfautohint_glyph_bytecode, glyph->ins_len); sfnt->max_components += 1; } @@ -805,6 +814,8 @@ TA_sfnt_build_glyf_table(SFNT* sfnt, FONT* font) { + FT_Error error; + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; glyf_Data* data = (glyf_Data*)glyf_table->data; @@ -819,6 +830,10 @@ if (glyf_table->processed) return TA_Err_Ok; + error = TA_sfnt_build_glyf_hints(sfnt, font); + if (error) + return error; + /* get table size */ len = 0; glyph = data->glyphs; @@ -1188,4 +1203,136 @@ return TA_Err_Ok; } + +FT_Error +TA_sfnt_handle_coverage(SFNT* sfnt, + FONT* font) +{ + FT_Error error; + + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; + + FT_Face face = sfnt->face; + TA_FaceGlobals curr_globals; + + FT_UInt saved_fallback_script = font->fallback_script; + + + /* using TA_SCRIPT_NONE as the fallback script ensures */ + /* that uncovered glyphs stay as-is */ + /* (we handle the fallback script later on) */ + font->fallback_script = TA_SCRIPT_NONE; + + /* trigger computation of coverage */ + error = ta_loader_init(font); + if (error) + goto Exit; + error = ta_loader_reset(font, face); + if (error) + goto Exit; + ta_loader_done(font); + + font->fallback_script = saved_fallback_script; + curr_globals = (TA_FaceGlobals)face->autohint.data; + + if (!data->master_globals) + { + /* initialize */ + data->master_globals = curr_globals; + goto Exit; + } + + /* we have the same `glyf' table for another subfont; */ + /* merge the current coverage info into the `master' coverage info */ + { + TA_FaceGlobals master_globals = data->master_globals; + FT_Long count = master_globals->glyph_count; + + FT_Byte* master = master_globals->glyph_scripts; + FT_Byte* curr = curr_globals->glyph_scripts; + + FT_Byte* limit = master + count; + + + /* we simply copy the data, */ + /* assuming that a given glyph always has the same properties -- */ + /* as soon as we make the script selection more fine-grained, */ + /* it is possible that this assumption doesn't hold: */ + /* for example, glyph `A' can be used for both Cyrillic and Latin */ + while (master < limit) + { + if ((*curr & ~TA_DIGIT) != TA_SCRIPT_NONE) + *master = *curr; + + master++; + curr++; + } + } + +Exit: + return error; +} + + +void +TA_sfnt_adjust_master_coverage(SFNT* sfnt, + FONT* font) +{ + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; + + FT_Face face = sfnt->face; + + TA_FaceGlobals master_globals = data->master_globals; + TA_FaceGlobals curr_globals = (TA_FaceGlobals)face->autohint.data; + + + /* use fallback script for uncovered glyphs */ + if (master_globals == curr_globals) + { + FT_Long nn; + FT_Byte* gscripts = master_globals->glyph_scripts; + + + for (nn = 0; nn < master_globals->glyph_count; nn++) + { + if ((gscripts[nn] & ~TA_DIGIT) == TA_SCRIPT_NONE) + { + gscripts[nn] &= ~TA_SCRIPT_NONE; + gscripts[nn] |= master_globals->font->fallback_script; + } + } + } +} + + +#if 0 + +void +TA_sfnt_copy_master_coverage(SFNT* sfnt, + FONT* font) +{ + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; + + FT_Face face = sfnt->face; + + TA_FaceGlobals master_globals = data->master_globals; + TA_FaceGlobals curr_globals = (TA_FaceGlobals)face->autohint.data; + + + if (master_globals != curr_globals) + { + FT_Long count = master_globals->glyph_count; + FT_Byte* master = master_globals->glyph_scripts; + FT_Byte* curr = curr_globals->glyph_scripts; + + + memcpy(curr, master, count); + } +} + +#endif /* 0 */ + /* end of taglyf.c */ diff -Nru ttfautohint-0.9/lib/tahints.c ttfautohint-0.94/lib/tahints.c --- ttfautohint-0.9/lib/tahints.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tahints.c 2012-11-11 18:29:05.000000000 +0000 @@ -149,7 +149,7 @@ void -_ta_message(const char *format, +_ta_message(const char* format, ...) { va_list ap; @@ -202,14 +202,13 @@ TA_Point point; - fprintf(stderr, "Table of points:\n"); - fprintf(stderr, " [ index | xorg | yorg | xscale | yscale" - " | xfit | yfit | flags ]\n"); + TA_LOG(("Table of points:\n" + " [ index | xorg | yorg | xscale | yscale" + " | xfit | yfit | flags ]\n")); for (point = points; point < limit; point++) - { - fprintf(stderr, " [ %5d | %5d | %5d | %6.2f | %6.2f" - " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n", + TA_LOG((" [ %5d | %5d | %5d | %6.2f | %6.2f" + " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n", point - points, point->fx, point->fy, @@ -222,9 +221,8 @@ (point->flags & TA_FLAG_EXTREMA_X) ? '<' : ' ', (point->flags & TA_FLAG_EXTREMA_Y) ? 'v' : ' ', (point->flags & TA_FLAG_ROUND_X) ? '(' : ' ', - (point->flags & TA_FLAG_ROUND_Y) ? 'u' : ' '); - } - fprintf(stderr, "\n"); + (point->flags & TA_FLAG_ROUND_Y) ? 'u' : ' ')); + TA_LOG(("\n")); } @@ -276,16 +274,20 @@ TA_Segment seg; - fprintf(stderr, "Table of %s segments:\n", + TA_LOG(("Table of %s segments:\n", dimension == TA_DIMENSION_HORZ ? "vertical" - : "horizontal"); - fprintf(stderr, " [ index | pos | dir | from | to | link | serif | edge |" - " height | extra | flags ]\n"); + : "horizontal")); + if (axis->num_segments) + TA_LOG((" [ index | pos | dir | from" + " | to | link | serif | edge" + " | height | extra | flags ]\n")); + else + TA_LOG((" (none)\n")); for (seg = segments; seg < limit; seg++) - { - fprintf(stderr, " [ %5d | %5.2g | %5s | %4d | %4d | %4d | %5d | %4d |" - " %6d | %5d | %11s ]\n", + TA_LOG((" [ %5d | %5.2g | %5s | %4d" + " | %4d | %4d | %5d | %4d" + " | %6d | %5d | %11s ]\n", seg - segments, dimension == TA_DIMENSION_HORZ ? (int)seg->first->ox / 64.0 : (int)seg->first->oy / 64.0, @@ -297,9 +299,8 @@ TA_INDEX_NUM(seg->edge, edges), seg->height, seg->height - (seg->max_coord - seg->min_coord), - ta_edge_flags_to_string(seg->flags)); - } - fprintf(stderr, "\n"); + ta_edge_flags_to_string(seg->flags))); + TA_LOG(("\n")); } } @@ -324,16 +325,18 @@ /* note that TA_DIMENSION_HORZ corresponds to _vertical_ edges */ /* since they have a constant X coordinate */ - fprintf(stderr, "Table of %s edges:\n", + TA_LOG(("Table of %s edges:\n", dimension == TA_DIMENSION_HORZ ? "vertical" - : "horizontal"); - fprintf(stderr, " [ index | pos | dir | link |" - " serif | blue | opos | pos | flags ]\n"); + : "horizontal")); + if (axis->num_edges) + TA_LOG((" [ index | pos | dir | link" + " | serif | blue | opos | pos | flags ]\n")); + else + TA_LOG((" (none)\n")); for (edge = edges; edge < limit; edge++) - { - fprintf(stderr, " [ %5d | %5.2g | %5s | %4d |" - " %5d | %c | %5.2f | %5.2f | %11s ]\n", + TA_LOG((" [ %5d | %5.2g | %5s | %4d" + " | %5d | %c | %5.2f | %5.2f | %11s ]\n", edge - edges, (int)edge->opos / 64.0, ta_dir_str((TA_Direction)edge->dir), @@ -342,49 +345,8 @@ edge->blue_edge ? 'y' : 'n', edge->opos / 64.0, edge->pos / 64.0, - ta_edge_flags_to_string(edge->flags)); - } - fprintf(stderr, "\n"); - } -} - - -void -ta_glyph_hints_dump_edge_links(TA_GlyphHints hints) -{ - FT_Int dimension; - - - for (dimension = TA_DEBUG_STARTDIM; - dimension >= TA_DEBUG_ENDDIM; - dimension--) - { - TA_AxisHints axis = &hints->axis[dimension]; - TA_Segment segments = axis->segments; - TA_Edge edges = axis->edges; - TA_Edge limit = edges + axis->num_edges; - - TA_Edge edge; - TA_Segment seg; - - - fprintf(stderr, "%s edges consist of the following segments:\n", - dimension == TA_DIMENSION_HORZ ? "Vertical" - : "Horizontal"); - for (edge = edges; edge < limit; edge++) - { - fprintf(stderr, " %2d:", edge - edges); - - seg = edge->first; - do - { - fprintf(stderr, " %d", seg - segments); - seg = seg->edge_next; - } while (seg != edge->first); - - fprintf(stderr, "\n"); - } - fprintf(stderr, "\n"); + ta_edge_flags_to_string(edge->flags))); + TA_LOG(("\n")); } } @@ -433,7 +395,7 @@ } /* return no direction if arm lengths differ too much */ - /* (value 14 is heuristic) */ + /* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */ ss *= 14; if (TA_ABS(ll) <= TA_ABS(ss)) dir = TA_DIR_NONE; diff -Nru ttfautohint-0.9/lib/talatin.c ttfautohint-0.94/lib/talatin.c --- ttfautohint-0.9/lib/talatin.c 2012-06-04 13:17:26.000000000 +0000 +++ ttfautohint-0.94/lib/talatin.c 2012-11-19 10:45:03.000000000 +0000 @@ -21,28 +21,34 @@ #include #include FT_ADVANCES_H +#include FT_TRUETYPE_TABLES_H +#include "taglobal.h" #include "talatin.h" #include "tasort.h" #ifdef TA_CONFIG_OPTION_USE_WARPER -#include "afwarp.h" +#include "tawarp.h" #endif +#include + /* find segments and links, compute all stem widths, and initialize */ /* standard width and height for the glyph with given charcode */ void ta_latin_metrics_init_widths(TA_LatinMetrics metrics, - FT_Face face, - FT_ULong charcode) + FT_Face face) { /* scan the array of segments in each direction */ TA_GlyphHintsRec hints[1]; + TA_LOG(("standard widths computation\n" + "===========================\n\n")); + ta_glyph_hints_init(hints); metrics->axis[TA_DIMENSION_HORZ].width_count = 0; @@ -56,10 +62,14 @@ TA_Scaler scaler = &dummy->root.scaler; - glyph_index = FT_Get_Char_Index(face, charcode); + glyph_index = FT_Get_Char_Index(face, + metrics->root.clazz->standard_char); if (glyph_index == 0) goto Exit; + TA_LOG(("standard character: 0x%X (glyph index %d)\n", + metrics->root.clazz->standard_char, glyph_index)); + error = FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE); if (error || face->glyph->outline.n_points <= 0) goto Exit; @@ -122,7 +132,10 @@ } } - ta_sort_widths(num_widths, axis->widths); + /* this also replaces multiple almost identical stem widths */ + /* with a single one (the value 100 is heuristic) */ + ta_sort_and_quantize_widths(&num_widths, axis->widths, + dummy->units_per_em / 100); axis->width_count = num_widths; } @@ -140,9 +153,28 @@ axis->edge_distance_threshold = stdw / 5; axis->standard_width = stdw; axis->extra_light = 0; + +#ifdef TA_DEBUG + { + FT_UInt i; + + + TA_LOG(("%s widths:\n", + dim == TA_DIMENSION_VERT ? "horizontal" + : "vertical")); + + TA_LOG((" %d (standard)", axis->standard_width)); + for (i = 1; i < axis->width_count; i++) + TA_LOG((" %d", axis->widths[i].org)); + + TA_LOG(("\n")); + } +#endif } } + TA_LOG(("\n")); + ta_glyph_hints_done(hints); } @@ -178,15 +210,15 @@ TA_LatinBlue blue; FT_Error error; TA_LatinAxis axis = &metrics->axis[TA_DIMENSION_VERT]; - FT_GlyphSlot glyph = face->glyph; + FT_Outline outline; /* we compute the blues simply by loading each character from the */ /* `ta_latin_blue_chars[blues]' string, then finding its top-most or */ /* bottom-most points (depending on `TA_IS_TOP_BLUE') */ - TA_LOG(("blue zones computation\n")); - TA_LOG(("------------------------------------------------\n")); + TA_LOG(("blue zones computation\n" + "======================\n\n")); for (bb = 0; bb < TA_LATIN_BLUE_MAX; bb++) { @@ -196,7 +228,7 @@ FT_Pos* blue_shoot; - TA_LOG(("blue %3d: ", bb)); + TA_LOG(("blue zone %d:\n", bb)); num_flats = 0; num_rounds = 0; @@ -205,28 +237,27 @@ { FT_UInt glyph_index; FT_Pos best_y; /* same as points.y */ - FT_Int best_point, best_first, best_last; + FT_Int best_point, best_contour_first, best_contour_last; FT_Vector* points; FT_Bool round = 0; - TA_LOG(("'%c'", *p)); - /* load the character in the face -- skip unknown or empty ones */ glyph_index = FT_Get_Char_Index(face, (FT_UInt)*p); if (glyph_index == 0) continue; error = FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE); - if (error || glyph->outline.n_points <= 0) + outline = face->glyph->outline; + if (error || outline.n_points <= 0) continue; /* now compute min or max point indices and coordinates */ - points = glyph->outline.points; + points = outline.points; best_point = -1; best_y = 0; /* make compiler happy */ - best_first = 0; /* ditto */ - best_last = 0; /* ditto */ + best_contour_first = 0; /* ditto */ + best_contour_last = 0; /* ditto */ { FT_Int nn; @@ -234,13 +265,13 @@ FT_Int last = -1; - for (nn = 0; nn < glyph->outline.n_contours; first = last + 1, nn++) + for (nn = 0; nn < outline.n_contours; first = last + 1, nn++) { FT_Int old_best_point = best_point; FT_Int pp; - last = glyph->outline.contours[nn]; + last = outline.contours[nn]; /* avoid single-point contours since they are never rasterized; */ /* in some fonts, they correspond to mark attachment points */ @@ -271,11 +302,11 @@ if (best_point != old_best_point) { - best_first = first; - best_last = last; + best_contour_first = first; + best_contour_last = last; } } - TA_LOG(("%5ld", best_y)); + TA_LOG((" %c %ld", *p, best_y)); } /* now check whether the point belongs to a straight or round */ @@ -283,45 +314,86 @@ /* lies, then inspect its previous and next points */ if (best_point >= 0) { + FT_Pos best_x = points[best_point].x; FT_Int prev, next; + FT_Int best_on_point_first, best_on_point_last; FT_Pos dist; - /* now look for the previous and next points that are not on the */ - /* same Y coordinate and threshold the `closeness'... */ + if (FT_CURVE_TAG(outline.tags[best_point]) == FT_CURVE_TAG_ON) + { + best_on_point_first = best_point; + best_on_point_last = best_point; + } + else + { + best_on_point_first = -1; + best_on_point_last = -1; + } + + /* look for the previous and next points that are not on the */ + /* same Y coordinate, then threshold the `closeness'... */ prev = best_point; next = prev; do { - if (prev > best_first) + if (prev > best_contour_first) prev--; else - prev = best_last; + prev = best_contour_last; + + dist = TA_ABS(points[prev].y - best_y); + /* accept a small distance or a small angle (both values are */ + /* heuristic; value 20 corresponds to approx. 2.9 degrees) */ + if (dist > 5) + if (TA_ABS(points[prev].x - best_x) <= 20 * dist) + break; + + if (FT_CURVE_TAG(outline.tags[prev]) == FT_CURVE_TAG_ON) + { + best_on_point_first = prev; + if (best_on_point_last < 0) + best_on_point_last = prev; + } - dist = points[prev].y - best_y; - if (dist < -5 || dist > 5) - break; } while (prev != best_point); do { - if (next < best_last) + if (next < best_contour_last) next++; else - next = best_first; + next = best_contour_first; + + dist = TA_ABS(points[next].y - best_y); + if (dist > 5) + if (TA_ABS(points[next].x - best_x) <= 20 * dist) + break; + + if (FT_CURVE_TAG(outline.tags[next]) == FT_CURVE_TAG_ON) + { + best_on_point_last = next; + if (best_on_point_first < 0) + best_on_point_first = next; + } - dist = points[next].y - best_y; - if (dist < -5 || dist > 5) - break; } while (next != best_point); /* now set the `round' flag depending on the segment's kind */ - round = FT_BOOL( - FT_CURVE_TAG(glyph->outline.tags[prev]) != FT_CURVE_TAG_ON - || FT_CURVE_TAG(glyph->outline.tags[next]) != FT_CURVE_TAG_ON); + /* (value 8 is heuristic) */ + if (best_on_point_first >= 0 + && best_on_point_last >= 0 + && (FT_UInt)(TA_ABS(points[best_on_point_last].x + - points[best_on_point_first].x)) + > metrics->units_per_em / 8) + round = 0; + else + round = FT_BOOL( + FT_CURVE_TAG(outline.tags[prev]) != FT_CURVE_TAG_ON + || FT_CURVE_TAG(outline.tags[next]) != FT_CURVE_TAG_ON); - TA_LOG(("%c ", round ? 'r' : 'f')); + TA_LOG((" (%s)\n", round ? "round" : "flat")); } if (round) @@ -330,13 +402,11 @@ flats[num_flats++] = best_y; } - TA_LOG(("\n")); - if (num_flats == 0 && num_rounds == 0) { /* we couldn't find a single glyph to compute this blue zone, */ /* we will simply ignore it then */ - TA_LOG(("empty\n")); + TA_LOG((" empty\n")); continue; } @@ -379,8 +449,13 @@ if (TA_LATIN_IS_TOP_BLUE(bb) ^ over_ref) + { *blue_ref = *blue_shoot = (shoot + ref) / 2; + + TA_LOG((" [overshoot smaller than reference," + " taking mean value]\n")); + } } blue->flags = 0; @@ -393,7 +468,54 @@ if (bb == TA_LATIN_BLUE_SMALL_TOP) blue->flags |= TA_LATIN_BLUE_ADJUSTMENT; - TA_LOG(("-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot)); + TA_LOG((" -> reference = %ld\n" + " overshoot = %ld\n", + *blue_ref, *blue_shoot)); + } + + /* add two blue zones for usWinAscent and usWinDescent */ + /* just in case the above algorithm has missed them -- */ + /* Windows cuts off everything outside of those two values */ + { + TT_OS2* os2; + + + os2 = (TT_OS2*)FT_Get_Sfnt_Table(face, ft_sfnt_os2); + + if (os2) + { + blue = &axis->blues[axis->blue_count]; + blue->flags = TA_LATIN_BLUE_TOP | TA_LATIN_BLUE_ACTIVE; + blue->ref.org = + blue->shoot.org = os2->usWinAscent; + + TA_LOG(("artificial blue zone for usWinAscent:\n" + " -> reference = %ld\n" + " overshoot = %ld\n", + blue->ref.org, blue->shoot.org)); + + blue = &axis->blues[axis->blue_count + 1]; + blue->flags = TA_LATIN_BLUE_ACTIVE; + blue->ref.org = + blue->shoot.org = -os2->usWinDescent; + + TA_LOG(("artificial blue zone for usWinDescent:\n" + " -> reference = %ld\n" + " overshoot = %ld\n", + blue->ref.org, blue->shoot.org)); + } + else + { + blue = &axis->blues[axis->blue_count]; + blue->flags = + blue->ref.org = + blue->shoot.org = 0; + + blue = &axis->blues[axis->blue_count + 1]; + blue->flags = + blue->ref.org = + blue->shoot.org = 0; + } } TA_LOG(("\n")); @@ -455,35 +577,14 @@ ta_latin_metrics_init(TA_LatinMetrics metrics, FT_Face face) { - FT_Error error = FT_Err_Ok; FT_CharMap oldmap = face->charmap; - FT_UInt ee; - - static const FT_Encoding latin_encodings[] = - { - FT_ENCODING_UNICODE, - FT_ENCODING_APPLE_ROMAN, - FT_ENCODING_ADOBE_STANDARD, - FT_ENCODING_ADOBE_LATIN_1, - - FT_ENCODING_NONE /* end of list */ - }; metrics->units_per_em = face->units_per_EM; - /* do we have a latin charmap in there? */ - for (ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++) + if (!FT_Select_Charmap(face, FT_ENCODING_UNICODE)) { - error = FT_Select_Charmap(face, latin_encodings[ee]); - if (!error) - break; - } - - if (!error) - { - /* for now, compute the standard width and height from the `o' */ - ta_latin_metrics_init_widths(metrics, face, 'o'); + ta_latin_metrics_init_widths(metrics, face); ta_latin_metrics_init_blues(metrics, face); ta_latin_metrics_check_digits(metrics, face); } @@ -504,9 +605,12 @@ FT_Fixed scale; FT_Pos delta; TA_LatinAxis axis; + FT_UInt ppem; FT_UInt nn; + ppem = metrics->root.scaler.face->size->metrics.x_ppem; + if (dim == TA_DIMENSION_HORZ) { scale = scaler->x_scale; @@ -528,6 +632,10 @@ /* correct X and Y scale to optimize the alignment of the top of */ /* small letters to the pixel grid */ + /* (if we do x-height snapping for this ppem value) */ + if (!number_set_is_element( + metrics->root.globals->font->x_height_snapping_exceptions, + ppem)) { TA_LatinAxis Axis = &metrics->axis[TA_DIMENSION_VERT]; TA_LatinBlue blue = NULL; @@ -551,15 +659,14 @@ scaled = FT_MulFix(blue->shoot.org, scaler->y_scale); - + limit = metrics->root.globals->increase_x_height; threshold = 40; - /* scaler flag bits 3-6 hold the x height increase limit; */ - /* if zero, the feature is switched off, */ - /* otherwise the limit is the bits value + 5 */ - limit = (scaler->flags >> 3) & 15; + + /* if the `increase-x-height' property is active, */ + /* we round up much more often */ if (limit - && metrics->root.scaler.face->size->metrics.x_ppem <= limit + 5 - && metrics->root.scaler.face->size->metrics.x_ppem >= 6) + && ppem <= limit + && ppem >= TA_PROP_INCREASE_X_HEIGHT_MIN) threshold = 52; fitted = (scaled + threshold) & ~63; @@ -672,6 +779,26 @@ blue->flags |= TA_LATIN_BLUE_ACTIVE; } } + + /* the last two artificial blue zones are to be scaled */ + /* with uncorrected scaling values */ + { + TA_LatinAxis a = &metrics->axis[TA_DIMENSION_VERT]; + TA_LatinBlue b; + + + b = &a->blues[a->blue_count]; + b->ref.cur = + b->ref.fit = + b->shoot.cur = + b->shoot.fit = FT_MulFix(b->ref.org, a->org_scale) + delta; + + b = &a->blues[a->blue_count + 1]; + b->ref.cur = + b->ref.fit = + b->shoot.cur = + b->shoot.fit = FT_MulFix(b->ref.org, a->org_scale) + delta; + } } } @@ -1338,7 +1465,7 @@ /* for each horizontal edge search the blue zone which is closest */ for (; edge < edge_limit; edge++) { - FT_Int bb; + FT_UInt bb; TA_Width best_blue = NULL; FT_Pos best_dist; /* initial threshold */ @@ -1354,7 +1481,13 @@ if (best_dist > 64 / 2) best_dist = 64 / 2; - for (bb = 0; bb < TA_LATIN_BLUE_MAX; bb++) + /* this loop also handles the two extra blue zones */ + /* for usWinAscent and usWinDescent */ + /* if option `windows-compatibility' is set */ + for (bb = 0; + bb < latin->blue_count + + (metrics->root.globals->font->windows_compatibility ? 2 : 0); + bb++) { TA_LatinBlue blue = latin->blues + bb; FT_Bool is_top_blue, is_major_dir; @@ -1768,6 +1901,9 @@ TA_Edge anchor = NULL; FT_Int has_serifs = 0; +#ifdef TA_DEBUG + FT_UInt num_actions = 0; +#endif TA_LOG(("%s edge hinting\n", dim == TA_DIMENSION_VERT ? "horizontal" : "vertical")); @@ -1805,6 +1941,7 @@ if (!edge1) continue; +#ifdef TA_DEBUG if (!anchor) TA_LOG((" BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f," " was %.2f (anchor=edge %d)\n", @@ -1815,6 +1952,9 @@ edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0, edge1->pos / 64.0)); + num_actions++; +#endif + edge1->pos = blue->fit; edge1->flags |= TA_EDGE_DONE; @@ -1832,6 +1972,10 @@ { ta_latin_align_linked_edge(hints, dim, edge1, edge2); edge2->flags |= TA_EDGE_DONE; + +#ifdef TA_DEBUG + num_actions++; +#endif } if (!anchor) @@ -1866,6 +2010,10 @@ ta_latin_align_linked_edge(hints, dim, edge2, edge); edge->flags |= TA_EDGE_DONE; + +#ifdef TA_DEBUG + num_actions++; +#endif continue; } @@ -1935,6 +2083,10 @@ edge, edge2, NULL, NULL, NULL); ta_latin_align_linked_edge(hints, dim, edge, edge2); + +#ifdef TA_DEBUG + num_actions += 2; +#endif } else { @@ -2064,15 +2216,23 @@ } } +#ifdef TA_DEBUG + num_actions++; +#endif + edge->flags |= TA_EDGE_DONE; edge2->flags |= TA_EDGE_DONE; if (edge > edges && edge->pos < edge[-1].pos) { +#ifdef TA_DEBUG TA_LOG((" BOUND: edge %d (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0)); + num_actions++; +#endif + edge->pos = edge[-1].pos; if (hints->recorder) @@ -2239,7 +2399,6 @@ else { edge->pos = anchor->pos + ((edge->opos - anchor->opos + 16) & ~31); - TA_LOG((" SERIF_LINK2: edge %d (opos=%.2f) snapped to %.2f\n", edge - edges, edge->opos / 64.0, edge->pos / 64.0)); @@ -2249,13 +2408,19 @@ } } +#ifdef TA_DEBUG + num_actions++; +#endif edge->flags |= TA_EDGE_DONE; if (edge > edges && edge->pos < edge[-1].pos) { +#ifdef TA_DEBUG TA_LOG((" BOUND: edge %d (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0)); + num_actions++; +#endif edge->pos = edge[-1].pos; @@ -2268,9 +2433,13 @@ && edge[1].flags & TA_EDGE_DONE && edge->pos > edge[1].pos) { +#ifdef TA_DEBUG TA_LOG((" BOUND: edge %d (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[1].pos / 64.0)); + num_actions++; +#endif + edge->pos = edge[1].pos; if (hints->recorder) @@ -2280,7 +2449,11 @@ } } +#ifdef TA_DEBUG + if (!num_actions) + TA_LOG((" (none)\n")); TA_LOG(("\n")); +#endif } @@ -2383,10 +2556,12 @@ TA_UNIRANGE_REC(0x2460UL, 0x24FFUL), /* Enclosed Alphanumerics */ TA_UNIRANGE_REC(0x2C60UL, 0x2C7FUL), /* Latin Extended-C */ TA_UNIRANGE_REC(0x2DE0UL, 0x2DFFUL), /* Cyrillic Extended-A */ + TA_UNIRANGE_REC(0x2E00UL, 0x2E7FUL), /* Supplemental Punctuation */ TA_UNIRANGE_REC(0xA640UL, 0xA69FUL), /* Cyrillic Extended-B */ TA_UNIRANGE_REC(0xA720UL, 0xA7FFUL), /* Latin Extended-D */ TA_UNIRANGE_REC(0xFB00UL, 0xFB06UL), /* Alphab. Present. Forms (Latin Ligs) */ TA_UNIRANGE_REC(0x1D400UL, 0x1D7FFUL), /* Mathematical Alphanumeric Symbols */ + TA_UNIRANGE_REC(0x1F100UL, 0x1F1FFUL), /* Enclosed Alphanumeric Supplement */ TA_UNIRANGE_REC(0UL, 0UL) }; @@ -2395,6 +2570,7 @@ { TA_SCRIPT_LATIN, ta_latin_uniranges, + 'o', sizeof (TA_LatinMetricsRec), diff -Nru ttfautohint-0.9/lib/talatin.h ttfautohint-0.94/lib/talatin.h --- ttfautohint-0.9/lib/talatin.h 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/talatin.h 2012-11-11 18:29:22.000000000 +0000 @@ -85,7 +85,8 @@ /* ignored for horizontal metrics */ FT_UInt blue_count; - TA_LatinBlueRec blues[TA_LATIN_BLUE_MAX]; + /* we add two blue zones for usWinAscent and usWinDescent */ + TA_LatinBlueRec blues[TA_LATIN_BLUE_MAX + 2]; FT_Fixed org_scale; FT_Pos org_delta; @@ -110,8 +111,7 @@ void ta_latin_metrics_init_widths(TA_LatinMetrics metrics, - FT_Face face, - FT_ULong charcode); + FT_Face face); void ta_latin_metrics_check_digits(TA_LatinMetrics metrics, diff -Nru ttfautohint-0.9/lib/taloader.c ttfautohint-0.94/lib/taloader.c --- ttfautohint-0.9/lib/taloader.c 2012-06-04 12:47:17.000000000 +0000 +++ ttfautohint-0.94/lib/taloader.c 2012-11-11 18:29:05.000000000 +0000 @@ -22,7 +22,7 @@ #include #include FT_GLYPH_H -#include "taloader.h" +#include "ta.h" #include "tahints.h" #include "taglobal.h" @@ -42,8 +42,11 @@ /* initialize glyph loader */ FT_Error -ta_loader_init(TA_Loader loader) +ta_loader_init(FONT* font) { + TA_Loader loader = font->loader; + + memset(loader, 0, sizeof (TA_LoaderRec)); ta_glyph_hints_init(&loader->hints); @@ -57,11 +60,11 @@ /* reset glyph loader and compute globals if necessary */ FT_Error -ta_loader_reset(TA_Loader loader, - FT_Face face, - FT_UInt fallback_script) +ta_loader_reset(FONT* font, + FT_Face face) { FT_Error error = FT_Err_Ok; + TA_Loader loader = font->loader; loader->face = face; @@ -71,7 +74,7 @@ if (loader->globals == NULL) { - error = ta_face_globals_new(face, &loader->globals, fallback_script); + error = ta_face_globals_new(face, &loader->globals, font); if (!error) { face->autohint.data = (FT_Pointer)loader->globals; @@ -86,8 +89,11 @@ /* finalize glyph loader */ void -ta_loader_done(TA_Loader loader) +ta_loader_done(FONT* font) { + TA_Loader loader = font->loader; + + ta_glyph_hints_done(&loader->hints); loader->face = NULL; @@ -120,9 +126,11 @@ #if 0 FT_Slot_Internal internal = slot->internal; #endif + FT_Int32 flags; - error = FT_Load_Glyph(face, glyph_index, load_flags); + flags = load_flags | FT_LOAD_LINEAR_DESIGN; + error = FT_Load_Glyph(face, glyph_index, flags); if (error) goto Exit; @@ -142,10 +150,6 @@ } #endif - /* set linear metrics */ - slot->linearHoriAdvance = slot->metrics.horiAdvance; - slot->linearVertAdvance = slot->metrics.vertAdvance; - switch (slot->format) { case FT_GLYPH_FORMAT_OUTLINE: @@ -489,15 +493,15 @@ /* load a glyph */ FT_Error -ta_loader_load_glyph(TA_Loader loader, +ta_loader_load_glyph(FONT* font, FT_Face face, FT_UInt gindex, FT_Int32 load_flags) { FT_Error error; FT_Size size = face->size; + TA_Loader loader = font->loader; TA_ScalerRec scaler; - FT_UInt fallback_script; if (!size) @@ -515,17 +519,13 @@ scaler.flags = 0; /* XXX: fix this */ /* XXX this is an ugly hack of ttfautohint: */ - /* bits 30 and 31 of `load_flags' specify the fallback script, */ - /* bit 29 triggers vertical hinting only, */ - /* and bits 25-28 give the x height increase limit */ - fallback_script = load_flags >> 30; + /* bit 29 triggers vertical hinting only */ if (load_flags & (1 << 29)) scaler.flags |= TA_SCALER_FLAG_NO_HORIZONTAL; - scaler.flags |= ((load_flags >> 25) & 15) << 3; /* bits 3-6 */ /* note that the fallback script can't be changed anymore */ /* after the first call of `ta_loader_load_glyph' */ - error = ta_loader_reset(loader, face, fallback_script); + error = ta_loader_reset(font, face); if (!error) { TA_ScriptMetrics metrics; diff -Nru ttfautohint-0.9/lib/taloader.h ttfautohint-0.94/lib/taloader.h --- ttfautohint-0.9/lib/taloader.h 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/taloader.h 2012-11-11 18:29:05.000000000 +0000 @@ -21,15 +21,19 @@ #define __TALOADER_H__ #include "tahints.h" -#include "taglobal.h" #include "tagloadr.h" +typedef struct FONT_ FONT; + typedef struct TA_LoaderRec_ { - FT_Face face; /* current face */ - TA_FaceGlobals globals; /* current face globals */ - TA_GlyphLoader gloader; /* glyph loader */ + /* current face data */ + FT_Face face; + TA_FaceGlobals globals; + + /* current glyph data */ + TA_GlyphLoader gloader; TA_GlyphHintsRec hints; TA_ScriptMetrics metrics; FT_Bool transformed; @@ -42,20 +46,20 @@ FT_Error -ta_loader_init(TA_Loader loader); +ta_loader_init(FONT* font); FT_Error -ta_loader_reset(TA_Loader loader, - FT_Face face, - FT_UInt fallback_script); +ta_loader_reset(FONT* font, + FT_Face face); + void -ta_loader_done(TA_Loader loader); +ta_loader_done(FONT* font); FT_Error -ta_loader_load_glyph(TA_Loader loader, +ta_loader_load_glyph(FONT* font, FT_Face face, FT_UInt gindex, FT_Int32 load_flags); diff -Nru ttfautohint-0.9/lib/tamaxp.c ttfautohint-0.94/lib/tamaxp.c --- ttfautohint-0.9/lib/tamaxp.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tamaxp.c 2012-11-11 18:29:05.000000000 +0000 @@ -32,7 +32,7 @@ if (maxp_table->len != MAXP_LEN) return FT_Err_Invalid_Table; - if (sfnt->max_components) + if (sfnt->max_components && font->hint_with_components) { buf[MAXP_NUM_GLYPHS] = HIGH(data->num_glyphs); buf[MAXP_NUM_GLYPHS + 1] = LOW(data->num_glyphs); diff -Nru ttfautohint-0.9/lib/taprep.c ttfautohint-0.94/lib/taprep.c --- ttfautohint-0.9/lib/taprep.c 2012-06-04 13:39:45.000000000 +0000 +++ ttfautohint-0.94/lib/taprep.c 2012-11-22 20:55:48.000000000 +0000 @@ -73,6 +73,17 @@ }; +unsigned char PREP(test_exception_a) [] = +{ + + PUSHB_1, + cvtl_is_element, + RCVT, + NOT, + IF, + +}; + unsigned char PREP(align_top_a) [] = { @@ -100,11 +111,11 @@ /* apply much `stronger' rounding up of x height for */ /* 6 <= PPEM <= increase_x_height */ MPPEM, - PUSHB_1, + PUSHW_1, }; -/* %c, x height increase limit */ +/* %d, x height increase limit */ unsigned char PREP(align_top_c1b) [] = { @@ -215,6 +226,13 @@ }; +unsigned char PREP(test_exception_b) [] = +{ + + EIF, + +}; + unsigned char PREP(compute_extra_light_a) [] = { @@ -256,6 +274,98 @@ }; +unsigned char PREP(set_stem_width_handling_a) [] = +{ + + /* + * There are two ClearType flavours available on Windows: The older GDI + * ClearType, introduced in 2000, and the recent DW ClearType, introduced + * in 2008. The main difference is that the older incarnation behaves + * like a B/W renderer along the y axis, while the newer version does + * vertical smoothing also. + * + * The only possibility to differentiate between GDI and DW ClearType is + * testing bit 10 in the GETINFO instruction (with return value in bit 17; + * this works for TrueType version >= 38), checking whether sub-pixel + * positioning is available. + * + * If GDI ClearType is active, we use a different stem width function + * which snaps to integer pixels as much as possible. + */ + + /* set default positioning */ + PUSHB_2, + cvtl_stem_width_function, + +}; + +/* %d, either bci_smooth_stem_width or bci_strong_stem_width */ + +unsigned char PREP(set_stem_width_handling_b) [] = +{ + + WCVTP, + + /* get rasterizer version (bit 0) */ + PUSHB_2, + 36, + 0x01, + GETINFO, + + /* `GDI ClearType': */ + /* version >= 36 and version < 38, ClearType enabled */ + LTEQ, + IF, + /* check whether ClearType is enabled (bit 6) */ + PUSHB_1, + 0x40, + GETINFO, + IF, + PUSHB_2, + cvtl_stem_width_function, +}; + +/* %d, either bci_smooth_stem_width or bci_strong_stem_width */ + +unsigned char PREP(set_stem_width_handling_c) [] = +{ + + WCVTP, + + /* get rasterizer version (bit 0) */ + PUSHB_2, + 38, + 0x01, + GETINFO, + + /* `DW ClearType': */ + /* version >= 38, sub-pixel positioning is enabled */ + LTEQ, + IF, + /* check whether sub-pixel positioning is enabled (bit 10) */ + PUSHW_1, + 0x04, + 0x00, + GETINFO, + IF, + PUSHB_2, + cvtl_stem_width_function, + +}; + +/* %d, either bci_smooth_stem_width or bci_strong_stem_width */ + +unsigned char PREP(set_stem_width_handling_d) [] = +{ + + WCVTP, + EIF, + EIF, + EIF, + EIF, + +}; + unsigned char PREP(set_dropout_mode) [] = { @@ -292,8 +402,160 @@ }; +/* this function allocates `buf', parsing `number_set' to create bytecode */ +/* which eventually sets CVT index `cvtl_is_element' */ +/* (in functions `bci_number_set_is_element' and */ +/* `bci_number_set_is_element2') */ + +static FT_Byte* +TA_sfnt_build_number_set(SFNT* sfnt, + FT_Byte** buf, + number_range* number_set) +{ + FT_Byte* bufp = NULL; + number_range* nr; + + FT_UInt num_singles2 = 0; + FT_UInt* single2_args; + FT_UInt* single2_arg; + FT_UInt num_singles = 0; + FT_UInt* single_args; + FT_UInt* single_arg; + + FT_UInt num_ranges2 = 0; + FT_UInt* range2_args; + FT_UInt* range2_arg; + FT_UInt num_ranges = 0; + FT_UInt* range_args; + FT_UInt* range_arg; + + FT_UInt have_single = 0; + FT_UInt have_range = 0; + + FT_UShort num_stack_elements; + + + /* build up four stacks to stay as compact as possible */ + nr = number_set; + while (nr) + { + if (nr->start == nr->end) + { + if (nr->start < 256) + num_singles++; + else + num_singles2++; + } + else + { + if (nr->start < 256 && nr->end < 256) + num_ranges++; + else + num_ranges2++; + } + nr = nr->next; + } + + /* collect all arguments temporarily in arrays (in reverse order) */ + /* so that we can easily split into chunks of 255 args */ + /* as needed by NPUSHB and friends; */ + /* for simplicity, always allocate an extra slot */ + single2_args = (FT_UInt*)malloc((num_singles2 + 1) * sizeof (FT_UInt)); + single_args = (FT_UInt*)malloc((num_singles + 1) * sizeof (FT_UInt)); + range2_args = (FT_UInt*)malloc((2 * num_ranges2 + 1) * sizeof (FT_UInt)); + range_args = (FT_UInt*)malloc((2 * num_ranges + 1) * sizeof (FT_UInt)); + if (!single2_args || !single_args + || !range2_args || !range_args) + goto Fail; + + /* check whether we need the extra slot for the argument to CALL */ + if (num_singles || num_singles2) + have_single = 1; + if (num_ranges || num_ranges2) + have_range = 1; + + /* set function indices outside of argument loop (using the extra slot) */ + if (have_single) + single_args[num_singles] = bci_number_set_is_element; + if (have_range) + range_args[2 * num_ranges] = bci_number_set_is_element2; + + single2_arg = single2_args + num_singles2 - 1; + single_arg = single_args + num_singles - 1; + range2_arg = range2_args + 2 * num_ranges2 - 1; + range_arg = range_args + 2 * num_ranges - 1; + + nr = number_set; + while (nr) + { + if (nr->start == nr->end) + { + if (nr->start < 256) + *(single_arg--) = nr->start; + else + *(single2_arg--) = nr->start; + } + else + { + if (nr->start < 256 && nr->end < 256) + { + *(range_arg--) = nr->start; + *(range_arg--) = nr->end; + } + else + { + *(range2_arg--) = nr->start; + *(range2_arg--) = nr->end; + } + } + nr = nr->next; + } + + /* this rough estimate of the buffer size gets adjusted later on */ + *buf = (FT_Byte*)malloc((2 + 1) * num_singles2 + + (1 + 1) * num_singles + + (4 + 1) * num_ranges2 + + (2 + 1) * num_ranges + + 10); + if (!*buf) + goto Fail; + bufp = *buf; + + BCI(PUSHB_2); + BCI(cvtl_is_element); + BCI(0); + BCI(WCVTP); + + bufp = TA_build_push(bufp, single2_args, num_singles2, 1, 1); + bufp = TA_build_push(bufp, single_args, num_singles + have_single, 0, 1); + if (have_single) + BCI(CALL); + + bufp = TA_build_push(bufp, range2_args, 2 * num_ranges2, 1, 1); + bufp = TA_build_push(bufp, range_args, 2 * num_ranges + have_range, 0, 1); + if (have_range) + BCI(CALL); + + num_stack_elements = num_singles + num_singles2; + if (num_stack_elements > num_ranges + num_ranges2) + num_stack_elements = num_ranges + num_ranges2; + num_stack_elements += ADDITIONAL_STACK_ELEMENTS; + if (num_stack_elements > sfnt->max_stack_elements) + sfnt->max_stack_elements = num_stack_elements; + +Fail: + free(single2_args); + free(single_args); + free(range2_args); + free(range_args); + + return bufp; +} + + #define COPY_PREP(snippet_name) \ - do { \ + do \ + { \ memcpy(buf_p, prep_ ## snippet_name, \ sizeof (prep_ ## snippet_name)); \ buf_p += sizeof (prep_ ## snippet_name); \ @@ -302,16 +564,20 @@ static FT_Error TA_table_build_prep(FT_Byte** prep, FT_ULong* prep_len, + SFNT* sfnt, FONT* font) { TA_LatinAxis vaxis; TA_LatinBlue blue_adjustment = NULL; FT_UInt i; - FT_UInt buf_len = 0; + FT_Byte* buf = NULL; + FT_Byte* buf_new; + FT_UInt buf_len; + FT_UInt buf_new_len; + FT_UInt len; - FT_Byte* buf; - FT_Byte* buf_p; + FT_Byte* buf_p = NULL; if (font->loader->hints.metrics->clazz->script == TA_SCRIPT_NONE) @@ -330,55 +596,85 @@ } } + if (blue_adjustment && font->x_height_snapping_exceptions) + { + buf_p = TA_sfnt_build_number_set(sfnt, &buf, + font->x_height_snapping_exceptions); + if (!buf_p) + return FT_Err_Out_Of_Memory; + } + + buf_len = buf_p - buf; + buf_new_len = buf_len; + if (font->hinting_limit) - buf_len += sizeof (PREP(hinting_limit_a)) - + 2 - + sizeof (PREP(hinting_limit_b)); + buf_new_len += sizeof (PREP(hinting_limit_a)) + + 2 + + sizeof (PREP(hinting_limit_b)); - buf_len += sizeof (PREP(store_0x10000)); + buf_new_len += sizeof (PREP(store_0x10000)); if (blue_adjustment) - buf_len += sizeof (PREP(align_top_a)) - + 1 - + sizeof (PREP(align_top_b)) - + (font->increase_x_height ? (sizeof (PREP(align_top_c1a)) - + 1 - + sizeof (PREP(align_top_c1b))) - : sizeof (PREP(align_top_c2))) - + sizeof (PREP(align_top_d)) - + sizeof (PREP(loop_cvt_a)) - + 2 - + sizeof (PREP(loop_cvt_b)) - + 2 - + sizeof (PREP(loop_cvt_c)) - + 2 - + sizeof (PREP(loop_cvt_d)); - - buf_len += sizeof (PREP(compute_extra_light_a)) - + 1 - + sizeof (PREP(compute_extra_light_b)); + { + if (font->x_height_snapping_exceptions) + buf_new_len += sizeof (PREP(test_exception_a)); + buf_new_len += sizeof (PREP(align_top_a)) + + 1 + + sizeof (PREP(align_top_b)) + + (font->increase_x_height + ? (sizeof (PREP(align_top_c1a)) + + 2 + + sizeof (PREP(align_top_c1b))) + : sizeof (PREP(align_top_c2))) + + sizeof (PREP(align_top_d)) + + sizeof (PREP(loop_cvt_a)) + + 2 + + sizeof (PREP(loop_cvt_b)) + + 2 + + sizeof (PREP(loop_cvt_c)) + + 2 + + sizeof (PREP(loop_cvt_d)); + if (font->x_height_snapping_exceptions) + buf_new_len += sizeof (PREP(test_exception_b)); + } - if (CVT_BLUES_SIZE(font)) - buf_len += sizeof (PREP(round_blues_a)) - + 2 - + sizeof (PREP(round_blues_b)); + buf_new_len += sizeof (PREP(compute_extra_light_a)) + + 1 + + sizeof (PREP(compute_extra_light_b)); - buf_len += sizeof (PREP(set_dropout_mode)); - buf_len += sizeof (PREP(reset_component_counter)); + if (CVT_BLUES_SIZE(font)) + buf_new_len += sizeof (PREP(round_blues_a)) + + 2 + + sizeof (PREP(round_blues_b)); + + buf_new_len += sizeof (PREP(set_stem_width_handling_a)) + + 1 + + sizeof (PREP(set_stem_width_handling_b)) + + 1 + + sizeof (PREP(set_stem_width_handling_c)) + + 1 + + sizeof (PREP(set_stem_width_handling_d)); + buf_new_len += sizeof (PREP(set_dropout_mode)); + buf_new_len += sizeof (PREP(reset_component_counter)); /* buffer length must be a multiple of four */ - len = (buf_len + 3) & ~3; - buf = (FT_Byte*)malloc(len); - if (!buf) + len = (buf_new_len + 3) & ~3; + buf_new = (FT_Byte*)realloc(buf, len); + if (!buf_new) + { + free(buf); return FT_Err_Out_Of_Memory; + } + buf = buf_new; /* pad end of buffer with zeros */ buf[len - 1] = 0x00; buf[len - 2] = 0x00; buf[len - 3] = 0x00; - /* copy cvt program into buffer and fill in the missing variables */ - buf_p = buf; + /* copy remaining cvt program into buffer */ + /* and fill in the missing variables */ + buf_p = buf + buf_len; if (font->hinting_limit) { @@ -392,6 +688,9 @@ if (blue_adjustment) { + if (font->x_height_snapping_exceptions) + COPY_PREP(test_exception_a); + COPY_PREP(align_top_a); *(buf_p++) = (unsigned char)(CVT_BLUE_SHOOTS_OFFSET(font) + blue_adjustment - vaxis->blues); @@ -399,7 +698,8 @@ if (font->increase_x_height) { COPY_PREP(align_top_c1a); - *(buf_p++) = (unsigned char)font->increase_x_height; + *(buf_p++) = HIGH(font->increase_x_height); + *(buf_p++) = LOW(font->increase_x_height); COPY_PREP(align_top_c1b); } else @@ -410,15 +710,19 @@ *(buf_p++) = (unsigned char)CVT_VERT_WIDTHS_OFFSET(font); *(buf_p++) = (unsigned char)(CVT_VERT_WIDTHS_OFFSET(font) + CVT_VERT_WIDTHS_SIZE(font) - 1); + /* don't loop over the artificial blue zones */ COPY_PREP(loop_cvt_b); *(buf_p++) = (unsigned char)CVT_BLUE_REFS_OFFSET(font); *(buf_p++) = (unsigned char)(CVT_BLUE_REFS_OFFSET(font) - + CVT_BLUES_SIZE(font) - 1); + + CVT_BLUES_SIZE(font) - 1 - 2); COPY_PREP(loop_cvt_c); *(buf_p++) = (unsigned char)CVT_BLUE_SHOOTS_OFFSET(font); *(buf_p++) = (unsigned char)(CVT_BLUE_SHOOTS_OFFSET(font) - + CVT_BLUES_SIZE(font) - 1); + + CVT_BLUES_SIZE(font) - 1 - 2); COPY_PREP(loop_cvt_d); + + if (font->x_height_snapping_exceptions) + COPY_PREP(test_exception_b); } COPY_PREP(compute_extra_light_a); @@ -434,11 +738,21 @@ COPY_PREP(round_blues_b); } + COPY_PREP(set_stem_width_handling_a); + *(buf_p++) = font->gray_strong_stem_width ? bci_strong_stem_width + : bci_smooth_stem_width; + COPY_PREP(set_stem_width_handling_b); + *(buf_p++) = font->gdi_cleartype_strong_stem_width ? bci_strong_stem_width + : bci_smooth_stem_width; + COPY_PREP(set_stem_width_handling_c); + *(buf_p++) = font->dw_cleartype_strong_stem_width ? bci_strong_stem_width + : bci_smooth_stem_width; + COPY_PREP(set_stem_width_handling_d); COPY_PREP(set_dropout_mode); COPY_PREP(reset_component_counter); *prep = buf; - *prep_len = buf_len; + *prep_len = buf_new_len; return FT_Err_Ok; } @@ -448,7 +762,10 @@ TA_sfnt_build_prep_table(SFNT* sfnt, FONT* font) { - FT_Error error; + FT_Error error = FT_Err_Ok; + + SFNT_Table* glyf_table = &font->tables[sfnt->glyf_idx]; + glyf_Data* data = (glyf_Data*)glyf_table->data; FT_Byte* prep_buf; FT_ULong prep_len; @@ -456,11 +773,18 @@ error = TA_sfnt_add_table_info(sfnt); if (error) - return error; + goto Exit; + + /* `glyf', `cvt', `fpgm', and `prep' are always used in parallel */ + if (glyf_table->processed) + { + sfnt->table_infos[sfnt->num_table_infos - 1] = data->prep_idx; + goto Exit; + } - error = TA_table_build_prep(&prep_buf, &prep_len, font); + error = TA_table_build_prep(&prep_buf, &prep_len, sfnt, font); if (error) - return error; + goto Exit; #if 0 /* ttfautohint's bytecode in `fpgm' is larger */ @@ -476,12 +800,12 @@ &sfnt->table_infos[sfnt->num_table_infos - 1], TTAG_prep, prep_len, prep_buf); if (error) - { free(prep_buf); - return error; - } + else + data->prep_idx = sfnt->table_infos[sfnt->num_table_infos - 1]; - return FT_Err_Ok; +Exit: + return error; } /* end of taprep.c */ diff -Nru ttfautohint-0.9/lib/tasort.c ttfautohint-0.94/lib/tasort.c --- ttfautohint-0.9/lib/tasort.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tasort.c 2012-07-03 09:43:23.000000000 +0000 @@ -36,7 +36,7 @@ { for (j = i; j > 0; j--) { - if (table[j] > table[j - 1]) + if (table[j] >= table[j - 1]) break; swap = table[j]; @@ -48,19 +48,27 @@ void -ta_sort_widths(FT_UInt count, - TA_Width table) +ta_sort_and_quantize_widths(FT_UInt* count, + TA_Width table, + FT_Pos threshold) { FT_UInt i; FT_UInt j; + FT_UInt cur_idx; + FT_Pos cur_val; + FT_Pos sum; TA_WidthRec swap; - for (i = 1; i < count; i++) + if (*count == 1) + return; + + /* sort */ + for (i = 1; i < *count; i++) { for (j = i; j > 0; j--) { - if (table[j].org > table[j - 1].org) + if (table[j].org >= table[j - 1].org) break; swap = table[j]; @@ -68,6 +76,51 @@ table[j - 1] = swap; } } + + cur_idx = 0; + cur_val = table[cur_idx].org; + + /* compute and use mean values for clusters not larger than `threshold'; */ + /* this is very primitive and might not yield the best result, */ + /* but normally, using reference character `o', `*count' is 2, */ + /* so the code below is fully sufficient */ + for (i = 1; i < *count; i++) + { + if (table[i].org - cur_val > threshold + || i == *count - 1) + { + sum = 0; + + /* fix loop for end of array */ + if (table[i].org - cur_val <= threshold + && i == *count - 1) + i++; + + for (j = cur_idx; j < i; j++) + { + sum += table[j].org; + table[j].org = 0; + } + table[cur_idx].org = sum / j; + + if (i < *count - 1) + { + cur_idx = i + 1; + cur_val = table[cur_idx].org; + } + } + } + + cur_idx = 1; + + /* compress array to remove zero values */ + for (i = 1; i < *count; i++) + { + if (table[i].org) + table[cur_idx++] = table[i]; + } + + *count = cur_idx; } /* end of tasort.c */ diff -Nru ttfautohint-0.9/lib/tasort.h ttfautohint-0.94/lib/tasort.h --- ttfautohint-0.9/lib/tasort.h 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tasort.h 2012-07-03 09:43:44.000000000 +0000 @@ -28,8 +28,9 @@ FT_Pos* table); void -ta_sort_widths(FT_UInt count, - TA_Width widths); +ta_sort_and_quantize_widths(FT_UInt* count, + TA_Width widths, + FT_Pos threshold); #endif /* __TASORT_H__ */ diff -Nru ttfautohint-0.9/lib/tattc.c ttfautohint-0.94/lib/tattc.c --- ttfautohint-0.9/lib/tattc.c 2012-04-22 09:57:14.000000000 +0000 +++ ttfautohint-0.94/lib/tattc.c 2012-11-11 18:29:05.000000000 +0000 @@ -37,7 +37,7 @@ FT_Byte* p; - len = 24 + 4 * num_sfnts; + len = (font->have_DSIG ? 24 : 12) + 4 * num_sfnts; buf = (FT_Byte*)malloc(len); if (!buf) return FT_Err_Out_Of_Memory; diff -Nru ttfautohint-0.9/lib/tatypes.h ttfautohint-0.94/lib/tatypes.h --- ttfautohint-0.9/lib/tatypes.h 2012-06-04 12:47:46.000000000 +0000 +++ ttfautohint-0.94/lib/tatypes.h 2012-11-13 07:18:23.000000000 +0000 @@ -29,7 +29,7 @@ /* enable one of the following three definitions for debugging */ /* #define TA_DEBUG */ /* #define TA_DEBUG_HORZ */ -/* #define TA_DEBUG_VERT */ +#define TA_DEBUG_VERT #if defined TA_DEBUG_HORZ # define TA_DEBUG_STARTDIM TA_DIMENSION_HORZ @@ -47,13 +47,14 @@ #ifdef TA_DEBUG #define TA_LOG(x) \ - do { \ + do \ + { \ if (_ta_debug) \ _ta_message x; \ } while (0) void -_ta_message(const char *format, +_ta_message(const char* format, ...); extern int _ta_debug; @@ -99,7 +100,8 @@ #define TA_ANGLE_PI4 (TA_ANGLE_PI / 4) #define TA_ANGLE_DIFF(result, angle1, angle2) \ - do { \ + do \ + { \ TA_Angle _delta = (angle2) - (angle1); \ \ \ @@ -125,13 +127,6 @@ #define TA_SCALER_FLAG_NO_VERTICAL 0x02 /* disable vertical hinting */ #define TA_SCALER_FLAG_NO_ADVANCE 0x04 /* disable advance hinting */ -/* for ttfautohint, we add more scaler flags; */ -/* note that FreeType will use a different mechanism */ -/* to pass control arguments to the auto-hinter */ -/* (this isn't implemented yet in version 2.4.9) */ - -/* currently, bits 3-6 hold the x height increase limit */ - typedef struct TA_ScalerRec_ { FT_Face face; /* source font face */ @@ -173,7 +168,7 @@ typedef enum TA_Script_ { - TA_SCRIPT_NONE = 0, + TA_SCRIPT_DUMMY = 0, TA_SCRIPT_LATIN = 1, TA_SCRIPT_CJK = 2, TA_SCRIPT_INDIC = 3, @@ -188,12 +183,15 @@ } TA_Script; typedef struct TA_ScriptClassRec_ const* TA_ScriptClass; +typedef struct TA_FaceGlobalsRec_* TA_FaceGlobals; typedef struct TA_ScriptMetricsRec_ { TA_ScriptClass clazz; TA_ScalerRec scaler; FT_Bool digits_have_same_width; + + TA_FaceGlobals globals; /* to access properties */ } TA_ScriptMetricsRec, *TA_ScriptMetrics; @@ -231,6 +229,7 @@ { TA_Script script; TA_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ + FT_UInt32 standard_char; /* for default width and height */ FT_Offset script_metrics_size; TA_Script_InitMetricsFunc script_metrics_init; diff -Nru ttfautohint-0.9/lib/ttfautohint-errors.h ttfautohint-0.94/lib/ttfautohint-errors.h --- ttfautohint-0.9/lib/ttfautohint-errors.h 2012-05-10 04:52:38.000000000 +0000 +++ ttfautohint-0.94/lib/ttfautohint-errors.h 2012-11-11 18:29:05.000000000 +0000 @@ -59,12 +59,16 @@ "missing key character glyph") TA_ERRORDEF_(Missing_Unicode_CMap, 0xF2, \ "missing Unicode character map") -TA_ERRORDEF_(Canceled, 0xF3, \ +TA_ERRORDEF_(Missing_Symbol_CMap, 0xF3, \ + "missing symbol character map") +TA_ERRORDEF_(Canceled, 0xF4, \ "execution canceled") -TA_ERRORDEF_(Already_Processed, 0xF4, \ +TA_ERRORDEF_(Already_Processed, 0xF5, \ "font already processed by ttfautohint") -TA_ERRORDEF_(Invalid_Font_Type, 0xF5, \ +TA_ERRORDEF_(Invalid_Font_Type, 0xF6, \ "not a font with TrueType outlines in SFNT format") +TA_ERRORDEF_(Unknown_Argument, 0xF7, \ + "unknown argument") #ifdef TA_ERROR_END_LIST TA_ERROR_END_LIST diff -Nru ttfautohint-0.9/lib/ttfautohint.c ttfautohint-0.94/lib/ttfautohint.c --- ttfautohint-0.9/lib/ttfautohint.c 2012-06-04 13:41:00.000000000 +0000 +++ ttfautohint-0.94/lib/ttfautohint.c 2012-11-23 22:18:04.000000000 +0000 @@ -23,8 +23,28 @@ #include "ta.h" -#define COMPARE(str) (len == (sizeof (str) - 1) \ - && !strncmp(start, str, sizeof (str) - 1)) +#define COMPARE(str) \ + (len == (sizeof (str) - 1) \ + && !strncmp(start, str, sizeof (str) - 1)) +#define DUMPVAL(str, arg) \ + fprintf(stderr, "%33s = %ld\n", \ + (str), \ + (FT_Long)(arg)) +#define DUMPSTR(str, arg) \ + fprintf(stderr, "%33s = %s\n", \ + (str), \ + (arg)) + + +void +TA_sfnt_set_properties(SFNT* sfnt, + FONT* font) +{ + TA_FaceGlobals globals = (TA_FaceGlobals)sfnt->face->autohint.data; + + + globals->increase_x_height = font->increase_x_height; +} TA_Error @@ -52,16 +72,27 @@ FT_Long hinting_limit = -1; FT_Long increase_x_height = -1; + const char* x_height_snapping_exceptions_string = NULL; + number_range* x_height_snapping_exceptions = NULL; + + FT_Bool gray_strong_stem_width = 0; + FT_Bool gdi_cleartype_strong_stem_width = 1; + FT_Bool dw_cleartype_strong_stem_width = 0; + TA_Progress_Func progress; void* progress_data; TA_Info_Func info; void* info_data; + FT_Bool windows_compatibility = 0; FT_Bool ignore_restrictions = 0; FT_Bool pre_hinting = 0; - FT_UInt fallback_script = 0; + FT_Bool hint_with_components = 0; + FT_UInt fallback_script = TA_SCRIPT_FALLBACK; FT_Bool symbol = 0; + FT_Bool debug = 0; + const char* op; @@ -100,17 +131,27 @@ /* the `COMPARE' macro uses `len' and `start' */ - /* handle option */ - if (COMPARE("error-string")) + /* handle options -- don't forget to update parameter dump below! */ + if (COMPARE("debug")) + debug = (FT_Bool)va_arg(ap, FT_Int); + else if (COMPARE("dw-cleartype-strong-stem-width")) + dw_cleartype_strong_stem_width = (FT_Bool)va_arg(ap, FT_Int); + else if (COMPARE("error-string")) error_stringp = va_arg(ap, const unsigned char**); else if (COMPARE("fallback-script")) fallback_script = va_arg(ap, FT_UInt); + else if (COMPARE("gdi-cleartype-strong-stem-width")) + gdi_cleartype_strong_stem_width = (FT_Bool)va_arg(ap, FT_Int); + else if (COMPARE("gray-strong-stem-width")) + gray_strong_stem_width = (FT_Bool)va_arg(ap, FT_Int); else if (COMPARE("hinting-limit")) hinting_limit = (FT_Long)va_arg(ap, FT_UInt); else if (COMPARE("hinting-range-max")) hinting_range_max = (FT_Long)va_arg(ap, FT_UInt); else if (COMPARE("hinting-range-min")) hinting_range_min = (FT_Long)va_arg(ap, FT_UInt); + else if (COMPARE("hint-with-components")) + hint_with_components = (FT_Bool)va_arg(ap, FT_Int); else if (COMPARE("ignore-restrictions")) ignore_restrictions = (FT_Bool)va_arg(ap, FT_Int); else if (COMPARE("in-buffer")) @@ -131,15 +172,15 @@ } else if (COMPARE("increase-x-height")) increase_x_height = (FT_Long)va_arg(ap, FT_UInt); + else if (COMPARE("info-callback")) + info = va_arg(ap, TA_Info_Func); + else if (COMPARE("info-callback-data")) + info_data = va_arg(ap, void*); else if (COMPARE("out-buffer")) { out_file = NULL; out_bufp = va_arg(ap, char**); } - else if (COMPARE("info-callback")) - info = va_arg(ap, TA_Info_Func); - else if (COMPARE("info-callback-data")) - info_data = va_arg(ap, void*); else if (COMPARE("out-buffer-len")) { out_file = NULL; @@ -159,10 +200,15 @@ progress_data = va_arg(ap, void*); else if (COMPARE("symbol")) symbol = (FT_Bool)va_arg(ap, FT_Int); - - /* - x-height-snapping-exceptions - */ + else if (COMPARE("windows-compatibility")) + windows_compatibility = (FT_Bool)va_arg(ap, FT_Int); + else if (COMPARE("x-height-snapping-exceptions")) + x_height_snapping_exceptions_string = va_arg(ap, const char*); + else + { + error = TA_Err_Unknown_Argument; + goto Err1; + } End: if (!*op) @@ -220,9 +266,8 @@ if (hinting_limit < 0) hinting_limit = TA_HINTING_LIMIT; - /* we have 4 bits to store the values 0 and 6-20 */ if (increase_x_height > 0 - && (increase_x_height < 6 || increase_x_height > 20)) + && increase_x_height < TA_PROP_INCREASE_X_HEIGHT_MIN) { error = FT_Err_Invalid_Argument; goto Err1; @@ -230,22 +275,89 @@ if (increase_x_height < 0) increase_x_height = TA_INCREASE_X_HEIGHT; + if (x_height_snapping_exceptions_string) + { + const char* s = number_set_parse(x_height_snapping_exceptions_string, + &x_height_snapping_exceptions, + TA_PROP_INCREASE_X_HEIGHT_MIN, + 0x7FFF); + if (*s) + { + error = FT_Err_Invalid_Argument; + goto Err1; + } + } + font->hinting_range_min = (FT_UInt)hinting_range_min; font->hinting_range_max = (FT_UInt)hinting_range_max; font->hinting_limit = (FT_UInt)hinting_limit; font->increase_x_height = increase_x_height; + font->x_height_snapping_exceptions = x_height_snapping_exceptions; + + font->gray_strong_stem_width = gray_strong_stem_width; + font->gdi_cleartype_strong_stem_width = gdi_cleartype_strong_stem_width; + font->dw_cleartype_strong_stem_width = dw_cleartype_strong_stem_width; font->progress = progress; font->progress_data = progress_data; font->info = info; font->info_data = info_data; + font->windows_compatibility = windows_compatibility; font->ignore_restrictions = ignore_restrictions; font->pre_hinting = pre_hinting; - /* restrict value to two bits */ - font->fallback_script = fallback_script & 3; + font->hint_with_components = hint_with_components; + font->fallback_script = fallback_script; font->symbol = symbol; + font->gasp_idx = MISSING; + + font->debug = debug; + + /* dump parameters */ + if (debug) + { + char *s; + + + fprintf(stderr, "TTF_autohint parameters\n" + "=======================\n\n"); + + DUMPVAL("dw-cleartype-strong-stem-width", + font->dw_cleartype_strong_stem_width); + DUMPVAL("fallback-script", + font->fallback_script); + DUMPVAL("gdi-cleartype-strong-stem-width", + font->gdi_cleartype_strong_stem_width); + DUMPVAL("gray-strong-stem-width", + font->gray_strong_stem_width); + DUMPVAL("hinting-limit", + font->hinting_limit); + DUMPVAL("hinting-range-max", + font->hinting_range_max); + DUMPVAL("hinting-range-min", + font->hinting_range_min); + DUMPVAL("hint-with-components", + font->hint_with_components); + DUMPVAL("ignore-restrictions", + font->ignore_restrictions); + DUMPVAL("increase-x-height", + font->increase_x_height); + DUMPVAL("pre-hinting", + font->pre_hinting); + DUMPVAL("symbol", + font->symbol); + DUMPVAL("windows-compatibility", + font->windows_compatibility); + + s = number_set_show(font->x_height_snapping_exceptions, + TA_PROP_INCREASE_X_HEIGHT_MIN, 0x7FFF); + DUMPSTR("x-height-snapping-exceptions", s); + free(s); + + fprintf(stderr, "\n"); + } + /* now start with processing the data */ if (in_file) @@ -270,7 +382,10 @@ if (error) goto Err; - /* loop over subfonts */ + if (font->debug) + _ta_debug = 1; + + /* we do some loops over all subfonts */ for (i = 0; i < font->num_sfnts; i++) { SFNT* sfnt = &font->sfnts[i]; @@ -280,7 +395,8 @@ error = FT_New_Memory_Face(font->lib, font->in_buf, font->in_len, i, &sfnt->face); - /* assure that the font hasn't been already processed by ttfautohint */ + /* assure that the font hasn't been already processed by ttfautohint; */ + /* another, more thorough check is done in TA_glyph_parse_simple */ idx = FT_Get_Name_Index(sfnt->face, TTFAUTOHINT_GLYPH); if (idx) { @@ -302,6 +418,14 @@ if (error) goto Err; + /* this call creates a `globals' object... */ + error = TA_sfnt_handle_coverage(sfnt, font); + if (error) + goto Err; + + /* ... so that we now can initialize its properties */ + TA_sfnt_set_properties(sfnt, font); + /* check permission */ if (sfnt->OS2_idx != MISSING) { @@ -318,32 +442,28 @@ } } - /* build `gasp' table */ - error = TA_sfnt_build_gasp_table(&font->sfnts[0], font); - if (error) - goto Err; + for (i = 0; i < font->num_sfnts; i++) + { + SFNT* sfnt = &font->sfnts[i]; - /* XXX handle subfonts for bytecode tables */ - /* build `cvt ' table */ - error = TA_sfnt_build_cvt_table(&font->sfnts[0], font); - if (error) - goto Err; + TA_sfnt_adjust_master_coverage(sfnt, font); + } - /* build `fpgm' table */ - error = TA_sfnt_build_fpgm_table(&font->sfnts[0], font); - if (error) - goto Err; +#if 0 + /* this code is here for completeness -- */ + /* right now, `glyf' tables get hinted only once, */ + /* and referring subfonts simply reuse it, */ + /* but this might change in the future */ - /* build `prep' table */ - error = TA_sfnt_build_prep_table(&font->sfnts[0], font); - if (error) - goto Err; + for (i = 0; i < font->num_sfnts; i++) + { + SFNT* sfnt = &font->sfnts[i]; - /* hint the glyphs and build bytecode */ - error = TA_sfnt_build_glyf_hints(&font->sfnts[0], font); - if (error) - goto Err; + + TA_sfnt_copy_master_coverage(sfnt, font); + } +#endif /* loop again over subfonts */ for (i = 0; i < font->num_sfnts; i++) @@ -351,18 +471,46 @@ SFNT* sfnt = &font->sfnts[i]; + error = ta_loader_init(font); + if (error) + goto Err; + + error = TA_sfnt_build_gasp_table(sfnt, font); + if (error) + goto Err; + error = TA_sfnt_build_cvt_table(sfnt, font); + if (error) + goto Err; + error = TA_sfnt_build_fpgm_table(sfnt, font); + if (error) + goto Err; + error = TA_sfnt_build_prep_table(sfnt, font); + if (error) + goto Err; error = TA_sfnt_build_glyf_table(sfnt, font); if (error) goto Err; error = TA_sfnt_build_loca_table(sfnt, font); if (error) goto Err; + + if (font->loader) + ta_loader_done(font); + } + + for (i = 0; i < font->num_sfnts; i++) + { + SFNT* sfnt = &font->sfnts[i]; + + error = TA_sfnt_update_maxp_table(sfnt, font); if (error) goto Err; /* we add one glyph for composites */ - if (sfnt->max_components && !font->pre_hinting) + if (sfnt->max_components + && !font->pre_hinting + && font->hint_with_components) { error = TA_sfnt_update_hmtx_table(sfnt, font); if (error) diff -Nru ttfautohint-0.9/lib/ttfautohint.h ttfautohint-0.94/lib/ttfautohint.h --- ttfautohint-0.9/lib/ttfautohint.h 2012-06-04 13:59:00.000000000 +0000 +++ ttfautohint-0.94/lib/ttfautohint.h 2012-11-19 10:38:36.000000000 +0000 @@ -86,8 +86,7 @@ * (this value can't be larger than 65535). * * *curr_sfnt* gives the current subfont within a TrueType Collection (TTC), - * and *num_sfnts* the total number of subfonts. Currently, the ttfautohint - * library only hints glyphs from the `glyf` table used in subfont\ 0. + * and *num_sfnts* the total number of subfonts. * * If the return value is non-zero, `TTF_autohint` aborts with * `TA_Err_Canceled`. Use this for a 'Cancel' button or similar features in @@ -240,13 +239,41 @@ * this field is not set, it defaults to `TA_HINTING_LIMIT`. If it is * set to\ 0, no hinting limit is added to the bytecode. * + * `gray-strong-stem-width` + * : An integer (1\ for 'on' and 0\ for 'off', which is the default) which + * specifies whether horizontal stems should be snapped and positioned + * to integer pixel values for normal grayscale rendering. + * + * `gdi-cleartype-strong-stem-width` + * : An integer (1\ for 'on', which is the default, and 0\ for 'off') which + * specifies whether horizontal stems should be snapped and positioned + * to integer pixel values for GDI ClearType rendering, this is, the + * rasterizer version (as returned by the GETINFO bytecode instruction) + * is in the range 36\ <= version <\ 38 and ClearType is enabled. + * + * `dw-cleartype-strong-stem-width` + * : An integer (1\ for 'on' and 0\ for 'off', which is the default) which + * specifies whether horizontal stems should be snapped and positioned + * to integer pixel values for DW ClearType rendering, this is, the + * rasterizer version (as returned by the GETINFO bytecode instruction) + * is >=\ 38, ClearType is enabled, and subpixel positioning is enabled + * also. + * * `increase-x-height` - * : An integer in the range 6-20. For PPEM values in the range 6\ <= - * PPEM <=\ `increase-x-height`, round up the font's x\ height much more - * often than normally. If it is set to\ 0, this feature is switched - * off. If this field is not set, it defaults to - * `TA_INCREASE_X_HEIGHT`. Use this flag to improve the legibility of - * small font sizes if necessary. + * : An integer. For PPEM values in the range 6\ <= PPEM + * <=\ `increase-x-height`, round up the font's x\ height much more often + * than normally. If it is set to\ 0, this feature is switched off. If + * this field is not set, it defaults to `TA_INCREASE_X_HEIGHT`. Use + * this flag to improve the legibility of small font sizes if necessary. + * + * `hint-with-components` + * : If this integer is set to\ 1 (which is the default), ttfautohint + * handles composite glyphs as a whole. This implies adding a special + * glyph to the font, as documented [here](#the-.ttfautohint-glyph). + * Setting it to\ 0, the components of composite glyphs are hinted + * separately. While separate hinting of subglyphs makes the resulting + * bytecode much smaller, it might deliver worse results. However, this + * depends on the processed font and must be checked by inspection. * * `pre-hinting` * : An integer (1\ for 'on' and 0\ for 'off', which is the default) to @@ -258,7 +285,7 @@ * * `info-callback` * : A pointer of type [`TA_Info_Func`](#callback-ta_info_func), - * specifying a callback function for manipulating the `name` table. + * specifying a callback function for manipulating the `name` table. * This function gets called for each `name` table entry. If not set or * set to NULL, the table data stays unmodified. * @@ -270,10 +297,22 @@ * : A pointer of type `const char*` to a null-terminated string which * gives a list of comma separated PPEM values or value ranges at which * no x-height snapping shall be applied. A value range has the form - * *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. - * Whitespace is not significant; a trailing comma is ignored. If the - * supplied argument is NULL, no x-height snapping takes place at all. - * By default, there are no snapping exceptions. Not implemented yet. + * *value1*`-`*value2*, meaning *value1* <= PPEM <= *value2*. *value1* + * or *value2* (or both) can be missing; a missing value is replaced by + * the beginning or end of the whole interval of valid PPEM values, + * respectively. Whitespace is not significant; superfluous commas are + * ignored, and ranges must be specified in increasing order. For + * example, the string `"3, 5-7, 9-"` means the values 3, 5, 6, 7, 9, + * 10, 11, 12, etc. Consequently, if the supplied argument is `"-"`, no + * x-height snapping takes place at all. The default is the empty + * string (`""`), meaning no snapping exceptions. + * + * `windows-compatibility` + * : If this integer is set to\ 1, two artificial blue zones are used, + * positioned at the `usWinAscent` and `usWinDescent` values (from the + * font's `OS/2` table). The idea is to help ttfautohint so that the + * hinted glyphs stay within this horizontal stripe since Windows clips + * everything falling outside. The default is\ 0. * * `ignore-restrictions` * : If the font has set bit\ 1 in the 'fsType' field of the `OS/2` table, @@ -297,10 +336,14 @@ * (for the latin script, it is character 'o'). The default value * is\ 0. * + * `debug` + * : If this integer is set to\ 1, lots of debugging information is print + * to stderr. The default value is\ 0. + * * Remarks: * - * * Obviously, it is necessary to have an input and an output data stream. - * All other options are optional. + * * Obviously, it is necessary to have an input and an output data + * stream. All other options are optional. * * * `hinting-range-min` and `hinting-range-max` specify the range for * which the autohinter generates optimized hinting code. If a PPEM