Commit 18e5566d authored by Vasudev Kamath's avatar Vasudev Kamath

Imported Upstream version 1.4

parent 0e145cfd
......@@ -43,17 +43,27 @@ modified version which carries forward this exception.
The following files are distributed with the source bundle of the
ttfautohint library to configure and build the library with GNU tools, but
which aren't part of it due to a different license (GPL only).
which aren't part of it due to different licenses.
bootstrap
bootstrap.conf
m4/ltlize_lang.m4
GPL only:
bootstrap
bootstrap.conf
m4/autotroll.m4
m4/ltlize_lang.m4
m4/pkg.m4
X11 license:
lib/llrb.h
two-clause BSD license:
lib/sds.c
lib/sds.h
All files of the following directories are distributed with the source
bundle of the ttfautohint library to configure and build the library with
GNU tools, but which aren't part of it due to a different license (GPL
only).
GNU tools, but which aren't part of it due to a different license.
gnulib
GPL only:
gnulib
EOF
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
ttfautohint 0.97
----------------
ttfautohint 1.4
---------------
by Werner Lemberg <wl@gnu.org>
This project provides a library which takes a TrueType font as the input,
This project provides a library that 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.
auto-hinting module. The idea is to provide the excellent quality of the
auto-hinter on platforms that don't use FreeType.
The library has a single API function, `TTF_autohint'; see
`lib/ttfautohint.h' for a detailed description. Note that the library
......@@ -27,11 +27,11 @@ to read its manual page.
A GUI to the library is `ttfautohintGUI'; it uses the Qt4 framework. The
compilation of this application can be disabled with the `--without-qt'
configuration option.
option of the `configure' script.
-----------------------------------------------------------------------------
Copyright (C) 2011-2013 by Werner Lemberg.
Copyright (C) 2011-2015 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
......
......@@ -20,8 +20,12 @@ library and front-ends:
Dave Arnold <darnold@adobe.com>
Vernon Adams <vern@newtypography.co.uk>
Frederik Berlaen <frederik@typemytype.com>
Frank E. Blokland <blokland@dutchtypelibrary.com>
James Cloos <cloos@jhcloos.com>
Girish Dalvi <girish.dalvi@gmail.com>
Erwin Denissen <erwin.denissen@high-logic.com>
Ralf S. Engelschall <rse@engelschall.com>
Wei Huang <weiandhimself@gmail.com>
Greg Hitchcock <gregh@microsoft.com>
Hirwen Harendal <harendalh@gmail.com>
Khaled Hosny <khaledhosny@eglug.org>
......@@ -29,6 +33,8 @@ Daniel Johnson <il.basso.buffo@gmail.com>
David Lemon <lemon@adobe.com>
Karsten Lücke <karsten.luecke@kltf.de>
Thomas Phinney <TPhinney@extensis.com>
Thomas Rutter <trr@thomasrutter.com>
Marc Schönefeld <marc.schoenefeld@gmx.org>
Eben Sorkin <eben@eyebytes.com>
Adam Twardoch <adam@fontlab.com>
Zack Weinberg <zackw@panix.com>
......
......@@ -7,9 +7,6 @@ add features to the GUI
-> preview similar to ftgrid
-> autocompletion of file names with tab key
handle OT features
-> use HarfBuzz as soon it provides the necessary APIs
control `gasp' table; Adam Twardoch suggest the following:
1. Calculate "gaspstem", i.e. the most common thickness of horizontal
......@@ -32,15 +29,12 @@ create a separate blue zone class for `i' and `j':
separately
. otherwise, unify them with `f' and friends.
control the characters used for blue zones
-> non-latin scripts
user-defined blue zones?
-> old-style digits
control the width of blue zones
add control over character ranges which define a script; in particular, add
add control over character ranges that define a script; in particular, add
support for the PUA
handle normal and bold fonts differently; cf. Infinality patches;
......@@ -57,19 +51,21 @@ try to `embolden' fonts at small sizes to avoid drop-outs; cf. Infinality
make switching between smooth and strong hinting dependent on user-defined
ranges
improve `pre-hinting' by making the used PPEM value configurable
improve `adjust-subglyphs' by making the used PPEM value configurable
allow hinting of single glyphs, using a config file which holds the global
allow hinting of single glyphs, using a config file that holds the global
settings
better handling of `incomplete' fonts (this is, fonts which lack the minimum
better handling of `incomplete' fonts (this is, fonts that lack the minimum
set of glyphs necessary to determine the blue zones)
add second-pass analysis to improve positioning of composite glyphs
minor improvements
------------------
reject fonts which are `hopeless' (for example, `Lipstick')
reject fonts that are `hopeless' (for example, `Lipstick')
correctly set `lowestRecPPEM' field in `head'
......@@ -81,22 +77,23 @@ apply hinting in x direction also?
add a config and/or command file for batch handling
warn against overwrite of output file in TTY mode?
warn against overwrite of output file in command-line mode?
reduce output size of option -p:
1. compare outline rendered at EM value with unhinted outline
2. pre-hint only if 1. differs more than given threshold (default 0.5%?)
2. adjust subglyphs only if result of item 1 differs more than given
threshold (default 0.5%?)
make it possible to hint fonts which aren't alphabetic at all, for example,
make it possible to hint fonts that aren't alphabetic at all, for example,
icons; to do so, provide means to skip the global feature analysis
better control -i output
better control of -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)
again (due to option `hint-composites' this isn't urgent)
make ttfautohint remember options:
1. collect md5 checksums in a `~/.ttfautohint_history' file so that fonts
......@@ -111,7 +108,6 @@ later enhancements
------------------
add CJK autohinting module
add Hebrew autohinting module
instead of emitting bytecode, write the hints as a VTT or FontLab script
......
This diff is collapsed.
#! /bin/sh
# Print a version string.
scriptversion=2013-07-03.20; # UTC
scriptversion=2013-12-05.23; # UTC
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
# Copyright (C) 2003-2014 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
......@@ -209,12 +209,26 @@ bootstrap_sync=false
# Use git to update gnulib sources
use_git=true
check_exists() {
if test "$1" = "--verbose"; then
($2 --version </dev/null) >/dev/null 2>&1
if test $? -ge 126; then
# If not found, run with diagnostics as one may be
# presented with env variables to set to find the right version
($2 --version </dev/null)
fi
else
($1 --version </dev/null) >/dev/null 2>&1
fi
test $? -lt 126
}
# find_tool ENVVAR NAMES...
# -------------------------
# Search for a required program. Use the value of ENVVAR, if set,
# otherwise find the first of the NAMES that can be run (i.e.,
# supports --version). If found, set ENVVAR to the program name,
# die otherwise.
# otherwise find the first of the NAMES that can be run.
# If found, set ENVVAR to the program name, die otherwise.
#
# FIXME: code duplication, see also gnu-web-doc-update.
find_tool ()
......@@ -224,27 +238,21 @@ find_tool ()
find_tool_names=$@
eval "find_tool_res=\$$find_tool_envvar"
if test x"$find_tool_res" = x; then
for i
do
if ($i --version </dev/null) >/dev/null 2>&1; then
find_tool_res=$i
break
for i; do
if check_exists $i; then
find_tool_res=$i
break
fi
done
else
find_tool_error_prefix="\$$find_tool_envvar: "
fi
test x"$find_tool_res" != x \
|| die "one of these is required: $find_tool_names"
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
if test x"$find_tool_res" = x; then
warn_ "one of these is required: $find_tool_names;"
die "alternatively set $find_tool_envvar to a compatible tool"
fi
eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
find_tool SHA1SUM sha1sum gsha1sum shasum
# Override the default configuration, if necessary.
# Make sure that bootstrap.conf is sourced from the current directory
# if we were invoked as "sh bootstrap".
......@@ -326,7 +334,7 @@ insert_if_absent() {
die "Error: Duplicate entries in $file: " $duplicate_entries
fi
linesold=$(gitignore_entries $file | wc -l)
linesnew=$(echo "$str" | gitignore_entries - $file | sort -u | wc -l)
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
if [ $linesold != $linesnew ] ; then
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|| die "insert_if_absent $file $str: failed"
......@@ -410,7 +418,7 @@ sort_ver() { # sort -V is not generally available
get_version() {
app=$1
$app --version >/dev/null 2>&1 || return 1
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
$app --version 2>&1 |
sed -n '# Move version to start of line.
......@@ -469,8 +477,7 @@ check_versions() {
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
$app --version >/dev/null 2>&1
if [ 126 -le $? ]; then
if ! check_exists --verbose $app; then
warn_ "Error: '$app' not found"
ret=1
fi
......@@ -503,6 +510,12 @@ print_versions() {
# can't depend on column -t
}
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
# Also find the compatible sha1 utility on the BSDs
if test x"$SKIP_PO" = x; then
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
fi
use_libtool=0
# We'd like to use grep -E, to see if any of LT_INIT,
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
......@@ -548,13 +561,21 @@ if ! printf "$buildreq" | check_versions; then
fi
fi
# Warn the user if autom4te appears to be broken; this causes known
# issues with at least gettext 0.18.3.
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
if test "x$probe" != xhi; then
warn_ "WARNING: your autom4te wrapper eats stdin;"
warn_ "if bootstrap fails, consider upgrading your autotools"
fi
echo "$0: Bootstrapping from checked-out $package sources..."
# See if we can use gnulib's git-merge-changelog merge driver.
if $use_git && test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if $use_git && test -d .git && check_exists git; then
if git config merge.merge-changelog.driver >/dev/null ; then
:
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
elif check_exists git-merge-changelog; then
echo "$0: initializing git-merge-changelog driver"
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
......@@ -587,8 +608,8 @@ case ${GNULIB_SRCDIR--} in
# Note that $use_git is necessarily true in this case.
if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
git submodule init -- "$gnulib_path" || exit $?
git submodule update -- "$gnulib_path" || exit $?
elif [ ! -d "$gnulib_path" ]; then
echo "$0: getting gnulib files..."
......@@ -617,13 +638,14 @@ case ${GNULIB_SRCDIR--} in
# This fallback allows at least git 1.5.5.
if test -f "$gnulib_path"/gnulib-tool; then
# Since file already exists, assume submodule init already complete.
git submodule update || exit $?
git submodule update -- "$gnulib_path" || exit $?
else
# Older git can't clone into an empty directory.
rmdir "$gnulib_path" 2>/dev/null
git clone --reference "$GNULIB_SRCDIR" \
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
&& git submodule init && git submodule update \
&& git submodule init -- "$gnulib_path" \
&& git submodule update -- "$gnulib_path" \
|| exit $?
fi
fi
......@@ -692,11 +714,10 @@ update_po_files() {
cksum_file="$ref_po_dir/$po.s1"
if ! test -f "$cksum_file" ||
! test -f "$po_dir/$po.po" ||
! $SHA1SUM -c --status "$cksum_file" \
< "$new_po" > /dev/null; then
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
echo "$me: updated $po_dir/$po.po..."
cp "$new_po" "$po_dir/$po.po" \
&& $SHA1SUM < "$new_po" > "$cksum_file"
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
fi
done
}
......
# Bootstrap configuration.
# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
# Copyright (C) 2006-2014 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
......@@ -27,12 +27,20 @@ checkout_only_file=INSTALL.git
# gnulib modules used by this package.
gnulib_modules="
dirname
fcntl-h
getopt-gnu
git-version-gen
isatty
memmem-simple
progname
stdarg
stdbool
stdint
strerror_r-posix
strndup
strtok_r
vasprintf
"
# Additional xgettext options to use. Use "\\\newline" to break lines.
......@@ -77,6 +85,8 @@ fi
buildreq="\
autoconf 2.65
automake 1.13
bison 2.5
flex -
git 1.5.5
libtool 2.2.2
tar -
......
This diff is collapsed.
This diff is collapsed.
# configure.ac
# Copyright (C) 2011-2013 by Werner Lemberg.
# Copyright (C) 2011-2015 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
......@@ -14,9 +14,11 @@ AC_INIT([ttfautohint],
m4_esyscmd([gnulib/git-version-gen VERSION]),
[freetype-devel@nongnu.org])
AC_CONFIG_AUX_DIR([gnulib])
AM_INIT_AUTOMAKE([-Wall -Werror]
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-],
[gnu], [gnits]))
AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar]
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]),
[-], [gnu],
[gnits]))
AC_CONFIG_MACRO_DIRS([gnulib/m4
m4])
......@@ -28,15 +30,21 @@ AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CPP
AC_PROG_CC
AC_PROG_CXX
AC_C_INLINE
PKG_PROG_PKG_CONFIG([0.24])
# AM_PROG_AR is new in automake 1.11.2;
# however, MinGW doesn't have it yet (May 2012)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PATH_PROG([BISON], [bison])
AC_PATH_PROG([FLEX], [flex])
gl_EARLY
gl_INIT
AC_TYPE_UINT64_T
PKG_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 0.9.19])
AT_WITH_QT
AT_REQUIRE_QT_VERSION([4.6])
......@@ -57,6 +65,11 @@ LT_INIT
LT_LTLIZE_LANG([C])
# We use libtool's convenient check for the math library.
LT_LIB_M
AC_SUBST(LIBM)
AC_ARG_WITH([doc],
[AS_HELP_STRING([--with-doc],
[install documentation @<:@default=yes@:>@])],
......@@ -70,7 +83,7 @@ AC_ARG_WITH([freetype-config],
[freetype_config=yes])
if test "$freetype_config" = "yes"; then
AC_PATH_PROG(ft_config,
AC_PATH_TOOL(ft_config,
freetype-config,
no)
if test "$ft_config" = "no"; then
......@@ -203,10 +216,12 @@ if test x"$with_doc" != x"no"; then
fi
# PDF documentation
AC_CHECK_PROGS([LATEX], [lualatex xelatex], [no])
# To support Devanagari and other Indic scripts properly,
# we currently can use XeTeX only.
AC_CHECK_PROGS([LATEX], [xelatex], [no])
if test x"$PDFLATEX" == x"no"; then
TA_DOC([$pdf_file],
[Need lualatex or xelatex to create documentation in PDF format])
[Need xelatex to create documentation in PDF format])
fi
fi
......
# Makefile.am
# Copyright (C) 2011-2013 by Werner Lemberg.
# Copyright (C) 2011-2015 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
......@@ -12,7 +12,9 @@
DOCSRC = ttfautohint-1.pandoc \
ttfautohint-2.pandoc \
ttfautohint-3.pandoc
ttfautohint-3.pandoc \
ttfautohint-4.pandoc \
../NEWS
DOCIMGSVG = img/blue-zones.svg \
img/glyph-terms.svg \
......@@ -35,24 +37,35 @@ DOCIMGPNG = img/ttfautohintGUI.png \
img/e-17px-x14.png \
img/e-17px-x17.png \
img/ff-g-26px.png \
img/ff-g-26px-wD.png
img/ff-g-26px-wD.png \
img/Halant-Regular-O-Q.png \
img/Halant-Regular-O-Q-unhinted-12px.png \
img/Halant-Regular-O-good-Q-badly-hinted-12px.png \
img/Halant-Regular-O-good-Q-better-hinted-12px.png \
img/Halant-Regular-O-good-Q-well-hinted-12px.png
DOC = ttfautohint.html \
ttfautohint.pdf \
ttfautohint.txt \
$(DOCIMGPNG) \
$(DOCIMGSVG) \
$(DOCIMGPDF)
$(DOCIMGPDF) \
footnote-popup.js \
jquery-1.11.2.min.js \
toc-unfold.js
EXTRA_DIST = c2pandoc.sed \
taranges.sed \
make-snapshot.sh \
strip-comments.sh \
ttfautohint-1.pandoc \
ttfautohint-2.pandoc \
ttfautohint-3.pandoc \
ttfautohint-4.pandoc \
template.html \
template.tex \
ttfautohint-css.html
ttfautohint-css.html \
ttfautohint-js.html
if WITH_DOC
nobase_dist_doc_DATA = $(DOC)
......@@ -62,6 +75,9 @@ endif
ttfautohint-2.pandoc: $(top_srcdir)/lib/ttfautohint.h
$(SED) -f $(srcdir)/c2pandoc.sed < $< > $@
ttfautohint-4.pandoc: $(top_srcdir)/lib/taranges.c
$(SED) -f $(srcdir)/taranges.sed < $< > $@
ttfautohint.txt: $(DOCSRC)
$(SHELL) $(srcdir)/strip-comments.sh $^ > $@
......@@ -83,13 +99,15 @@ if WITH_DOC
$(top_builddir)/frontend/ttfautohintGUI$(EXEEXT) $@
ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) \
ttfautohint-css.html template.html $(top_srcdir)/.version
ttfautohint-css.html ttfautohint-js.html \
template.html $(top_srcdir)/.version
$(PANDOC) --smart \
--template=$(srcdir)/template.html \
--default-image-extension=".svg" \
--variable="version:$(VERSION)" \
--toc \
--include-in-header=$(srcdir)/ttfautohint-css.html \
--include-in-header=$(srcdir)/ttfautohint-js.html \
--standalone \
--output=$@ $<
......
This diff is collapsed.
/*!
* footnote-popup.js
*
* JavaScript code to make pandoc footnotes pop up
*
* written 2014 by Werner Lemberg
* based on code from http://ignorethecode.net/blog/2010/04/20/footnotes
*/
// This code snippet needs `jquery' (http://code.jquery.com/jquery-1.11.2.js)
// Add a #footnotediv rule to the CSS code to style the pop-up window.
$(document).ready(function() {
Footnotes.setup();
});
var Footnotes = {
footnotetimeout: false,
setup: function() {
/* collect all footnote links that have an ID starting with `fnref' */
var footnotelinks = $("a[id^='fnref']")
/* clean-up */
footnotelinks.unbind('mouseover', Footnotes.footnoteover);
footnotelinks.unbind('mouseout', Footnotes.footnoteoout);
/* assign our mouse handling functions to the collected footnote links */
footnotelinks.bind('mouseover', Footnotes.footnoteover);
footnotelinks.bind('mouseout', Footnotes.footnoteoout);
},
footnoteover: function() {
clearTimeout(Footnotes.footnotetimeout);
/* clean-up */
$('#footnotediv').stop();
$('#footnotediv').remove();
/* extract position of the current footnote link and get the ID the
`href' attribute is pointing to */
var id = $(this).attr('href').substr(1);
var position = $(this).offset();
/* build a diversion having the ID `footnotediv' */
var div = $(document.createElement('div'));
div.attr('id', 'footnotediv');
/* assign our mouse handling functions to the diversion */
div.bind('mouseover', Footnotes.divover);
div.bind('mouseout', Footnotes.footnoteoout);
/* get the footnote data */
var el = document.getElementById(id);
div.html($(el).html());
/* pandoc inserts a `return symbol' (embedded in a hyperlink) at the
very end of the footnote; it doesn't make sense to display it in a
pop-up window, so we remove it */
div.find('a').last().remove();
/* finally, create some CSS data for the diversion */
div.css({
position: 'absolute',
width: '20em',
opacity: 0.95
});
$(document.body).append(div);
/* ensure that our pop-up window gets displayed on screen */
var left = position.left;
if (left + div.width() + 20 > $(window).width() + $(window).scrollLeft())
left = $(window).width() - div.width() - 20 + $(window).scrollLeft();