--- freetype-2.1.10.orig/debian/control +++ freetype-2.1.10/debian/control @@ -0,0 +1,85 @@ +Source: freetype +Section: libs +Priority: optional +Maintainer: Will Newton +Build-Depends: bzip2, debhelper (>= 4.0.0), docbook-to-man, gettext (>= 0.10.36-2), xlibs-dev, libz-dev +Standards-Version: 3.6.1 + +Package: libfreetype6 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Suggests: libfreetype6-dev +Conflicts: freetype, xpdf-reader (<< 1.00-4) +Replaces: freetype0, freetype1 +Description: FreeType 2 font engine, shared library files + The FreeType project is a team of volunteers who develop free, + portable and high-quality software solutions for digital typography. + They specifically target embedded systems and focus on bringing small, + efficient and ubiquitous products. + . + The FreeType 2 library is their new software font engine. It has been + designed to provide the following important features: + * A universal and simple API to manage font files + * Support for several font formats through loadable modules + * High-quality anti-aliasing + * High portability & performance + . + Supported font formats include: + * TrueType files (.ttf) and collections (.ttc) + * Type 1 font files both in ASCII (.pfa) or binary (.pfb) format + * Type 1 Multiple Master fonts. The FreeType 2 API also provides + routines to manage design instances easily + * Type 1 CID-keyed fonts + * OpenType/CFF (.otf) fonts + * CFF/Type 2 fonts + * Adobe CEF fonts (.cef), used to embed fonts in SVG documents with + the Adobe SVG viewer plugin. + * Windows FNT/FON bitmap fonts + . + This package contains the files needed to run programs that use the + FreeType 2 library. + . + Home Page: http://www.freetype.org/ + Authors: David Turner + Robert Wilhelm + Werner Lemberg + +Package: libfreetype6-dev +Architecture: any +Section: libdevel +Depends: libfreetype6 (= ${Source-Version}), libc6-dev | libc-dev, zlib1g-dev | libz-dev +Conflicts: freetype0-dev, freetype1 (<= 1.0.0.1998-03-22-1), freetype1-dev +Replaces: freetype0-dev, freetype1-dev +Description: FreeType 2 font engine, development files + The FreeType project is a team of volunteers who develop free, + portable and high-quality software solutions for digital typography. + They specifically target embedded systems and focus on bringing small, + efficient and ubiquitous products. + . + This package contains all supplementary files (static library, headers + and documentation) you need to develop your own programs using the + FreeType 2 library. + +Package: freetype2-demos +Architecture: any +Section: utils +Depends: ${shlibs:Depends} +Replaces: freetype-tools +Description: FreeType 2 demonstration programs + This package contains some demonstration programs and utilities + which showcase the features of the FreeType 2 font engine. + +Package: libfreetype6-udeb +Priority: extra +Architecture: any +Depends: ${shlibs:Depends} +Provides: libfreetype6 +Section: debian-installer +Description: FreeType 2 font engine for the debian-installer + The FreeType project is a team of volunteers who develop free, + portable and high-quality software solutions for digital typography. + They specifically target embedded systems and focus on bringing small, + efficient and ubiquitous products. + . + This is the udeb package for use with the debian-installer. --- freetype-2.1.10.orig/debian/libfreetype6.postinst +++ freetype-2.1.10/debian/libfreetype6.postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +# Remove leftovers from some old version of XFree86 package +rm -f /usr/X11R6/lib/libfreetype.so* + +#DEBHELPER# --- freetype-2.1.10.orig/debian/libfreetype6.files +++ freetype-2.1.10/debian/libfreetype6.files @@ -0,0 +1 @@ +usr/lib/*.so.* --- freetype-2.1.10.orig/debian/rules +++ freetype-2.1.10/debian/rules @@ -0,0 +1,338 @@ +#!/usr/bin/make -f +# +# This is free software; see the GNU General Public Licence +# version 2 or later for copying conditions. There is NO warranty. + +SHELL = /bin/bash + +# FreeType sets its -Wall in XX_CFLAGS +CFLAGS = -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 -fno-strict-aliasing +endif + +UPACKAGE = $(shell dh_listpackages | grep -- -udeb$$) +VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) +ARCH = $(shell dpkg --print-architecture) +UFILENAME = $(UPACKAGE)_$(VERSION)_$(ARCH).udeb + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=4 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +srcpkg = freetype2 + +# Remember to update the following for each release. +# ver := $(shell ( head -1 | sed -e 's/^.*(\(.\+\)-.*).*/\1/' ) < debian/changelog) +ver := 2.1.10 +# Just in case the versions are different +freetype_ver := $(ver) +ftdocs_ver := $(ver) +ft2demos_ver := $(ver) +dependency = $(libpkg) (>= 2.1.10-1) + +freetype_u := freetype-$(freetype_ver) +ftdocs_u := freetype-doc-$(ftdocs_ver) +ftdocs_d := freetype-doc-$(ftdocs_ver) +ft2demos_u := ft2demos-$(ft2demos_ver) + +libpkg := libfreetype6 +devpkg := $(libpkg)-dev +docpkg := $(libpkg)-doc +demospkg := freetype2-demos +udebpkg := libfreetype6-udeb +docdir := usr/share/doc +patchdir := $(CURDIR)/debian/patches +freetype_config_man := $(CURDIR)/debian/freetype-config.man +freetype_config_sgml := $(CURDIR)/debian/freetype-config.man.sgml + +# These files are general documentation and should go into the lib package. +libdoc = FTL.TXT CHANGES PATENTS TODO + +TMP = $(PWD)/debian/tmp + +build: build-stamp +build-stamp: + dh_testdir + + # Unpack upstream tarballs + @for i in $(freetype_u) $(ftdocs_u) $(ft2demos_u); do \ + if [ -f $$i.tar.bz2 ]; then \ + echo "Unpacking $$i.tar.bz2 ..."; \ + tar -x --bzip2 -f $$i.tar.bz2; \ + elif [ -f $$i.tar.gz ]; then \ + echo "Unpacking $$i.tar.gz ..."; \ + tar -x --gzip -f $$i.tar.gz; \ + else \ + echo "Error! $$i.tar.{bz2,gz} not found!"; \ + exit 1; \ + fi \ + done + + ############################################################### + # + # CVS snapshots + +# # CVS updates as of 2004-xx-xx (after VER-2-1-7) +# patch -p1 -d $(freetype_u) \ +# -i $(patchdir)/001-freetype-2.1.4+cvs20030818.diff +# patch -p1 -d $(ft2demos_u) \ +# -i $(patchdir)/002-ft2demos-2.1.4+cvs20030703.diff + + ############################################################### + # + # Other patches + + # Use half of maximum horiAdvance when appropriate (e.g. ASCII) + # Disabled by Will Newton. + # Does not apply to 2.1.10. + #patch -p0 -i $(patchdir)/004-freetype-2.1.7-ttgload-monospace-halfwidth.diff + + # face->num_glyphs may be less than the assigned codepoints from cmap + patch -p1 -d $(ft2demos_u) \ + -i $(patchdir)/005-ft2demos-2.1.7-ftbench.diff + + # Turn on CJK font specific autohinting, written by Akito Hirai + # and recommended by Firefly. + # http://www.kde.gr.jp/~akito/patch/download.html + # Disabled by Will Newton. + # This patch does not apply to recent (> 2.1.7) versions of FreeType. + #patch -p1 -d $(freetype_u) \ + # -i $(patchdir)/012-freetype-2.1.7-autohint-cjkfonts-20031130.diff + + # Turn on bytecode interpreter, but use unpatented hinting + # and forces its use. Many thanks to Graham Asher for this great + # feature to circumvent bad Apple's patent. :-p + patch -p1 -d $(freetype_u) -i $(patchdir)/030-bytecode-interpreter.diff + #patch -p0 -i $(patchdir)/031-compile-unpatented-hinting.diff + #patch -p0 -i $(patchdir)/032-force-unpatented-hinting.diff + + # No, we do not want rpath on Debian; reversing YAMANO-UCHI Hidetoshi's + # 2003-06-13 change. (Anthony Fok, 2003-08-28) + patch -p1 -d $(ft2demos_u) \ + -i $(patchdir)/070-ft2demos-2.1.7-no-rpath.diff + + # Too much jaggies? Not sure, let's disable this for now... + #patch -p0 -i $(patchdir)/200-freetype-2.1.4-smooth-usegamma-20030519.diff + # David Chester suggested that we comment out the "custom fix" + # in kerning code + # patch -p0 -i $(patchdir)/007-freetype-2.1.3-kerning.diff + + # David Chester's autohinter patches +# patch -p0 -d $(freetype_u) \ +# -i $(patchdir)/021-bluescale-rescaling-fix.diff +# patch -p0 -d $(freetype_u) \ +# -i $(patchdir)/022-psh-bluescale.diff + + # More rounding fixes from Artur Zaprzala +# patch -p1 -d $(freetype_u) \ +# -i $(patchdir)/040-ftobjs-more-rounding.diff + + # Doesn't work; FT_Set_Char_Size() does not know load_flags +# patch -p1 -d $(freetype_u) \ +# -i $(patchdir)/050-autohint-rounding.diff + + # Reverting to the algorithm with rounding +# patch -p1 -d $(freetype_u) \ +# -i $(patchdir)/050-more-rounding.diff + + # fix for backwards compat with woody (#251473) + patch -p1 -d $(freetype_u) -i $(patchdir)/080-freetype-2.1.7-backwards-compat.diff + + # backport of normalization fix (#259875) + # Merged in 2.1.10. + #patch -p0 -i $(patchdir)/090-freetype-2.1.7-normalize-fix.diff + + # don't segfault on zero width BDF glyphs (#302269) + patch -p1 -d $(freetype_u) -i $(patchdir)/300-bdflib-zero-width-glyphs.diff + + # don't segfault on BDF glyphs with encodings above 65536 (#305413) + patch -p1 -d $(freetype_u) -i $(patchdir)/300-bdflib-large-encodings.diff + + # link graph with -lm + #patch -p1 -d $(ft2demos_u) -i $(patchdir)/310-ft2demos-2.1.9-graph-link.diff + + # various fixes (mostly embolding) + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-cvsfixes.patch + + # put back internal API used by xorg-x11 + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-xorgfix.patch + + # fix autofit render setup + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-fixautofit.patch + + # fix memleak + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-memleak.patch + + # fix disabled kerning + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-fixkerning.patch + + # fix anti-aliasing rendering + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-fixaliasing.patch + + # fix true-type overflows + patch -p1 -d $(freetype_u) -i $(patchdir)/freetype-2.1.10-security-ttgload-fix.patch + + # security updates + patch -p1 -d $(freetype_u) -i $(patchdir)/400-ttkern-loop-variable.patch + patch -p1 -d $(freetype_u) -i $(patchdir)/401-odd_blue_num-safe_alloc.patch + patch -p1 -d $(freetype_u) -i $(patchdir)/402-int-overflows.patch + patch -p1 -d $(freetype_u) -i $(patchdir)/403-pcf-strlen.patch + patch -p1 -d $(freetype_u) -i $(patchdir)/404-bdf-integer.patch + + cd $(freetype_u) && ./configure --prefix=/usr CFLAGS=\"$(CFLAGS)\" +# cd $(freetype_u) && ./configure --prefix=/usr + $(MAKE) -C $(freetype_u) + + $(MAKE) -C $(ft2demos_u) TOP_DIR=../$(freetype_u) X11_PATH=/usr/X11R6 + + docbook-to-man $(freetype_config_sgml) > $(freetype_config_man) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp $(freetype_config_man) + rm -rf $(freetype_u) $(ft2demos_u) $(ftdocs_d) + dh_clean + +install: DH_OPTIONS= +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) -C $(freetype_u) DESTDIR=$(TMP) install + + dh_movefiles + @if [ "`find debian/tmp ! -type d`" ]; then \ + echo "Error! Not all files are moved out of debian/tmp!"; \ + echo "Please fix your debian/*.files."; \ + exit 1; \ + fi + + dh_installdirs -p$(demospkg)/usr/bin + $(freetype_u)/builds/unix/libtool --mode=install \ + cp -av `find $(ft2demos_u)/bin -type f -perm -u=x -maxdepth 1` \ + $(PWD)/debian/$(demospkg)/usr/bin/ + + cp -a $(freetype_u)/objs/.libs/*so.* $(PWD)/debian/$(udebpkg)/usr/lib + +# Build architecture-independent files here. +# Pass -i to all debhelper commands in this target to reduce clutter. +binary-indep: DH_OPTIONS=-i +binary-indep: +# We have nothing to do by default. + +# Build architecture-dependent files here. +# Pass -a to all debhelper commands in this target to reduce clutter. +binary-arch: DH_OPTIONS=-a +binary-arch: build $(libpkg) $(devpkg) $(demospkg) $(udebpkg) + +$(libpkg): DH_OPTIONS=-p$(libpkg) +$(libpkg): build install + dh_testdir + dh_testroot + dh_installdirs + dh_installdocs $(addprefix $(freetype_u)/docs/,$(libdoc)) \ + $(ftdocs_d)/docs/ft2faq.html + mkdir debian/$(libpkg)/$(docdir)/$(libpkg)/pcf + cp -a $(freetype_u)/src/pcf/README debian/$(libpkg)/$(docdir)/$(libpkg)/pcf/ + dh_installexamples +# dh_installmenu +# dh_undocumented + dh_installchangelogs -k $(freetype_u)/ChangeLog +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip +endif + dh_link + dh_compress + dh_fixperms + dh_makeshlibs -V '$(dependency)' + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +$(devpkg): DH_OPTIONS=-p$(devpkg) +$(devpkg): build install + dh_testdir + dh_testroot + dh_installdirs $(docdir)/$(libpkg) + ln -s $(libpkg) debian/$(devpkg)/$(docdir)/$(devpkg) + dh_installdocs -Xreference/README -Xreference/.cvsignore \ + $(ftdocs_d)/docs/* $(freetype_u)/docs/* + cd debian/$(devpkg)/usr/share/doc/$(devpkg)/ \ + && rm -f $(libdoc) BUILD ft2faq.html + dh_installman $(freetype_config_man) +# dh_installexamples +# dh_installchangelogs +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip +endif + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +$(demospkg): DH_OPTIONS=-p$(demospkg) +$(demospkg): build install + dh_testdir + dh_testroot + dh_installdirs $(docdir)/$(libpkg) + ln -s $(libpkg) debian/$(demospkg)/$(docdir)/$(demospkg) +# dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installmanpages +# dh_undocumented +# dh_installchangelogs +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip +endif + dh_link + dh_compress + dh_fixperms + dh_installdeb + # To be safe, make ft2demos depend on the same version of libfreetype6 + dh_shlibdeps -l debian/$(libpkg)/usr/lib --dpkg-shlibdeps-params=-O \ + | sed -e 's/$(dependency)/$(libpkg) (= $(VERSION))/' \ + > debian/$(demospkg).substvars + dh_gencontrol + dh_md5sums + dh_builddeb + +$(udebpkg): DH_OPTIONS=-p$(udebpkg) +$(udebpkg): build install + dh_testdir + dh_testroot + dh_installdirs +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip +endif + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol -- -fdebian/files~ + dpkg-distaddfile $(UFILENAME) debian-installer extra + dh_builddeb --filename=$(UFILENAME) + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary \ + $(libpkg) $(devpkg) install --- freetype-2.1.10.orig/debian/libfreetype6.copyright +++ freetype-2.1.10/debian/libfreetype6.copyright @@ -0,0 +1,357 @@ +This package was Debianized by Christoph Lameter on +Thu, 7 Nov 1996 11:51:45 -0800. It was then picked up by +Anthony Fok on Mon, 11 Aug 1997 08:10:02 -0600 + +It was downloaded from + ftp://ftp.freetype.org/freetype/freetype2/ + +Home Page: + http://www.freetype.org/ + +Upstream Authors: + + The FreeType Project + David Turner + Robert Wilhelm + Werner Lemberg + + The FreeType 2 auto-hinter + Designed and implemented by David Turner under contract + for Catharon Productions, Inc. http://www.catharon.com/ + + FreeType font driver for PCF fonts + Francesco Zappa Nardelli + + +Copyright: + +FreeType comes with two licenses from which you can choose the one which +fits your needs best: + + . The FreeType License, in file `FTL.txt'. + + . The GNU General Public License, in file `/usr/share/common-licenses/GPL'. + +The contributed PCF driver comes with a license similar to that of +X Window System which is compatible to the above two licenses +(see file src/pcf/readme). + + +The FreeType License, the Catharon Open Source License and the +license of the contributed PCF driver are listed below: + + + The FreeType Project LICENSE + ---------------------------- + + 2000-Feb-08 + + Copyright 1996-2000 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`LICENSE.TXT') unaltered; any additions, deletions or changes + to the original files must be clearly indicated in + accompanying documentation. The copyright notices of the + unaltered, original files must be preserved in all copies of + source files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@freetype.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o devel@freetype.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + o http://www.freetype.org + + Holds the current FreeType web page, which will allow you to + download our latest development version and read online + documentation. + + You can also contact us individually at: + + David Turner + Robert Wilhelm + Werner Lemberg + + +--- end of LICENSE.TXT --- + + + The Catharon Open Source LICENSE + ---------------------------- + + 2000-Jul-04 + + Copyright (C) 2000 by Catharon Productions, Inc. + + + +Introduction +============ + + This license applies to source files distributed by Catharon + Productions, Inc. in several archive packages. This license + applies to all files found in such packages which do not fall + under their own explicit license. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we are + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + Catharon Code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering the packages distributed by + Catharon Productions, Inc. and assume no liability related to + their use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `Catharon Package', `package', + and `Catharon Code' refer to the set of files originally + distributed by Catharon Productions, Inc. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using one of the + Catharon Packages'. + + This license applies to all files distributed in the original + Catharon Package(s), including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The Catharon Packages are copyright (C) 2000 by Catharon + Productions, Inc. All rights reserved except as specified below. + +1. No Warranty +-------------- + + THE CATHARON PACKAGES ARE PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OF OR THE INABILITY TO + USE THE CATHARON PACKAGE. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the Catharon Packages (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`license.txt') unaltered; any additions, deletions or changes + to the original files must be clearly indicated in + accompanying documentation. The copyright notices of the + unaltered, original files must be preserved in all copies of + source files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part on the work of + Catharon Productions, Inc. in the distribution documentation. + + These conditions apply to any software derived from or based on + the Catharon Packages, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither Catharon Productions, Inc. and contributors nor you shall + use the name of the other for commercial, advertising, or + promotional purposes without specific prior written permission. + + We suggest, but do not require, that you use the following phrase + to refer to this software in your documentation: 'this software is + based in part on the Catharon Typography Project'. + + As you have not signed this license, you are not required to + accept it. However, as the Catharon Packages are copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the Catharon + Packages, you indicate that you understand and accept all the + terms of this license. + +--- end of license.txt --- + + +License for FreeType font driver for PCF fonts +******* + +Copyright (C) 2000 by Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- freetype-2.1.10.orig/debian/changelog +++ freetype-2.1.10/debian/changelog @@ -0,0 +1,1098 @@ +freetype (2.1.10-1ubuntu2.4) dapper-security; urgency=low + + * SECURITY UPDATE: arbitrary code execution via integer overflows. + * Add debian/patches/freetype-2.1.10-security-ttgload-fix.patch from + upstream changes. + * References + CVE-2007-2754 + + -- Kees Cook Tue, 22 May 2007 15:38:49 -0700 + +freetype (2.1.10-1ubuntu2.3) dapper-security; urgency=low + + * SECURITY UPDATE: arbitrary code execution via integer overflows. + * Add debian/patches/404-bdf-integer.patch from upstream changes. + * References + CVE-2007-1351 + + -- Kees Cook Mon, 2 Apr 2007 15:52:43 -0700 + +freetype (2.1.10-1ubuntu2.2) dapper-security; urgency=low + + * SECURITY UPDATE: Arbitrary code execution and DoS with crafted font files. + * Add debian/patches/403-pcf-strlen.patch: + - src/pcf/pcfread.c: Detect invalid string lengths. + - CVE-2006-3467 + + -- Martin Pitt Wed, 26 Jul 2006 10:43:52 +0000 + +freetype (2.1.10-1ubuntu2.1) dapper-security; urgency=low + + * SECURITY UPDATE: Arbitrary code execution and DoS with crafted font files. + * Add debian/patches/400-ttkern-loop-variable.patch: + - src/sfnt/ttkern.c, tt_face_get_kerning(): Fix inner loop to use a new + variable instead of destroying the outer loop variable. + - Fixes infinite loop with fonts that don't have a properly sorted kerning + sub-table. + - Patch taken from upstream CVS. + * Add debian/patches/401-odd_blue_num-safe_alloc.patch: + - src/pshinter/pshglob.c: Prevent integer underflow with malformed fonts + which have an odd number of blue values (these are broken according to + the specs). [CVE-2006-0747] + - src/base/ftutil.c: Fail with an 'invalid argument' error on negative + allocations, just to make double sure. [CVE-2006-2661] + - Patches taken from upstream CVS. + * Add debian/patches/402-int-overflows.patch: + - Various int overflow protections. [CVE-2006-1861, CVE-2006-2493] + - Patches taken from upstream CVS. + * Many thanks to Josh Bressers for extracting the patches! + + -- Martin Pitt Tue, 30 May 2006 17:38:12 +0200 + +freetype (2.1.10-1ubuntu2) dapper; urgency=low + + * Update shlibs dependency. Ubuntu: #5901. + + -- Scott James Remnant Thu, 6 Apr 2006 05:58:24 +0100 + +freetype (2.1.10-1ubuntu1) dapper; urgency=low + + * Patches for Malone #5560. + [debian/patches/freetype-2.1.10-cvsfixes.patch]: + - various fixes (mostly embolding) + [debian/patches/freetype-2.1.10-xorgfix.patch]: + - put back internal API used by xorg-x11 + [debian/patches/freetype-2.1.10-fixautofit.patch]: + - fix autofit render setup + [debian/patches/freetype-2.1.10-memleak.patch]: + - fix memleak + [debian/patches/freetype-2.1.10-fixkerning.patch]: + - fix disabled kerning + [debian/patches/freetype-2.1.10-fixaliasing.patch]: + - fix anti-aliasing rendering + * Changes by Jun Kobayashi + + -- Jonathan Riddell Mon, 16 Jan 2006 17:45:50 +0900 + +freetype (2.1.10-1) unstable; urgency=low + + * New upstream (Closes: #298660, #245532). + * New maintainer, co-maintainer required! + * Disable CJK autohinting patch due to incompatability with this version + of freetype. + * Remove some very old unapplied patches. + * Add freetype-config.1 manpage. + * Add doc-base file for development docs. (Closes: #280827) + * Fix build with non-default umask. (Closes: #307464, #166511) + * Patch merged upstream. (Closes: #252673) + * Acknowledge NMUS. + (Closes: #221597, #225119, #226380, #249443, #251473, #302269, #259875) + + -- Will Newton Mon, 13 Jun 2005 00:44:29 +0100 + +freetype (2.1.9-1) unstable; urgency=low + + * New upstream. + + -- Will Newton Sat, 28 May 2005 14:49:00 +0100 + +freetype (2.1.7-2.4) unstable; urgency=high + + * Non-maintainer upload. + * freetype-2.1.7/src/bdf/bdflib.c: When a glyph has zero width or height, + a bitmap is not actually allocated for it, but the code used to try to + use it anyway. Now it no longer does that. Fix by Steve Langasek, + based on something I did earlier. Added + debian/patches/300-bdflib-zero-width-glyphs.diff. Closes: #302269 + (Segmentation fault with certain bdf fonts). + * freetype-2.1.7/src/bdf/bdflib.c: BDF font files with glyphs with an + encoding value of at least 65536 would overflow the bitmap with + 65536 bits which bdflib.c uses to keep track of whether it has seen + an encoding already. Changed things so that encodings above the + limit cause an error code to be returned instead of a segfault + happening. Ideally, the bitmap should be replaced with a more + compact representation, but that is too big a change for something + this small. I will, however, only lower the severity of the bug + (305413) to normal, instead of marking it fixed. Added + debian/patches/300-bdflib-large-encodings.diff. + + -- Lars Wirzenius Sun, 24 Apr 2005 15:42:00 +0300 + +freetype (2.1.7-2.3) unstable; urgency=low + + * NMU + * debian/patches/090-freetype-2.1.7-normalize-fix.diff: Patch + by David Mossberger. Backport from freetype2 CVS that fixes an + off-by-order-of-magnitude performance issue in the normalization code. + (Closes: #259875) + + -- dann frazier Mon, 08 Nov 2004 19:06:57 -0700 + +freetype (2.1.7-2.2) unstable; urgency=low + + * NMU + * debian/patches/080-freetype-2.1.7-backwards-compat.diff: Patch + by Shaun Jackman, integration by Thom May. Fixes backwards + compatibility (Closes: #251473) + + -- Frank Lichtenheld Fri, 6 Aug 2004 01:03:36 +0200 + +freetype (2.1.7-2.1) unstable; urgency=medium + + * NMU + * [debian/patches/patches/t1load-eexec.diff, debian/rules] Patch from + upstream CVS + (http://cvs.freetype.org/cgi-bin/viewcvs.cgi/freetype2/src/type1/t1load.c.diff?r1=text&tr2=1.89&tr1=1.88&r2=text&diff_format=u) + to fix hanging gpdf processes. (Closes: #249443, #233255) + + -- J.H.M. Dassen (Ray) Fri, 4 Jun 2004 18:56:41 +0200 + +freetype (2.1.7-2) unstable; urgency=low + + * Acknowledging 2.1.7-1.1. Many thanks to David Mosberger-Tang and + fellow Debian developer J.H.M. Dassen (Ray) for fixing the + gnumeric and abiword crashing problem on powerpc and ia64 + by compiling with -fno-strict-aliasing. Will report upstream. + * Applied Akito Hirai's freetype-2.1.7-autohint-cjkfonts-20031130.patch. + Thanks to Firefly's detailed testing and development, and to Shuke + (Fan Xiaoju) and Tetralet for building unofficial debs. :-) + - http://firefly.idv.tw/test/Forum.php?Board=1&Article=72498077a4859413781ed6885760caa7&Func=view&History=0 + - http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=51830 + * Converted changelog.Debian.gz to UTF-8. + * Removed /usr/share/doc/libfreetype6/reference/.cvsignore. + + -- Anthony Fok Sat, 24 Jan 2004 08:00:31 +0800 + +freetype (2.1.7-1.1) unstable; urgency=high + + * NMU + * [debian/control] Applied patch by David Mosberger-Tang + to compile -fno-strict-aliasing. Freetype + is apparently known to be unsafe for strict-aliasing rules defined + by ANSI (and the compiler configuration files in the upstream + source package itself reflect that), which caused crashes on ia64 + and powerpc. This patch has been confirmed to fix the gnumeric and + abiword crashes on powerpc. (Closes: #221597, #225119, #226380). + + -- J.H.M. Dassen (Ray) Tue, 6 Jan 2004 11:35:55 +0100 + +freetype (2.1.7-1) unstable; urgency=low + + * New upstream version. + + -- Anthony Fok Sat, 15 Nov 2003 00:49:55 +0800 + +freetype (2.1.5-3) unstable; urgency=high + + * debian/patches/freetype-2.1.5-type1-crash.diff: prevents + crashes when opening Type1 fonts with PaintType != 0 or + StrokeWidth != 0, exhibited with e.g. Hershey fonts in gsfonts-other. + Many thanks to Josselin Mouette (Debian fontconfig maintainer) for + analysis and patch! (Closes: Bug#216605, #216649, #216761) + * FTC_SBit_Cache_Lookup() exhibits a bug in ah_hinter_load_glyph + where FT_Render_Glyph may be called twice under some circumstances. + Many thanks to Ralf for reporting and upstream author Werner Lemberg + for fixing the bug. (Closes: Bug#213232, #208943, #209715) + * Added Conflicts: xpdf-reader (<< 1.00-4) to avoid problems with users + upgrading from Debian 3.0. Thanks to Adrian Bunk for the bug report. + (Partially fixes Bug#214732) + + -- Anthony Fok Wed, 22 Oct 2003 10:58:14 +0800 + +freetype (2.1.5-2) unstable; urgency=low + + * Added patch by David Bevan ([devel] 2003-09-19) to fix read_pfb_tag() + so it does not fail on end-of-file indicated (0x8003). + * Do not install the irrelevant docs/reference/README. (Closes: Bug#211755) + + -- Anthony Fok Sun, 21 Sep 2003 01:35:44 +0800 + +freetype (2.1.5-1) unstable; urgency=low + + * New upstream official 2.1.5 release. (ftdocs is still 2.1.4.) + * Set libfreetype6-udeb to Priority: extra to fix override disparity. + + -- Anthony Fok Tue, 16 Sep 2003 23:43:48 +0800 + +freetype (2.1.4-5) unstable; urgency=low + + * CVS updates as of 2003-08-18. Upstream has restored binary + compatibility with the FreeType 2.1.4 and previous releases. + * Applied patch by Mike Fabian (2003-08-27): check bdf properties + WEIGHT_NAME and SLANT case insensitively. Many thanks! :-) + * Reversed YAMANO-UCHI Hidetoshi's 2003-06-13 change to ft2demos + graph/x11/rules.mk; Debian shys away from setting rpath. + + -- Anthony Fok Thu, 28 Aug 2003 02:10:29 +0800 + +freetype (2.1.4-4) unstable; urgency=low + + * CVS updates as of 2003-06-07 with many fixes, including: + - Werner Lemberg has fixed the problem FreeType 2 had with + HuaTian multiple-level subglyphs fonts like htst3.ttf. + Many thanks! :-) + * TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING is left undefined for now. + (MS web core fonts like MonoType Arial would become distorted.) + * Disable Firefly's GRAYS_USE_GAMMA patch for now: I have received + several bug reports about "ugly fonts" or jaggies already, and I am + not sure whether it is due to the adjusted gamma values or + the new unpatented hinting in CVS. Let's see what happens. :-) + (Closes: Bug#196029, #196048, #196086) + * Yikes, Werner's number to pointer changes broke binary compatibility + with XFree86 4.3.0. I hope the patch + 100-freetype-2.1.4-CVS-int-fixed_p-incompatibility.diff + correctly reverts the problem. My apologies to the Debian XFree86 + for my oversight. + * FreeType 2.1.4 was unable to read some gzip'ed fonts Many thanks to + "Alexis S. L. Carvalho" for diagnosing and + correcting the problem. (Closes: Bug#184355) + * Note to self: Debian's file/libmagic1 (4.02-4) misdetects + libfreetype.so.6.3.3 as "Linux/i386 core" file on i386 platforms. + + -- Anthony Fok Sun, 8 Jun 2003 13:42:26 +0800 + +freetype (2.1.4-3) unstable; urgency=low + + * CVS updates as of 2003-06-01: + - Removed my 010-ft2demos-2.1.4-ucs4.diff and + Akito's 011-freetype-2.1.4-ttcmap4.diff: already applied upstream. + * [ftoption.h] Enabled Graham Asher's unpatented hinting: + #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + #define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING + Many thanks to Graham Asher and Artifex for their contribution! + * Temporary disable Akito Hirai's CJK autohinting enhancement: it + currently does not apply cleanly to FreeType CVS. + * [libfreetype6-dev.files]: Added usr/lib/pkgconfig/ for freetype2.pc. + * Added Firefly's patch to #define GRAYS_USE_GAMMA with finetune. + + -- Anthony Fok Tue, 3 Jun 2003 02:54:40 +0800 + +freetype (2.1.4-2) unstable; urgency=low + + * Applied CVS fixes as of 2003-04-09. + * Applied freetype-2.1.3-ttcmap4.patch by Akito Hirai to handle buggy + Unicode CMap (cmap4) in CJK Dyna fonts. + * Applied Akito Hirai's autohinting enhancement for CJK fonts (2003-04-16). + + -- Anthony Fok Mon, 21 Apr 2003 01:48:07 +0800 + +freetype (2.1.4-1) unstable; urgency=low + + * New upstream release. + * The Section for libfreetype6-dev has been changed from devel to libdevel. + + -- Anthony Fok Tue, 8 Apr 2003 23:28:21 +0800 + +freetype (2.1.3+2.1.4rc2-5) unstable; urgency=low + + * FreeType 2.1.4 release candidate as of 2003-03-27. + * The rounding code in FT_Set_Char_Size() has been changed slightly + from 2.1.3+2.1.4rc2-4. Please test to see if native TrueType hinting + (with bytecode interpreter) still looks good. Thanks! + * Fine-tuned font->num_indices in ft2demos/src/ftcommon.i by encoding. + + -- Anthony Fok Mon, 31 Mar 2003 03:47:29 +0800 + +freetype (2.1.3+2.1.4rc2-4) unstable; urgency=low + + * FreeType 2.1.4rc2 with CVS update as of 2003-03-20. + * More rounding fixes from Artur Zaprzala. + * Reverted FT_Set_Char_Size() to forced rounding as before. This is + a temporary measure to get bytecode-interpreter hinted fonts display + properly. + + -- Anthony Fok Tue, 25 Mar 2003 01:34:15 +0800 + +freetype (2.1.3+2.1.4rc2-3) unstable; urgency=medium + + * The "Welcome to the world, Lucie Turner!" release. :-) + * FreeType 2.1.4rc2 with CVS update as of 2003-03-15. + * Upstream author David Turner has fixed src/truetype/ttdriver.c + (Set_Char_Sizes) rounding issues. The fonts on the screen should + look good as before now. (Closes: Bug#181938, #183794, #182674) + + -- Anthony Fok Sun, 16 Mar 2003 00:05:22 +0800 + +freetype (2.1.3+2.1.4rc2-2) unstable; urgency=medium + + * Reversed upstream author's 2003-02-25 patch on ttdriver.c: + - src/truetype/ttdriver.c (Set_Char_Sizes): fixed a rounding bug when + computing the scale factors for a given character size in points with + resolution. + + Not sure what how undoing this would affect autohinting, but at least + rendering with bytecode interpreter is back to normal. :-) + (Follow-up: Bug#181938, #183794, #182674, etc.) + + * Tests with David Chester's suggested patches, e.g. symmetric "m". + + * Added a fix for double free in the embedded bitmap code in freetype. + The bug was crashing OpenOffice.org. Thanks to Mandrake's Gwenole + Beauchesne for his suggested fix! (Follow-up: Bug#183272) + + -- Anthony Fok Thu, 13 Mar 2003 00:51:09 +0800 + +freetype (2.1.3+2.1.4rc2-1) unstable; urgency=low + + * FreeType 2.1.4rc2 with CVS update as of 2003-02-28: + - ft_gzip_file_done memory leak fix. (May fix #175889, #176138) + - scaling round-off error fix. May fix #182674, #181938. + - infinite loop fix in ftgzip.c. (Closes: Bug#177439) + * libfreetype6.postinst: Remove /usr/X11R6/lib/libfreetype.so* leftover + by some old version of XFree86 package. + * Added libfreetype6-udeb for the GTK frontend of the debian-installer. + Many thanks to Sebastian Ley for providing the appropriate patch! + (Closes: Bug#182208) + * freetype2-demos now depends on the exact version of libfreetype6. + (Closes: Bug#151233) + + -- Anthony Fok Wed, 5 Mar 2003 02:21:46 +0800 + +freetype (2.1.3-10) unstable; urgency=low + + * FreeType 2.1.4rc1 with CVS update as of 2003-02-18. (Closes: Bug#179450) + * Made 008-freetype-2.1.4rc1-ftccmap-ucs4.patch: + ftc_cmap_family_init() now, like find_unicode_charmap() in ftobjs.c, + favours UCS-4 charmap if there is one. + * Made 009-freetype-2.1.4rc1-typo.patch: + Minor typographical fixes, e.g. asian -> Asian. + * Made 010-ft2demos-2.1.4rc1-ucs4.patch: + Let ft2demos handle up to U+10FFFF. + + -- Anthony Fok Fri, 21 Feb 2003 02:59:12 +0800 + +freetype (2.1.3-9) unstable; urgency=low + + * Backed out David Turner's modified bluescale implementation (2.1.3-8) + and put back David Chester's original patch (2.1.3-7) until rendering + with bytecode interpreter turned on is improved. (See Bug#179450) + + -- Anthony Fok Mon, 3 Feb 2003 03:44:56 +0800 + +freetype (2.1.3-8) unstable; urgency=low + + * CVS update as of 2003-01-31. David Chester's bluescale patch is now + implemented upstream. Also, the excessive debug messages in 2.1.3-7 + should be gone now. + + -- Anthony Fok Sat, 1 Feb 2003 16:19:44 +0800 + +freetype (2.1.3-7) unstable; urgency=low + + * CVS update as of 2003-01-22. + * Added David Chester's latest bluescale2 patch. (2003-01-23 on the + FreeType devel mailing list.) + + -- Anthony Fok Sat, 25 Jan 2003 02:16:52 +0800 + +freetype (2.1.3-6) unstable; urgency=low + + * Oops, forgot to run aclocal as "aclocal -I ." to search for + ft-munmap.m4. Thanks to Werner Lemberg for the note. + + -- Anthony Fok Sat, 18 Jan 2003 22:45:19 +0800 + +freetype (2.1.3-5) unstable; urgency=low + + * CVS update as of 2003-01-17. + * Added a patch to relax table.Length checking because some buggy software + pads it to a multiple of 4 bytes. + (007-freetype-2.1.3-ttload-table-length.patch) + * Updated to latest libtool and regenerate configure so it builds properly + on mips/mipsel. Thanks to Ryan Murray for reporting the issue. + Also forwarded upstream. (Closes: Bug#176044) + + -- Anthony Fok Fri, 17 Jan 2003 07:52:25 +0800 + +freetype (2.1.3-4) unstable; urgency=high + + * Oops, forgot to add the corresponding Depends: zlib1g-dev | libz-dev + to libfreetype6-dev. Fixed. Thanks to Colin Walters for the reminder! + (Closes: Bug#174019) + + -- Anthony Fok Mon, 23 Dec 2002 12:51:41 +0800 + +freetype (2.1.3-3) unstable; urgency=high + + * With the previous CVS update, configure.ac was revised, but autoconf + was not run, leading to an unsubstituted @LIBZ@ in freetype-config. + My apologies for the problems it caused. (Closes: Bug#173834) + * Patched configure.ac and unix-cc.in to set LDFLAGS=-lz and to ensure + that libfreetype.so.* is explicitly linked with zlib. + * Added Build-Dependency: libz-dev, autoconf. (Note to self: remove + autoconf later.) + + -- Anthony Fok Sun, 22 Dec 2002 06:03:03 +0800 + +freetype (2.1.3-2) unstable; urgency=low + + * CVS updates as of 2002-12-18. + + -- Anthony Fok Sat, 21 Dec 2002 01:28:23 +0800 + +freetype (2.1.3-1) unstable; urgency=low + + * New upstream release. + * Revised my freetype-2.1.3-ttgload-monospace-halfwidth.patch to use + 52% as the threshold. + * New version supports gzipped PCF fonts. (Closes: Bug#163207) + + -- Anthony Fok Mon, 9 Dec 2002 01:36:21 +0800 + +freetype (2.1.2-10) unstable; urgency=low + + * Turning back on the bytecode interpreter. Too tired to care now. + May turn it off again when Xft2 and fontconfig are in Debian. + * Removed libkpathsea-dev build-dependency. It was used for the the + FreeType 1 contributed tools, but those tools were not yet ported + to FreeType 2. Also removed the 'debian/\' file. Thanks to + P. Doblerman for the bug report. (Closes: Bug#166064) + + -- Anthony Fok Thu, 24 Oct 2002 10:17:18 +0800 + +freetype (2.1.2-9) unstable; urgency=medium + + * By popular demand, disabled the ft-slight patch. Let's see what happens. + (Closes: Bug#164477) + + -- Anthony Fok Thu, 17 Oct 2002 23:37:36 +0800 + +freetype (2.1.2-8) unstable; urgency=low + + * CVS updates as of 2002-10-07 + * Applied David Chester's ft-slight patch. Thanks to Roger So for the + suggestion. (Closes: Bug#163900) + * Turned off the bytecode interpreter. + + -- Anthony Fok Fri, 11 Oct 2002 02:00:18 +0800 + +freetype (2.1.2-7) unstable; urgency=medium + + * CVS updates as of 2002-09-25 + * Revised ftbench.c to count by num_charcodes (cmap entries) instead of + face->num_glyphs. + * Oops, I forgot to uncomment dh_strip after a debug session! + Thanks to Daniel Burrows for catching this! (Closes: Bug#162346) + + -- Anthony Fok Thu, 26 Sep 2002 15:46:31 +0800 + +freetype (2.1.2-6) unstable; urgency=medium + + * CVS updates as of 2002-09-21 (after VER-2-1-3-RC2) + * Backported patches that I made for Thiz Linux, as listed below. + * Do not force horizontal.advance_Width_Max even when + postscript.isFixedPitch is true so that the ASCII characters in some + CJK fonts are displayed correctly. + * Revised my CMap4 patch to take care of tt_cmap4_char_index() and + tt_cmap4_char_next() too. (Closes: Bug#161933) + * ftbench allocates face->num_glyphs, but number of codepoints read + from CMap4 may be more, causing it to segfault with opens___.ttf. + Fixed. + + -- Anthony Fok Wed, 25 Sep 2002 09:45:14 +0800 + +freetype (2.1.2-5) unstable; urgency=high + + * CVS updates as of 2002-09-05 + * Fixed some typos in ftimage.h introduced in VER-2-1-3-RC1, + e.g. s/zft_outline_reverse_fill/ft_outline_reverse_fill/ + so that gnome-print may be built properly. Thanks to + Rick Younie, Christian Marillat and Kalle Olavi Niemitalo + for the bug report. (Closes: Bug#159806) + + -- Anthony Fok Sun, 8 Sep 2002 23:18:29 +0800 + +freetype (2.1.2-4) unstable; urgency=high + + * s/FT_ENCODING_SYMBOL/FT_ENCODING_MS_SYMBOL/ (typo) in freetype.h . + Thanks to Branden Robinson for tracking down the error. + (Closes: Bug#159375) + + -- Anthony Fok Tue, 3 Sep 2002 11:35:42 +0800 + +freetype (2.1.2-3) unstable; urgency=low + + * CVS updates as of 2002-08-29 (around VER-2-1-3-RC1) + * Make FreeType less strict when some slightly buggy fonts set + the CMap format 4 last segment idRangeOffset to 0xFFFF. + Thanks to Werner Lemberg and George Williams for pinpointing the bug. + (Fixes: Bug#150678, #155864) + + -- Anthony Fok Mon, 2 Sep 2002 05:53:48 +0800 + +freetype (2.1.2-2) unstable; urgency=low + + * Added CVS updates as of 2002-08-06. + * Werner Lemberg (one of the upstream authors) has fixed TTC reading + problem. Thanks to Kenshi Muto and Ishikawa Mutsumi for the report. + (Closes: Bug#154221) + * An extraneous /usr/X11R6/lib/libfreetype.so (not from this package) + was the culprit to some of the mysterious segmentation faults + that some users were experiencing. Thanks to Akira TAGOH for tracking + down the problem. (Closes: Bug#142674, #149472, #149759, #150596) + + -- Anthony Fok Fri, 9 Aug 2002 02:22:00 +0800 + +freetype (2.1.2-1) unstable; urgency=low + + * New upstream release with CVS updates as of 2002-07-11. + + -- Anthony Fok Mon, 15 Jul 2002 02:24:09 +0800 + +freetype (2.1.1-3) unstable; urgency=medium + + * Sync'ed with CVS as of 2002-06-16. + * "New version breaks Pango" was fixed by the newly recompiled + Pango package. (Thanks, Akira TAGOH! :-) (Closes: Bug#150039) + * Applied patches from Detlef Würkner (003-freetype-type1-cmap.patch, + 004-freetype-select-charmap.patch): the latter one fixes + the icon-text-disappears-in-Nautilus problem. Many thanks! + (Closes: Bug#150084) + * Applied patch from Sven Neumann (005-freetype-pfr-direction.patch). + Many thanks! + + -- Anthony Fok Wed, 19 Jun 2002 01:37:48 +0800 + +freetype (2.1.1-2) unstable; urgency=low + + * Up'ed versioned dependency to libfreetype6 (>= 2.1.1) because 2.1.1 + introduced some changes that is binary incompatible (but source + compatible) with previous versions, and Pango needs to be recompiled. + * Added fixes from CVS as of 2002-06-14. + * TOP became TOP_DIR + + -- Anthony Fok Sun, 16 Jun 2002 13:28:33 +0800 + +freetype (2.1.1-1) unstable; urgency=medium + + * New upstream release. + * Added versioned dependency to libfreetype6 (>= 2.1.0). Thanks to + Akira TAGOH for the suggestion. (Closes: Bug#140772, Bug#140821) + + -- Anthony Fok Fri, 14 Jun 2002 00:51:01 +0800 + +freetype (2.0.9-1) unstable; urgency=high + + * New upstream release. Among other enhancements, it contains this + important fix: + + - Certain fonts, like "foxjump.ttf" contain broken name tables with + invalid entries and wild offsets. This caused FreeType to crash when + trying to load them. + + Kudos to upstream author David Turner for fixing the bug so quickly! + + This bug causes gnome-print to crash for users with certain freeware + or shareware fonts, so please put in woody. Thanks! + (Closes: Bug#135654, Bug#135896) + + -- Anthony Fok Tue, 12 Mar 2002 01:43:14 +0800 + +freetype (2.0.8-1) unstable; urgency=medium + + * New upstream version. Contains a few more important bug fixes. + Please put in woody. Thanks! + * libfreetype6-dev now Depends on libc6-dev | libc-dev + (Closes: Bug#132640) + * Uses new configure script so that it builds on the netbsd-i386 + Debian port too. (Closes: Bug#132693) + + -- Anthony Fok Wed, 13 Feb 2002 03:35:52 +0800 + +freetype (2.0.7-1) unstable; urgency=medium + + * New upstream version. Reportedly fixes a problem that may KDE to + crash upon reading certain fonts. (Yes, please put in Debian 3.0). + * Applied upstream fix to freetype-config. + + -- Anthony Fok Tue, 5 Feb 2002 03:44:27 +0800 + +freetype (2.0.6-1) unstable; urgency=low + + * New upstream release with important bug fixes. + * Removed two Debian small patches as they have been applied upstream. + + -- Anthony Fok Mon, 14 Jan 2002 01:25:06 +0800 + +freetype (2.0.5-2) unstable; urgency=low + + * Oops, README and .cvsignore were erroneously placed in /usr/bin in + freetype2-demos. Thanks to YAMASHITA Junji for the bug report. + (Closes: Bug#119119) + + -- Anthony Fok Sun, 11 Nov 2001 23:55:40 +0800 + +freetype (2.0.5-1) unstable; urgency=low + + * New upstream release. + * Updated libfreetype6.copyright. + * Applied patch to builds/unix/freetype-config.in to prevent + /usr/bin/freetype-config from providing gcc with -L/usr/lib. + Thanks to Gordon Sadler for providing the patch. (Closes: Bug#101391) + * Added /usr/share/aclocal/freetype2.m4 for autoconf and friends. + in libfreetype6-dev. Thanks to Marcelo E. Magallon for contributing + this file. (Closes: Bug#117156) + + -- Anthony Fok Sat, 10 Nov 2001 13:10:25 +0800 + +freetype (2.0.2.20010514-1) unstable; urgency=low + + * New upstream snapshot, post-2.0.2 freetype2-current as of 2001-05-14. + * Silly me! I fixed the `missing "xlibs-dev" in Build-Depends' + in 2.0.2.20010422-2, but closed the wrong bug report!? + Thanks to Martin Schmitz for the bug report. (Closes: Bug#95328) + * libtool-1.4 is not 100% compatible with the libtool-1.3.5 included + in the upstream source. Also, it seems to be unnecessary to + Build-Depends on libtool, therefore removed. + Thanks to Laurent Bonnaud for the bug report. (Closes: Bug#97552) + * [ftoption.h]: #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + -- Anthony Fok Tue, 15 May 2001 16:49:26 -0600 + +freetype (2.0.2.20010422-2) unstable; urgency=medium + + * Hehe, silly me, I forgot to add "xlibs-dev" to Build-Depends + when I merged in freetype2-demos. Thanks to Martin Michlmayr + for the notice. Closes: Bug#94569. + + -- Anthony Fok Thu, 26 Apr 2001 21:20:17 -0600 + +freetype (2.0.2.20010422-1) unstable; urgency=low + + * Updated to post-2.0.2 freetype2-current as of 2001-04-22. + * On i386, freetype2-demos is rebuilt with xlibs_4.0.2-13 instead of the + pre-release xlibs_4.0.3. My apologies. + * Replaced "tetex-dev" with "libkpathsea-dev" in Build-Depends. + Thanks to Michael Schmitz for the bug report. Closes: Bug#91897. + * Updated README.Debian to reflect the FreeType 1.x package name + change from freetype2{,-dev} [sic] to libttf{2,-dev}. + + -- Anthony Fok Mon, 23 Apr 2001 23:08:51 -0600 + +freetype (2.0.2.20010412-1) unstable; urgency=low + + * New upstream release, post-2.0.2 freetype2-current as of 2001-04-12. + * Arnd Bergmann, Tom Kacvinsky et al. pinpointed and fixed a bug + in FreeType-2.0.2 which caused KDE and "xterm -fa" to segfault. + Thanks guys! :-) Closes: Bug#89326. + * New binary package: freetype2-demos. + * The source package reorganized to include three upstream tarballs + (freetype, ftdocs, ft2demos) in one *.orig.tar.gz. + + -- Anthony Fok Fri, 13 Apr 2001 02:02:42 -0600 + +freetype (2.0.1.20010317-1) unstable; urgency=low + + * Updated to freetype2-current as of 2001-03-17. + * [builds/unix/install.mk]: + - IMHO, the current upstream source caters too much to broken + compilers that the Unix build suffers somewhat. + - Use sed to replace all instances of + + with FT2_{PUBLIC,CONFIG,INTERNAL}_FILE(*.h), which currently + expands to + in freetype/config/ftheader.h and freetype/internal/internal.h. + - This fix, without sacrificing compatibility on some brain-dead + compilers on other platforms, may mean that + "-I/usr/include/freetype2" is no longer needed on Unix/Linux/Hurd + platforms. + - But it would be very foolish to remove "-I/usr/include/freetype2". + Thou shalt always use $(shell freetype-config --cflags). + - Thanks to Gordon Sadler for the suggestion. :-) + Closes: Bug#79951. + * [builds/unix/ft2unix.h]: + - Removed the FT2_{PUBLIC,CONFIG,INTERNAL}_FILE macros because + they are already defined in freetype/config/ftheader.h. + - Use FT2_ROOT instead. Afterall, cpp on Unix is not broken. ;-) + - Thanks to Takuo Kitame for reporting the conflicting #define's. + Closes: Bug#89363. + * [debian/rules]: Moved out some old cruft to rules.museum. + + -- Anthony Fok Mon, 19 Mar 2001 03:27:14 -0700 + +freetype (2.0.1.20010312-1) unstable; urgency=low + + * Updated to freetype2-current as of 2001-03-12. + * [debian/control]: + - Build-Depends: debhelper (>= 3.0.0), ... + - Standards-Version: 3.5.2 + + -- Anthony Fok Fri, 16 Mar 2001 02:21:31 -0700 + +freetype (2.0.1.20010308-1) unstable; urgency=low + + * Updated to freetype2-current as of 2001-03-08. + * Corrected platform detection on Hurd. Thanks to Jeff Bailey, + Werner and David for the fix. Closes: Bug#87691. + + -- Anthony Fok Fri, 9 Mar 2001 00:50:12 -0700 + +freetype (2.0.1-1) unstable; urgency=low + + * New upstream release. + + -- Anthony Fok Fri, 1 Dec 2000 17:58:32 -0700 + +freetype (2.0-1) unstable; urgency=low + + * New upstream FreeType 2 official release. + - Source package: freetype + - Binary packages: libfreetype6 and libfreetype6-dev. + The source package of FreeType 1.3.1 has been renamed to freetype1. + * [README.Debian]: Documents the source and binary package names, + and recommends users to migrate to FreeType 2. + + -- Anthony Fok Mon, 20 Nov 2000 05:16:13 -0700 + +freetype (1.3.1-1) unstable; urgency=low + + * New official upstream release. + * [contrib/ttf2pfb/ttf2pfb.c]: Applied patch by fellow Debian developer + Daniel Jacobowitz to fix a va_arg problem that prevents it from + building on powerpc. Thanks a million! :-) (closes: Bug#54539) + + -- Anthony Fok Mon, 10 Jan 2000 06:12:51 -0700 + +freetype (1.3.1-0) unstable; urgency=low + + * New upstream release candidate (1999-12-08). + * [debian/rules]: Uses "dh_makeshlibs -V 'freetype2 (>= 1.3.1)'" + because 1.3 have some new APIs not in 1.2. Thanks to suggestion + by ISHIKAWA Mutsumi (closes: Bug#52319). + * Added new entries for Arphic PL fonts in /etc/ttf2pk/ttfonts.map + * Modified UBig5.sfd to suit the Big5 Arphic PL fonts. + + -- Anthony Fok Sun, 12 Dec 1999 11:13:20 -0700 + +freetype (1.3-2) unstable; urgency=low + + * Corrected the symlink + /usr/share/doc/freetype2/changelog.gz -> docs/changes.txt + to -> docs/changes.txt.gz. (Hehe, major oversight. :-) + Thanks to Michael Osamu Shiobara for the bug report. + (closes: Bug#50428) + + -- Anthony Fok Wed, 17 Nov 1999 04:10:41 -0700 + +freetype (1.3-1) unstable; urgency=low + + * New upstream release (libttf.so.2.2.0) with patches as of 1999-10-21. + * Standards-Version: 3.1.0 + * Removed debian/freetype2-dev.compress because debhelper-2.0.69 + no longer compresses *.png. + * Backed out the patch applied by Anthony Wong to + contrib/ttf2pfb/configure in freetype_1.2-6.1 because upstream fixed + ttf2pfb.c to #include "extend/ftxpost.h" rather than "ftxpost.h". + Nonetheless, thanks for the NMU! :-) + * [debian/rules]: FHS-compliancy and general clean-up + - s/pre-binary/install/g; and removed install-stamp. + - s!usr/doc!usr/share/doc!g; + - Referred to the latest /usr/doc/debhelper/examples/rules* + and used DH_OPTIONS to reduce clutter. + - Oops! I used bashism but set "SHELL = /bin/sh". Changed to + "SHELL = /bin/bash". :-) + - Install upstream docs/changes.txt as changelog.gz in the + freetype2 (shared library) package. + + -- Anthony Fok Sun, 14 Nov 1999 01:15:21 -0700 + +freetype (1.2-6.1) unstable; urgency=low + + * Non-maintainer upload (see bug #38813) + * Added 'CPPFLAGS= ... -I$srcdir/../../lib/extend' to + contrib/ttf2pfb/configure, otherwise compile will fail for + ftxpost.h cannot be found. + * license.txt.gz is not shipped (lintian complains) + + -- Anthony Wong Thu, 3 Jun 1999 02:04:44 +0800 + +freetype (1.2-6) unstable; urgency=low + + * Copied debian/postinst to debian/freetype-tools.postinst + so mktexlsr is (only) run for the freetype-tools package. + Thanks to Andrew for reporting this bug. (closes: Bug#36502) + * Added some more font entries to /etc/ttf2pk/ttfonts.map. + + -- Anthony Fok Thu, 22 Apr 1999 17:54:53 -0600 + +freetype (1.2-5) unstable; urgency=low + + * Applied upstream freetype-1.2-current.diff.gz as of 1999-04-09. + * [contrib/ttf2pfb/t1asm.c]: Incorporated patch for glibc 2.1 + donated by Hartmut Koptein . + (Taken from the t1utils package. :-) (closes: Bug#35742) + * [contrib/ttf2pk/filesrch.c]: Changed "DllImport" to "KPSEDLL" + (changes between kpathsea 3.2 and 3.3). Thanks Werner! :-) + * [debian/rules]: + - Replaced the for loop with a more verbose alternative to ensure + make stops when it encounters an error when building one of the + contrib programs. + - Renamed t1asm to t1asm-freetype, and getafm to getafm-freetype, + until they are merged with the ones in t1utils and psutils. + * freetype-tools now also Suggests: psutils (>= 1.17-7) + + -- Anthony Fok Mon, 12 Apr 1999 01:08:23 -0600 + +freetype (1.2-4) unstable; urgency=low + + * Rebuilt with glibc-2.1 and tetex-lib (shared kpathsea library). + * [debian/rules]: Changed usr/share/texmf to usr/lib/texmf + for the new FHS-compliant directory layout in teTeX. + * [debian/control]: freetype-tools now Suggests: tetex-bin + (>= 0.9.990310-1), t1utils (>= 1.2-2) + + -- Anthony Fok Mon, 5 Apr 1999 16:39:08 -0600 + +freetype (1.2-3) frozen unstable; urgency=low + + * Applied the upstream freetype-1.2-current.diff.gz as of 1999-01-18 + which fixes a nasty Raster bug occurs only when clipping very large + outlines to a small target bitmap or pixmap. + + -- Anthony Fok Tue, 19 Jan 1999 22:04:32 -0700 + +freetype (1.2-2) frozen unstable; urgency=low + + * Applied the upstream freetype-1.2-current.diff.gz as of 1998-12-27 + Mostly bug fixes. + * Added configure.in and Makefile.in for contrib/{ttf2pfb,ttfbanner}, + so these tools are now included in the freetype-tools package. + * [debian/control]: + - Removed the "<" and ">", and added a suggestion + to Debian-JP's X server with X-TT support in freetype2's + package description. + - Now freetype-tools also Suggests: t1utils, which contains + /usr/bin/t1asm that helps ttf2pfb create real .pfa and .pfb + files. (Also added a note in README.Debian.) + * Updated the upstream authors' e-mail addresses in "control" and + "copyright." + * [debian/changelog]: Add the changelog of the freetype (1.1-0.1) + non-maintainer release done by Marcelo E. Magallon + in June 1998. I forgot to do so back + then. Sorry! :-) + * Renamed debian/compress to debian/freetype2-dev.compress, so *.png + are no longer compressed to *.png.gz. + + -- Anthony Fok Tue, 29 Dec 1998 02:16:07 -0700 + +freetype (1.2-1) frozen unstable; urgency=low + + * New upstream release. + * Recompiled with libc6 (2.0.7u-7). + * [debian/control]: Updated to standards version 2.5.0.0 (no changes). + * [contrib/ttf2pk/configure.in]: Modified the order of the header + include paths to ensure that "-I./../../lib" is placed before + "-I/usr/include". Thanks to Roman.Hodek@informatik.uni-erlangen.de + for the bug report (forwarded upstream). (Fixes: #27920) + + -- Anthony Fok Sat, 5 Dec 1998 15:13:48 -0700 + +freetype (1.1-1998-09-12-2) unstable; urgency=low + + * [debian/postinst]: Oops, the command "ldconfig" somehow disappeared + in the last upload. Fixed. :-) + + -- Anthony Fok Sun, 11 Oct 1998 19:58:32 -0600 + +freetype (1.1-1998-09-12-1) unstable; urgency=low + + * New upstream development snapshot. + * Added "--with-kpathsea-dir=/usr" to ttf2pk's configure. + * [debian/rules]: + - TTF2PKINPUTS = usr/lib/texmf/ttf2pk + - TTF2TFMINPUTS = usr/lib/texmf/ttf2tfm + - *.sfd are now installed in $(TTF2PKINPUTS) and $(TTF2TFMINPUTS). + - $(TTF2PKINPUTS)/ttfonts.map is a symlink to /etc/ttf2pk/ttfonts.map. + * [debian/freetype-tools.conffiles]: Added /etc/ttf2pk/ttfonts.map. + * [debian/postinst]: Added #DEBHELPER#. + * [debian/freetype-tools.postinst]: Runs /usr/bin/mktexlsr if it exists. + * [debian/control]: freetype-tools now Suggests: tetex-bin (>= 0.9-1). + + -- Anthony Fok Sat, 12 Sep 1998 19:55:17 -0600 + +freetype (1.1-1998-08-29-1) unstable; urgency=low + + * New upstream development snapshot. + * Now installs ttf2bdf and ttf2pk's documentation. + ttf2pk/ttf2tfm's *.sfd files are now placed in /usr/lib/ttf2tfm. + * changelog.gz now points to the re-added commitlog.gz. + * Changed "numGlymphId" to "cmap4->numGlyphId" in lib/extend/ftxcmap.c. + + -- Anthony Fok Mon, 31 Aug 1998 04:37:57 -0600 + +freetype (1.1-1) unstable; urgency=low + + * New upstream release. The old freetype-1.0 source package has been + renamed to "freetype1" and is now obsolete. + * Upgraded to standards version 2.4.1.0 (no changes). + * The package soname has been upgraded from 1 to 2. (libttf.2) + * Updated the package descriptions according to freetype.spec. + * Since teTeX 0.9 and the new is in Debian, + ttf2pk is now compiled and included in freetype-tools. + * Added postinst to run ldconfig as per Debian Policy. (Lintian) + * [debian/control]: Added some package relationships w.r.t. freetype1: + - freetype2 -- Replaces: freetype1 + - freetype2-dev -- Conflicts: freetype1-dev + * [debian/rules]: + - /usr/lib/libttf.la is now installed in the freetype2-dev package. + - Moved the developer's documentation into the freetype2-dev package. + Thanks to "Marcelo E. Magallon" for suggestion. + - Added "--dpkg-shlibdeps-params=-Ldebian/tmp/DEBIAN/shlibs" to + dh_shlibdeps when packaging freetype-tools. + - Added patch from /usr/doc/lintian/libtool-workarounds.txt + to solve the -rpath problem. Debian's libtool-1.2 handles the -lc + problem quite nicely already, so that part of the patch is not used. + - Added a GNU GPL copyright statement at the top. :-) + * Ran libtoolize from the Debian libtool-1.2 package. This solves the + -lc problem. :-) config.guess and config.sub are taken from the ones + in /usr/share/automake/ though because they are newer. (Thanks to + the libtool bug report filed by Jim Pick for hints.) + * Removed debian/README.Debian. + + -- Anthony Fok Fri, 28 Aug 1998 03:49:21 -0600 + +freetype (1.1-0.1) unstable; urgency=low + + * New upstream version. Non-maintainer upload (I need this in order to + build new upstream version of gltt!) + * Applied patches from previous version. + * Applied libtool rpath fix patch and removed rpath from compilation + parameters. Changed ltconfig to provide inter-library dependencies. + * Upgraded to Standards 2.4.1 + * Changed package name to freetype2 and other control fields accordingly + (this could be a problem... what about packages that depend on + freetype1?) + * Added "Conflitcs: freetype1 (<= 1.0.0.1998-03-22-1)" to freetype-tools + because of the mo files freetype1 contains and that are now in + freetype-tools, alogn-side the programs that use the files. + + -- Marcelo E. Magallon Sat, 27 Jun 1998 15:59:36 -0600 + +freetype (1.0.0.1998-03-22-1) frozen unstable; urgency=low + + * New upstream snapshot bugfix release as of 1998-03-22. + - ttobjs.c: The storage area is now freed in Instance_Destroy, + because it's the place it should have been from the very start. + A very sick bug spotted by Ram. Thanks again !! - DavidT + - fixed a nasty allocation bug in ttf2tfm.c + - corrected a spelling error (strcpy->strcmp) in ttf2pk.c + - new email address for Werner Lemberg (wl@gnu.org) + - (again) a stupid error fixed in ttf2pk.c + - Some fixes to make the package compile smoothless with the make + program of Solaris. + - too much fixed in po/Makefile.in.in :-) + * /usr/doc/freetype/README.gz and /usr/lib/libttf.la are now installed. + + -- Anthony Fok Wed, 25 Mar 1998 16:18:50 -0700 + +freetype (1.0.0.1998-03-13-1) unstable; urgency=low + + * New upstream snapshot including upstream patch as of 1998-03-13. + + -- Anthony Fok Sun, 15 Mar 1998 15:04:10 -0700 + +freetype (1.0-1) unstable; urgency=low + + * New upstream release (including upstream patch as of 1998-02-17). + * Updated copyright and README.Debian. + * Upgraded to standards version 2.4.0.0 (no changes). + * Enabled gettext support. + * Added .PHONY targets in Makefile.in's. + * Added -lc for linking libttf.so* (Reported by Lintian). + * Various FreeType test programs now have man pages linked to + /usr/man/man7/undocumented.7.gz (Reported by Lintian). + * debian/control: Revised package description. + * debian/rules: Commented out dh_du. + * Moved /usr/include/freetype/freetype.h to /usr/include/freetype.h. + + -- Anthony Fok Wed, 18 Feb 1998 01:12:03 -0700 + +freetype (0.beta.1998.01.06-1) unstable; urgency=low + + * New upstream snapshot release. + * Thanks to the libtool patch posted by Hirotsugu Kakugawa + on the freetype-devel mailing list + (and some local tweaking), the Debian freetype package finally + provides the library and header files! Hurray! (Fixes Bug#16365) + * Splitted the package into freetype0, freetype0-dev and freetype-tools. + * Added debian/compress to ensure that /usr/doc/freetype0/image/*.png + are not compressed. + * Revised README.Debian. + + -- Anthony Fok Thu, 8 Jan 1998 20:46:14 -0700 + +freetype (0.beta.1997.12.25-1) unstable; urgency=low + + * New upstream snapshot release. + * Modified /usr/doc/freetype/copyright to include the new license.txt. + (Yes, FreeType's license has changed.) + * Have a blessed Merry Christmas! + + -- Anthony Fok Fri, 26 Dec 1997 11:26:25 -0700 + +freetype (0.beta.1997.12.16-1) unstable; urgency=low + + * New upstream release. + * /usr/bin/ttf_{lint,timer,view,zoom} no longer exists. The upstream + authors have renamed them as /usr/bin/{ftlint,fttimer,ftview,ftzoom} + and have also added other nifty test programs! :) + * debian/rules: Switched to debhelper. + * debian/control: Upgraded Standards-Version to 2.3.0.1 and increased + Priority to optional. :) + * Revised /usr/doc/freetype/copyright. FreeType is now truly DFSG-free! + (Fixes Bug#16030) + * Revised README.Debian. + * Changed my maintainer e-mail address to . :) + * Sorry, the library and header files are not yet included. + I have yet to learn how. :) + + -- Anthony Fok Wed, 17 Dec 1997 03:02:49 -0700 + +freetype (0.4-4) unstable; urgency=low + + * Corrected the freetype mailing-list server's address from + "@lists.tu-muenchen.de" to "@lists.lrz-muenchen.de" in the files + /usr/doc/freetype/readme.1st and license.txt. + * Improved the package description and added a URL link to the + FreeType Project Home Page + * Removed "Keywords", "Primary-site" and "Original-site" from the package's + description, but kept "Authors" and "Maintained-by" (Closed bug #12510). + + -- Anthony Fok Sun, 21 Sep 1997 18:24:42 -0600 + +freetype (0.4-3) unstable; urgency=low + + * Rebuilt with both libc6 and xlib6g (Fixes bug #12784). + * Updated to Standards-Version: 2.3.0.0. + + -- Anthony Fok Wed, 10 Sep 1997 21:57:20 -0600 + +freetype (0.4-2) unstable; urgency=low + + * Renamed /usr/bin/{lint,timer,view,zoom} to + /usr/bin/ttf_{lint,timer,view,zoom} to avoid name conflicts with other + programs (Fixes bugs #12096, #12136). + * Closed bug #11193 (freetype AR4 available). + + -- Anthony Fok Tue, 19 Aug 1997 17:53:32 -0600 + +freetype (0.4-1) unstable; urgency=low + + * New maintainer. + * New upstream release. + * Updated to Standards-Version: 2.2.0.0. + + -- Anthony Fok Mon, 11 Aug 1997 08:26:17 -0600 + +freetype (0.3-1) unstable; urgency=low + + * Upstream update. Sadly the envisioned Christmas target of an X truetype + rasterizer has been abandoned. + + -- Christoph Lameter Tue, 24 Dec 1996 12:52:24 -0800 + +freetype (0.1-1) unstable; urgency=low + + * Initial Release. + + -- Christoph Lameter Thu, 7 Nov 1996 11:51:45 -0800 --- freetype-2.1.10.orig/debian/libfreetype6-dev.doc-base +++ freetype-2.1.10/debian/libfreetype6-dev.doc-base @@ -0,0 +1,10 @@ +Document: libfreetype6-dev +Title: Debian FreeType 2 Development Documentation +Author: Various +Abstract: Development documentatin for FreeType 2. +Section: libdevel + +Format: HTML +Index: /usr/share/doc/libfreetype6/reference/ft2-index.html +Files: /usr/share/doc/libfreetype6/reference/*.html + --- freetype-2.1.10.orig/debian/rules.museum +++ freetype-2.1.10/debian/rules.museum @@ -0,0 +1,84 @@ +# These are some bits and pieces from freetype1 debian/rules. +# They are moved here to get rid of the clutter in the current debian/rules. +# Who knows? Perhaps we will need the following some day. + +# dependency = '$(libpkg) (>= 1.3.1)' + +# TTF2PKINPUTS = usr/share/texmf/ttf2pk +# TTF2TFMINPUTS = usr/share/texmf/ttf2tfm + +build: +# ( cd contrib/ttf2bdf && ./configure --prefix=/usr --mandir='$${prefix}/share/man' ) +# $(MAKE) -C contrib/ttf2bdf +# ( cd contrib/ttf2pk && ./configure --prefix=/usr \ +# --mandir='$${prefix}/share/man' --with-kpathsea-dir=/usr ) +# $(MAKE) -C contrib/ttf2pk +# ( cd contrib/ttf2pfb && ./configure --prefix=/usr --mandir='$${prefix}/share/man' ) +# $(MAKE) -C contrib/ttf2pfb +# ( cd contrib/ttfbanner && ./configure --prefix=/usr --mandir='$${prefix}/share/man' ) +# $(MAKE) -C contrib/ttfbanner + +clean: +# -for i in ttf2bdf ttf2pfb ttf2pk ttfbanner; do \ +# $(MAKE) -C contrib/$$i distclean; \ +# done + +# The following target is not used for FreeType 2: +$(binpkg): DH_OPTIONS=-p$(binpkg) +$(binpkg): build install + dh_testdir + dh_testroot + + dh_installdirs $(docdir)/$(libpkg)/ttf2pk \ + $(TTF2PKINPUTS) $(TTF2TFMINPUTS) etc/ttf2pk \ + $(docdir)/$(libpkg)/ttf2bdf \ + $(docdir)/$(libpkg)/ttf2pfb \ + $(docdir)/$(libpkg)/ttfbanner + ln -s $(libpkg) debian/$(binpkg)/$(docdir)/$(binpkg) + + for i in ttf2bdf ttf2pfb ttf2pk ttfbanner; do \ + $(MAKE) -C contrib/$$i prefix=`pwd`/debian/$(binpkg)/usr install; \ + done + + # Temporary measure. Remove the following in the future after + # both versions (from t1utils and freetype) are merged. + ( cd debian/$(binpkg)/usr/bin && \ + mv t1asm t1asm-freetype && \ + mv getafm getafm-freetype ) + + # ttf2tfm and ttf2pk both need the *.sfd, *.enc and *.rpl + # in their own directory. (?) Hmm... + cp -av contrib/ttf2pk/data/*.{sfd,enc,rpl} debian/$(binpkg)/$(TTF2PKINPUTS) + ln debian/$(binpkg)/$(TTF2PKINPUTS)/*.{sfd,enc,rpl} debian/$(binpkg)/$(TTF2TFMINPUTS) + + cp -av contrib/ttf2pk/data/ttfonts.map debian/$(binpkg)/etc/ttf2pk + ln -s /etc/ttf2pk/ttfonts.map debian/$(binpkg)/$(TTF2PKINPUTS) + + dh_installdocs + + cp -av contrib/ttf2bdf/README \ + debian/$(binpkg)/$(docdir)/$(binpkg)/ttf2bdf/ + cp -av contrib/ttf2pfb/TODO \ + debian/$(binpkg)/$(docdir)/$(binpkg)/ttf2pfb/ + ( cd contrib/ttf2pk && cp -av *.doc README TODO BUGS \ + ../../debian/$(binpkg)/$(docdir)/$(binpkg)/ttf2pk/ ) + cp -av contrib/ttfbanner/README \ + debian/$(binpkg)/$(docdir)/$(binpkg)/ttfbanner/ + +# dh_installexamples tools/ttf2bdf/iso8859.2 tools/ttf2pk/ +# dh_installmenu +# dh_installmanpages +# dh_undocumented ftview.1 fttimer.1 ftlint.1 ftdump.1 \ +# ftzoom.1 ftstring.1 ftstrpnm.1 fterror.1 \ +# ttf2pfb.1 ttfbanner.1 +# dh_installchangelogs + dh_strip + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps --dpkg-shlibdeps-params=-Ldebian/$(libpkg)/DEBIAN/shlibs + dh_gencontrol +# dh_makeshlibs + dh_md5sums + dh_builddeb --- freetype-2.1.10.orig/debian/libfreetype6-dev.files +++ freetype-2.1.10/debian/libfreetype6-dev.files @@ -0,0 +1,7 @@ +usr/bin/freetype-config +usr/include/ +usr/lib/*.so +usr/lib/*.la +usr/lib/*.a +usr/lib/pkgconfig/ +usr/share/aclocal/ --- freetype-2.1.10.orig/debian/README.Debian +++ freetype-2.1.10/debian/README.Debian @@ -0,0 +1,35 @@ +FreeType 2 for Debian +--------------------- + +Hurray! FreeType 2 is finally here! :-) The "6" in the package name +"libfreetype6" is the major soname of FreeType 2's libfreetype. + +According to the FreeType 2 FAQ, + + The FreeType 2 API is a lot simpler than the one in 1.x while being + much more powerful. We thus encourage you to adapt your source code + to it as this should not involve much work. + +So please try your best to help migrate your software to FreeType 2. + +FreeType 2.x can co-exist peacefully with FreeType 1.x with no namespace +conflicts. However, the source package names must be distinguished in +Debian. So, to truly conform with the library naming convention outlined +in the Debian Policy, I've decided the following names for the FreeType +packages in Debian 3.0: + + FreeType 2.x: + Source package: freetype_2.x.x.orig.tar.gz (current version) + library package: libfreetype6_2.x.x-x (libfreetype, soname 6) + devel package: libfreetype6-dev_2.x.x-x (libfreetype, soname 6) + + FreeType 1.x: + Source package: freetype1_1.x.orig.tar.gz (for FreeType 1) + library package: libttf2_1.x-? (libttf, soname 2) + devel package: libttf-dev_1.x-? (libttf, soname 2) + +Simple, non? + +Enjoy! :-) + + -- Anthony Fok , Mon, 23 Apr 2001 23:07:16 -0600 --- freetype-2.1.10.orig/debian/freetype-config.man.sgml +++ freetype-2.1.10/debian/freetype-config.man.sgml @@ -0,0 +1,174 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + Will"> + Newton"> + 2005-06-09"> + 1"> + will@debian.org"> + + FREETYPE-CONFIG"> + + + Debian"> + GNU"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2005 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + show information about installed freetype2 libraries + + + + &dhpackage; + + + + + + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; command, + + &dhpackage; is a program that shows information + about the installed freetype2 libraries. + + + + OPTIONS + + The following options are supported: + + + + + + + + Show the prefix freetype2 was built with. The prefix may + be overridden by passing the argument PREFIX. + + + + + + + + Show the executable prefix freetype2 was built with. The + executable prefix may be overridden by passing the argument + EPREFIX. + + + + + + + Show the libtool version of the installed freetype2. + + + + + + + Show the FreeType version of the installed freetype2. + + + + + + + Show the compiler flags for linking to the installed freetype2. + + + + + + + Show the library name for linking with libtool. + + + + + + + Show the compiler flags for compiling against the installed freetype2. + + + + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the GNU Free Documentation + License, Version 1.1 or any later version published by the Free + Software Foundation; with no Invariant Sections, no Front-Cover + Texts and no Back-Cover Texts. + + +
+ + + + --- freetype-2.1.10.orig/debian/libfreetype6-udeb.dirs +++ freetype-2.1.10/debian/libfreetype6-udeb.dirs @@ -0,0 +1 @@ +usr/lib --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-fixautofit.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-fixautofit.patch @@ -0,0 +1,11 @@ +--- freetype-2.1.10/src/autofit/aflatin.c.fixautofit 2005-08-24 15:34:14.000000000 +0200 ++++ freetype-2.1.10/src/autofit/aflatin.c 2005-08-24 15:34:45.000000000 +0200 +@@ -559,6 +559,8 @@ + af_latin_metrics_scale( AF_LatinMetrics metrics, + AF_Scaler scaler ) + { ++ metrics->root.scaler.render_mode = scaler->render_mode; ++ + af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ ); + af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT ); + } --- freetype-2.1.10.orig/debian/patches/400-ttkern-loop-variable.patch +++ freetype-2.1.10/debian/patches/400-ttkern-loop-variable.patch @@ -0,0 +1,14 @@ +diff -Nurp freetype-2.1.10/src/sfnt/ttkern.c freetype-2.1.10.new/src/sfnt/ttkern.c +--- freetype-2.1.10/src/sfnt/ttkern.c 2005-03-03 12:18:15.000000000 +0100 ++++ freetype-2.1.10.new/src/sfnt/ttkern.c 2006-05-30 16:04:57.000000000 +0200 +@@ -246,7 +246,9 @@ + } + else /* linear search */ + { +- for ( count = num_pairs; count > 0; count-- ) ++ FT_UInt count2; ++ ++ for ( count2 = num_pairs; count2 > 0; count2-- ) + { + FT_ULong key = FT_NEXT_ULONG( p ); + --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-xorgfix.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-xorgfix.patch @@ -0,0 +1,16 @@ +--- freetype-2.1.10/src/sfnt/sfdriver.c.xorgfix 2005-08-03 19:10:58.867654076 +0200 ++++ freetype-2.1.10/src/sfnt/sfdriver.c 2005-08-03 19:11:43.083188865 +0200 +@@ -367,8 +367,13 @@ + /* see `ttsbit.h' and `sfnt.h' */ + tt_face_set_sbit_strike, + tt_face_load_sbit_strikes, ++#ifdef FT_OPTIMIZE_MEMORY + 0 /* tt_find_sbit_image */, + 0 /* tt_load_sbit_metrics */, ++#else ++ tt_find_sbit_image, ++ tt_load_sbit_metrics, ++#endif + tt_face_load_sbit_image, + tt_face_free_sbit_strikes, + --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-fixaliasing.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-fixaliasing.patch @@ -0,0 +1,20 @@ +--- freetype-2.1.10/src/autofit/aflatin.c.fixaliasing 2005-09-26 09:46:52.000000000 +0200 ++++ freetype-2.1.10/src/autofit/aflatin.c 2005-09-26 09:50:29.000000000 +0200 +@@ -1311,6 +1311,8 @@ + + mode = metrics->root.scaler.render_mode; + ++ hints->other_flags = 0; ++ + /* + * We snap the width of vertical stems for the monochrome and + * horizontal LCD rendering targets only. +@@ -1407,7 +1407,7 @@ + AF_LatinAxis axis = & metrics->axis[dim]; + FT_Pos dist = width; + FT_Int sign = 0; +- FT_Int vertical = AF_HINTS_DO_VERTICAL( hints ); ++ FT_Int vertical = dim == AF_DIMENSION_VERT; + + + if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ) --- freetype-2.1.10.orig/debian/patches/007-freetype-2.1.4-kerning.diff +++ freetype-2.1.10/debian/patches/007-freetype-2.1.4-kerning.diff @@ -0,0 +1,14 @@ +--- freetype-2.1.4~/src/autohint/ahhint.c 2003-01-25 02:01:06.000000000 +0800 ++++ freetype-2.1.4/src/autohint/ahhint.c 2003-01-25 02:07:39.000000000 +0800 +@@ -1428,9 +1428,11 @@ + hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; + hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64; + ++#if 0 + /* try to fix certain bad advance computations */ + if ( hinter->pp2.x + hinter->pp1.x == edge2->pos && old_rsb > 4 ) + hinter->pp2.x += 64; ++#endif + } + + /* good, we simply add the glyph to our loader's base */ --- freetype-2.1.10.orig/debian/patches/402-int-overflows.patch +++ freetype-2.1.10/debian/patches/402-int-overflows.patch @@ -0,0 +1,177 @@ +diff -Nurp freetype-2.1.10/include/freetype/fterrdef.h freetype-2.1.10.new/include/freetype/fterrdef.h +--- freetype-2.1.10/include/freetype/fterrdef.h 2004-02-12 09:33:20.000000000 +0100 ++++ freetype-2.1.10.new/include/freetype/fterrdef.h 2006-06-02 15:42:00.000000000 +0200 +@@ -226,6 +226,8 @@ + "`ENCODING' field missing" ) + FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ + "`BBX' field missing" ) ++ FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ ++ "`BBX' too big" ) + + + /* END */ +diff -Nurp freetype-2.1.10/src/base/ftmac.c freetype-2.1.10.new/src/base/ftmac.c +--- freetype-2.1.10/src/base/ftmac.c 2004-08-28 10:02:46.000000000 +0200 ++++ freetype-2.1.10.new/src/base/ftmac.c 2006-06-02 15:45:18.000000000 +0200 +@@ -430,6 +430,7 @@ + short res_id; + unsigned char *buffer, *p, *size_p = NULL; + FT_ULong total_size = 0; ++ FT_ULong old_total_size = 0; + FT_ULong post_size, pfb_chunk_size; + Handle post_data; + char code, last_code; +@@ -462,6 +463,15 @@ + last_code = code; + } + ++ /* detect integer overflows */ ++ if ( total_size < old_total_size ) ++ { ++ error = FT_Err_Array_Too_Large; ++ goto Error; ++ } ++ ++ old_total_size = total_size; ++ + if ( FT_ALLOC( buffer, (FT_Long)total_size ) ) + goto Error; + +diff -Nurp freetype-2.1.10/src/bdf/bdflib.c freetype-2.1.10.new/src/bdf/bdflib.c +--- freetype-2.1.10/src/bdf/bdflib.c 2006-06-02 15:40:24.000000000 +0200 ++++ freetype-2.1.10.new/src/bdf/bdflib.c 2006-06-02 15:42:00.000000000 +0200 +@@ -1092,6 +1092,7 @@ + #define ERRMSG1 "[line %ld] Missing \"%s\" line.\n" + #define ERRMSG2 "[line %ld] Font header corrupted or missing fields.\n" + #define ERRMSG3 "[line %ld] Font glyphs corrupted or missing fields.\n" ++#define ERRMSG4 "[line %ld] BBX too big.\n" + + + static FT_Error +@@ -1569,6 +1570,14 @@ + goto Exit; + } + ++ /* Check that the encoding is in the range [0,65536] because */ ++ /* otherwise p->have (a bitmap with static size) overflows. */ ++ if ( p->glyph_enc >= sizeof(p->have)*8 ) ++ { ++ error = BDF_Err_Invalid_File_Format; ++ goto Exit; ++ } ++ + /* Check to see whether this encoding has already been encountered. */ + /* If it has then change it to unencoded so it gets added if */ + /* indicated. */ +@@ -1814,6 +1823,9 @@ + /* And finally, gather up the bitmap. */ + if ( ft_memcmp( line, "BITMAP", 6 ) == 0 ) + { ++ unsigned long bitmap_size; ++ ++ + if ( !( p->flags & _BDF_BBX ) ) + { + /* Missing BBX field. */ +@@ -1824,7 +1836,16 @@ + + /* Allocate enough space for the bitmap. */ + glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3; +- glyph->bytes = (unsigned short)( glyph->bpr * glyph->bbx.height ); ++ ++ bitmap_size = glyph->bpr * glyph->bbx.height; ++ if ( bitmap_size < 0 || bitmap_size > 0xFFFFU ) ++ { ++ FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno )); ++ error = BDF_Err_Bbx_Too_Big; ++ goto Exit; ++ } ++ else ++ glyph->bytes = (unsigned short)bitmap_size; + + if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) ) + goto Exit; +diff -Nurp freetype-2.1.10/src/cff/cffgload.c freetype-2.1.10.new/src/cff/cffgload.c +--- freetype-2.1.10/src/cff/cffgload.c 2006-06-02 15:40:24.000000000 +0200 ++++ freetype-2.1.10.new/src/cff/cffgload.c 2006-06-02 15:42:00.000000000 +0200 +@@ -2284,7 +2284,7 @@ + FT_LOCAL_DEF( FT_Error ) + cff_slot_load( CFF_GlyphSlot glyph, + CFF_Size size, +- FT_Int glyph_index, ++ FT_UInt glyph_index, + FT_Int32 load_flags ) + { + FT_Error error; +@@ -2330,7 +2330,7 @@ + + error = sfnt->load_sbit_image( face, + (FT_ULong)size->strike_index, +- (FT_UInt)glyph_index, ++ glyph_index, + (FT_Int)load_flags, + stream, + &glyph->root.bitmap, +@@ -2393,7 +2393,12 @@ + /* subsetted font, glyph_indices and CIDs are identical, though */ + if ( cff->top_font.font_dict.cid_registry != 0xFFFFU && + cff->charset.cids ) +- glyph_index = cff->charset.cids[glyph_index]; ++ { ++ if ( glyph_index < cff->charset.max_cid ) ++ glyph_index = cff->charset.cids[glyph_index]; ++ else ++ glyph_index = 0; ++ } + + cff_decoder_init( &decoder, face, size, glyph, hinting, + FT_LOAD_TARGET_MODE( load_flags ) ); +diff -Nurp freetype-2.1.10/src/cff/cffgload.h freetype-2.1.10.new/src/cff/cffgload.h +--- freetype-2.1.10/src/cff/cffgload.h 2004-05-13 23:59:17.000000000 +0200 ++++ freetype-2.1.10.new/src/cff/cffgload.h 2006-06-02 15:42:00.000000000 +0200 +@@ -196,7 +196,7 @@ FT_BEGIN_HEADER + FT_LOCAL( FT_Error ) + cff_slot_load( CFF_GlyphSlot glyph, + CFF_Size size, +- FT_Int glyph_index, ++ FT_UInt glyph_index, + FT_Int32 load_flags ); + + +diff -Nurp freetype-2.1.10/src/cff/cffload.c freetype-2.1.10.new/src/cff/cffload.c +--- freetype-2.1.10/src/cff/cffload.c 2006-06-02 15:40:24.000000000 +0200 ++++ freetype-2.1.10.new/src/cff/cffload.c 2006-06-02 15:42:00.000000000 +0200 +@@ -1688,6 +1688,8 @@ + + for ( i = 0; i < num_glyphs; i++ ) + charset->cids[charset->sids[i]] = (FT_UShort)i; ++ ++ charset->max_cid = max_cid; + } + + Exit: +diff -Nurp freetype-2.1.10/src/cff/cfftypes.h freetype-2.1.10.new/src/cff/cfftypes.h +--- freetype-2.1.10/src/cff/cfftypes.h 2003-12-20 08:30:05.000000000 +0100 ++++ freetype-2.1.10.new/src/cff/cfftypes.h 2006-06-02 15:42:00.000000000 +0200 +@@ -84,6 +84,7 @@ FT_BEGIN_HEADER + FT_UShort* sids; + FT_UShort* cids; /* the inverse mapping of `sids'; only needed */ + /* for CID-keyed fonts */ ++ FT_UInt max_cid; + } CFF_CharsetRec, *CFF_Charset; + + +diff -Nurp freetype-2.1.10/src/sfnt/ttcmap.c freetype-2.1.10.new/src/sfnt/ttcmap.c +--- freetype-2.1.10/src/sfnt/ttcmap.c 2005-05-11 16:37:40.000000000 +0200 ++++ freetype-2.1.10.new/src/sfnt/ttcmap.c 2006-06-02 15:42:00.000000000 +0200 +@@ -2144,9 +2144,7 @@ + charmap.encoding = FT_ENCODING_NONE; /* will be filled later */ + offset = TT_NEXT_ULONG( p ); + +- if ( offset && +- table + offset + 2 < limit && +- table + offset >= table ) ++ if ( offset && offset <= face->cmap_size - 2) + { + FT_Byte* cmap = table + offset; + volatile FT_UInt format = TT_PEEK_USHORT( cmap ); --- freetype-2.1.10.orig/debian/patches/404-bdf-integer.patch +++ freetype-2.1.10/debian/patches/404-bdf-integer.patch @@ -0,0 +1,54 @@ +diff -uNrp freetype-2.1.10.orig/src/bdf/bdflib.c freetype-2.1.10/src/bdf/bdflib.c +--- freetype-2.1.10.orig/src/bdf/bdflib.c 2005-05-21 10:19:52.000000000 -0700 ++++ freetype-2.1.10/src/bdf/bdflib.c 2007-04-02 15:42:49.000000000 -0700 +@@ -384,8 +384,10 @@ + } _bdf_parse_t; + + +-#define setsbit( m, cc ) ( m[(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) ) +-#define sbitset( m, cc ) ( m[(cc) >> 3] & ( 1 << ( (cc) & 7 ) ) ) ++#define setsbit( m, cc ) \ ++ ( m[(FT_Byte)(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) ) ++#define sbitset( m, cc ) \ ++ ( m[(FT_Byte)(cc) >> 3] & ( 1 << ( (cc) & 7 ) ) ) + + + static void +@@ -1128,7 +1130,7 @@ + bdf_options_t* opts ) + { + unsigned long len; +- char name[128]; ++ char name[256]; + _bdf_list_t list; + FT_Memory memory; + FT_Error error = BDF_Err_Ok; +@@ -1147,6 +1149,13 @@ + font->spacing = opts->font_spacing; + + len = (unsigned long)( ft_strlen( font->name ) + 1 ); ++ /* Limit ourselves to 256 characters in the font name. */ ++ if ( len >= 256 ) ++ { ++ error = BDF_Err_Invalid_Argument; ++ goto Exit; ++ } ++ + FT_MEM_COPY( name, font->name, len ); + + error = _bdf_list_split( &list, (char *)"-", name, len ); +@@ -1481,6 +1490,14 @@ + if ( p->cnt == 0 ) + font->glyphs_size = 64; + ++ /* Limit ourselves to 1,114,112 glyphs in the font (this is the */ ++ /* number of code points available in Unicode). */ ++ if ( p->cnt >= 1114112UL ) ++ { ++ error = BDF_Err_Invalid_Argument; ++ goto Exit; ++ } ++ + if ( FT_NEW_ARRAY( font->glyphs, font->glyphs_size ) ) + goto Exit; + --- freetype-2.1.10.orig/debian/patches/200-freetype-2.1.4-smooth-usegamma-20030519.diff +++ freetype-2.1.10/debian/patches/200-freetype-2.1.4-smooth-usegamma-20030519.diff @@ -0,0 +1,27 @@ +--- freetype-2.1.4/src/smooth/ftgrays.c.gamma 2003-05-19 12:25:51.000000000 +0800 ++++ freetype-2.1.4/src/smooth/ftgrays.c 2003-05-19 13:16:28.000000000 +0800 +@@ -83,7 +83,11 @@ + + + /* experimental support for gamma correction within the rasterizer */ +-#define xxxGRAYS_USE_GAMMA ++/* Modify by Firefly (firefly@firefly.idv.tw) ++ * ¨Ï¥Î gamma table Åýµ§¹º²M´·¤@¨Ç, ²M´·«×µøÅã¥Ü¾¹¦Ó©w ++ * ¤@¯ë¦Ó¨¥, ¹ïµ§¹º½ÆÂøªº CJK ¦r«¬, ®ÄªG«D±`¤§¦n ++ */ ++#define GRAYS_USE_GAMMA + + + /*************************************************************************/ +@@ -2040,7 +2044,10 @@ + /* but the results look pretty good for something that simple. */ + /* */ + #define M_MAX 255 +-#define M_X 128 ++/* Modify by Firefly (firefly@firefly.idv.tw) ++ * ¯Âºé¬O§j¤ò¨D²«ªº­×§ï, Åýµ§¹º§ó²`¤@¨Ç :-) ++ */ ++#define M_X 112 + #define M_Y 192 + + static void --- freetype-2.1.10.orig/debian/patches/300-bdflib-zero-width-glyphs.diff +++ freetype-2.1.10/debian/patches/300-bdflib-zero-width-glyphs.diff @@ -0,0 +1,22 @@ +diff -u freetype-2.1.9~/src/bdf/bdflib.c freetype-2.1.9/src/bdf/bdflib.c +--- freetype-2.1.9~/src/bdf/bdflib.c 2004-06-22 13:28:17.000000000 +0100 ++++ freetype-2.1.9/src/bdf/bdflib.c 2005-05-28 15:11:11.060210392 +0100 +@@ -1683,7 +1683,7 @@ + nibbles = glyph->bpr << 1; + bp = glyph->bitmap + p->row * glyph->bpr; + +- for ( i = 0, *bp = 0; i < nibbles; i++ ) ++ for ( i = 0; i < nibbles; i++ ) + { + c = line[i]; + *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] ); +@@ -1693,7 +1693,8 @@ + + /* Remove possible garbage at the right. */ + mask_index = ( glyph->bbx.width * p->font->bpp ) & 7; +- *bp &= nibble_mask[mask_index]; ++ if (glyph->bbx.width) ++ *bp &= nibble_mask[mask_index]; + + /* If any line has extra columns, indicate they have been removed. */ + if ( ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) && --- freetype-2.1.10.orig/debian/patches/070-ft2demos-2.1.7-no-rpath.diff +++ freetype-2.1.10/debian/patches/070-ft2demos-2.1.7-no-rpath.diff @@ -0,0 +1,17 @@ +--- ft2demos-2.1.7~/graph/x11/rules.mk 2003-08-28 01:11:31.000000000 +0800 ++++ ft2demos-2.1.7/graph/x11/rules.mk 2003-08-28 01:50:19.000000000 +0800 +@@ -67,9 +67,11 @@ + # The GRAPH_LINK variable is expanded each time an executable is linked + # against the graphics library. + # +- ifeq ($(PLATFORM),unix) +- GRAPH_LINK += $(X11_LIB:%=-R%) +- endif ++ # No, we do not want rpath on Debian; reversing YAMANO-UCHI Hidetoshi's ++ # 2003-06-13 change. (Anthony Fok, 2003-08-28) ++ #ifeq ($(PLATFORM),unix) ++ # GRAPH_LINK += $(X11_LIB:%=-R%) ++ #endif + GRAPH_LINK += $(X11_LIB:%=-L%) -lX11 + + # Solaris needs a -lsocket in GRAPH_LINK. --- freetype-2.1.10.orig/debian/patches/300-bdflib-large-encodings.diff +++ freetype-2.1.10/debian/patches/300-bdflib-large-encodings.diff @@ -0,0 +1,18 @@ +diff -u freetype-2.1.9~/src/bdf/bdflib.c freetype-2.1.9/src/bdf/bdflib.c +--- freetype-2.1.9~/src/bdf/bdflib.c 2004-06-22 13:28:17.000000000 +0100 ++++ freetype-2.1.9/src/bdf/bdflib.c 2005-05-28 15:09:40.872920944 +0100 +@@ -1570,6 +1570,14 @@ + goto Exit; + p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 ); + ++ /* Check that the encoding is in the range [0, 65535] because */ ++ /* otherwise p->have (a bitmap with static size) overflows. */ ++ if ( p->glyph_enc >= sizeof(p->have) * 8 ) ++ { ++ error = BDF_Err_Invalid_File_Format; /* Not the ideal error code */ ++ goto Exit; ++ } ++ + /* Check to see whether this encoding has already been encountered. */ + /* If it has then change it to unencoded so it gets added if */ + /* indicated. */ --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-cvsfixes.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-cvsfixes.patch @@ -0,0 +1,1046 @@ +--- freetype2/include/freetype/internal/ftobjs.h 27 May 2005 06:01:28 -0000 1.90 ++++ freetype2/include/freetype/internal/ftobjs.h 20 Jun 2005 09:04:49 -0000 1.91 +@@ -452,6 +452,13 @@ FT_BEGIN_HEADER + /* */ + + /* ++ * grid-fit slot->metrics ++ */ ++ FT_BASE( void ) ++ ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot ); ++ ++ ++ /* + * Free the bitmap of a given glyphslot when needed + * (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap). + */ +Index: src/base/ftobjs.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/base/ftobjs.c,v +retrieving revision 1.215 +retrieving revision 1.217 +diff -u -p -r1.215 -r1.217 +--- freetype2/src/base/ftobjs.c 6 Jun 2005 07:01:47 -0000 1.215 ++++ freetype2/src/base/ftobjs.c 23 Jun 2005 20:31:48 -0000 1.217 +@@ -251,6 +251,29 @@ + + + FT_BASE_DEF( void ) ++ ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot ) ++ { ++ FT_Pos tmp; ++ ++ ++ tmp = FT_PIX_CEIL( slot->metrics.horiBearingX + slot->metrics.width ); ++ slot->metrics.horiBearingX = FT_PIX_FLOOR( slot->metrics.horiBearingX ); ++ slot->metrics.width = tmp - slot->metrics.horiBearingX; ++ ++ tmp = FT_PIX_FLOOR( slot->metrics.horiBearingY - slot->metrics.height ); ++ slot->metrics.horiBearingY = FT_PIX_CEIL( slot->metrics.horiBearingY ); ++ slot->metrics.height = slot->metrics.horiBearingY - tmp; ++ ++ slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance ); ++ ++ slot->metrics.vertBearingX = FT_PIX_FLOOR( slot->metrics.vertBearingX ); ++ /* note that vertBearingY should be floor'ed */ ++ slot->metrics.vertBearingY = FT_PIX_FLOOR( slot->metrics.vertBearingY ); ++ slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance ); ++ } ++ ++ ++ FT_BASE_DEF( void ) + ft_glyphslot_set_bitmap( FT_GlyphSlot slot, + FT_Byte* buffer ) + { +Index: src/base/ftoutln.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/base/ftoutln.c,v +retrieving revision 1.62 +retrieving revision 1.63 +diff -u -p -r1.62 -r1.63 +--- freetype2/src/base/ftoutln.c 25 May 2005 05:51:01 -0000 1.62 ++++ freetype2/src/base/ftoutln.c 16 Jun 2005 19:07:08 -0000 1.63 +@@ -683,6 +683,7 @@ + if ( !outline ) + return FT_Err_Invalid_Argument; + ++ strength /= 2; + if ( strength == 0 ) + return FT_Err_Ok; + +Index: src/base/ftsynth.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/base/ftsynth.c,v +retrieving revision 1.27 +retrieving revision 1.30 +diff -u -p -r1.27 -r1.30 +--- freetype2/src/base/ftsynth.c 30 May 2005 07:54:20 -0000 1.27 ++++ freetype2/src/base/ftsynth.c 23 Jun 2005 20:31:48 -0000 1.30 +@@ -81,13 +81,16 @@ + + /* some reasonable strength */ + xstr = FT_MulFix( face->units_per_EM, +- face->size->metrics.y_scale ) / 42; ++ face->size->metrics.y_scale ) / 24; + ystr = xstr; + + if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) + { + error = FT_Outline_Embolden( &slot->outline, xstr ); +- xstr = xstr * 4; /* according to the documentation */ ++ ++ /* this is more than enough for most glyphs; */ ++ /* if you need accurate values, you have to call FT_Outline_Get_CBox */ ++ xstr = xstr * 2; + ystr = xstr; + } + else if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) +@@ -122,8 +125,8 @@ + /* modify the metrics accordingly */ + if ( !error ) + { ++ /* assume the layout is horizontal */ + slot->advance.x += xstr; +- slot->advance.y += ystr; + + slot->metrics.width += xstr; + slot->metrics.height += ystr; +Index: src/cff/cffgload.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/cff/cffgload.c,v +retrieving revision 1.66 +retrieving revision 1.67 +diff -u -p -r1.66 -r1.67 +--- freetype2/src/cff/cffgload.c 18 Apr 2005 07:13:07 -0000 1.66 ++++ freetype2/src/cff/cffgload.c 20 Jun 2005 09:04:50 -0000 1.67 +@@ -2510,11 +2510,8 @@ + glyph->root.linearHoriAdvance = decoder.glyph_width; + glyph->root.internal->glyph_transformed = 0; + +- /* make up vertical metrics */ +- metrics->vertBearingX = 0; +- metrics->vertBearingY = 0; ++ /* make up vertical ones */ + metrics->vertAdvance = 0; +- + glyph->root.linearVertAdvance = 0; + + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; +@@ -2559,42 +2556,26 @@ + vec->y = FT_MulFix( vec->y, y_scale ); + } + +- FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); +- + /* Then scale the metrics */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); +- +- metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale ); +- metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale ); +- +- if ( hinting ) +- { +- metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); +- metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); +- +- metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); +- metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); +- } + } + + /* compute the other metrics */ + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); + +- /* grid fit the bounding box if necessary */ +- if ( hinting ) +- { +- cbox.xMin &= -64; +- cbox.yMin &= -64; +- cbox.xMax = ( cbox.xMax + 63 ) & -64; +- cbox.yMax = ( cbox.yMax + 63 ) & -64; +- } +- + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax; ++ ++ /* make up vertical ones */ ++ metrics->vertBearingX = 0; ++ metrics->vertBearingY = 0; ++ ++ if ( hinting ) ++ ft_glyphslot_grid_fit_metrics( &glyph->root ); + } + } + +Index: src/cid/cidgload.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/cid/cidgload.c,v +retrieving revision 1.70 +retrieving revision 1.72 +diff -u -p -r1.70 -r1.72 +--- freetype2/src/cid/cidgload.c 6 May 2004 11:48:35 -0000 1.70 ++++ freetype2/src/cid/cidgload.c 23 Jun 2005 20:31:48 -0000 1.72 +@@ -358,12 +358,10 @@ + cidglyph->linearHoriAdvance = decoder.builder.advance.x; + cidglyph->internal->glyph_transformed = 0; + +- /* make up vertical metrics */ +- metrics->vertBearingX = 0; +- metrics->vertBearingY = 0; ++ /* make up vertical ones */ + metrics->vertAdvance = 0; +- + cidglyph->linearVertAdvance = 0; ++ + cidglyph->format = FT_GLYPH_FORMAT_OUTLINE; + + if ( size && cidsize->metrics.y_ppem < 24 ) +@@ -403,42 +401,26 @@ + vec->y = FT_MulFix( vec->y, y_scale ); + } + +- FT_Outline_Get_CBox( &cidglyph->outline, &cbox ); +- + /* Then scale the metrics */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); +- +- metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale ); +- metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale ); +- +- if ( hinting ) +- { +- metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); +- metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); +- +- metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); +- metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); +- } + } + + /* compute the other metrics */ + FT_Outline_Get_CBox( &cidglyph->outline, &cbox ); + +- /* grid fit the bounding box if necessary */ +- if ( hinting ) +- { +- cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); +- cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); +- cbox.xMax = FT_PIX_CEIL( cbox.xMax ); +- cbox.yMax = FT_PIX_CEIL( cbox.yMax ); +- } +- + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax; ++ ++ /* make up vertical ones */ ++ metrics->vertBearingX = 0; ++ metrics->vertBearingY = 0; ++ ++ if ( hinting ) ++ ft_glyphslot_grid_fit_metrics( cidglyph ); + } + } + +Index: src/sfnt/ttsbit.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/sfnt/ttsbit.c,v +retrieving revision 1.63 +retrieving revision 1.64 +diff -u -p -r1.63 -r1.64 +--- freetype2/src/sfnt/ttsbit.c 1 Mar 2005 02:13:50 -0000 1.63 ++++ freetype2/src/sfnt/ttsbit.c 16 Jun 2005 19:07:08 -0000 1.64 +@@ -1501,7 +1501,7 @@ + /* some heuristic values */ + + metrics->vertBearingX = (FT_Char)(-metrics->width / 2 ); +- metrics->vertBearingY = (FT_Char)( advance / 10 ); ++ metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 ); + metrics->vertAdvance = (FT_Char)( advance * 12 / 10 ); + } + +Index: src/truetype/ttdriver.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/truetype/ttdriver.c,v +retrieving revision 1.78 +retrieving revision 1.79 +diff -u -p -r1.78 -r1.79 +--- freetype2/src/truetype/ttdriver.c 1 Mar 2005 02:13:50 -0000 1.78 ++++ freetype2/src/truetype/ttdriver.c 26 Jul 2005 08:14:03 -0000 1.79 +@@ -167,40 +167,33 @@ + FT_UInt horz_resolution, + FT_UInt vert_resolution ) + { +- TT_Size size = (TT_Size)ttsize; +- FT_Size_Metrics* metrics = &size->root.metrics; +- FT_Size_Metrics* metrics2 = &size->metrics; +- TT_Face face = (TT_Face)size->root.face; +- FT_Long dim_x, dim_y; ++ TT_Size size = (TT_Size)ttsize; ++ FT_Size_Metrics* metrics = &size->metrics; ++ TT_Face face = (TT_Face)size->root.face; + + +- *metrics2 = *metrics; ++ /* copy the result from base layer */ ++ *metrics = size->root.metrics; + + /* This bit flag, when set, indicates that the pixel size must be */ +- /* truncated to an integer. Nearly all TrueType fonts have this */ +- /* bit set, as hinting won't work really well otherwise. */ ++ /* rounded to integer. Nearly all TrueType fonts have this bit */ ++ /* set, as hinting won't work really well otherwise. */ + /* */ + if ( ( face->header.Flags & 8 ) != 0 ) + { +- /* we need to use rounding in the following computations. Otherwise, +- * the resulting hinted outlines will be very slightly distorted +- */ +- dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & ~63; +- dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & ~63; +- } +- else +- { +- dim_x = ( ( char_width * horz_resolution + 36 ) / 72 ); +- dim_y = ( ( char_height * vert_resolution + 36 ) / 72 ); +- } ++ FT_Long dim_x, dim_y; + +- /* we only modify "metrics2", not "metrics", so these changes have */ +- /* no effect on the result of the auto-hinter when it is used */ +- /* */ +- metrics2->x_ppem = (FT_UShort)( dim_x >> 6 ); +- metrics2->y_ppem = (FT_UShort)( dim_y >> 6 ); +- metrics2->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); +- metrics2->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); ++ dim_x = ( char_width * horz_resolution + 36 ) / 72; ++ dim_y = ( char_height * vert_resolution + 36 ) / 72; ++ ++ dim_x = FT_PIX_ROUND(dim_x); ++ dim_y = FT_PIX_ROUND(dim_y); ++ ++ metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); ++ metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); ++ metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); ++ metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); ++ } + + size->ttmetrics.valid = FALSE; + #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +Index: src/truetype/ttgload.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/truetype/ttgload.c,v +retrieving revision 1.138 +retrieving revision 1.143 +diff -u -p -r1.138 -r1.143 +--- freetype2/src/truetype/ttgload.c 6 Apr 2005 14:48:55 -0000 1.138 ++++ freetype2/src/truetype/ttgload.c 13 Jul 2005 06:58:13 -0000 1.143 +@@ -1707,15 +1707,6 @@ + FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 ); + + FT_Outline_Get_CBox( &glyph->outline, &bbox ); +- +- if ( IS_HINTED( loader->load_flags ) ) +- { +- /* grid-fit the bounding box */ +- bbox.xMin = FT_PIX_FLOOR( bbox.xMin ); +- bbox.yMin = FT_PIX_FLOOR( bbox.yMin ); +- bbox.xMax = FT_PIX_CEIL( bbox.xMax ); +- bbox.yMax = FT_PIX_CEIL( bbox.yMax ); +- } + } + else + bbox = loader->bbox; +@@ -1744,10 +1735,6 @@ + glyph->metrics.horiBearingY = bbox.yMax; + glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; + +- /* don't forget to hint the advance when we need to */ +- if ( IS_HINTED( loader->load_flags ) ) +- glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance ); +- + /* Now take care of vertical metrics. In the case where there is */ + /* no vertical information within the font (relatively common), make */ + /* up some metrics by `hand'... */ +@@ -1765,41 +1752,45 @@ + if ( face->vertical_info && + face->vertical.number_Of_VMetrics > 0 ) + { +- advance_height = (FT_UShort)( loader->pp4.y - loader->pp3.y ); +- top_bearing = (FT_Short)( loader->pp3.y - bbox.yMax ); ++ top_bearing = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax, ++ y_scale ); ++ ++ if ( loader->pp3.y <= loader->pp4.y ) ++ advance_height = 0; ++ else ++ advance_height = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y, ++ y_scale ); + } + else + { +- /* Make up the distances from the horizontal header. */ ++ FT_Short max_height, height; ++ ++ ++ /* XXX Compute top side bearing and advance height in */ ++ /* Get_VMetrics instead of here. */ + + /* NOTE: The OS/2 values are the only `portable' ones, */ + /* which is why we use them, if there is an OS/2 */ + /* table in the font. Otherwise, we use the */ + /* values defined in the horizontal header. */ +- /* */ +- /* NOTE2: The sTypoDescender is negative, which is why */ +- /* we compute the baseline-to-baseline distance */ +- /* here with: */ +- /* ascender - descender + linegap */ +- /* */ +- /* NOTE3: This is different from what MS's rasterizer */ +- /* appears to do when getting default values */ +- /* for the vertical phantom points. We leave */ +- /* the old code untouched, but relying on */ +- /* phantom points alone might be reasonable */ +- /* (i.e., removing the `if' above). */ ++ ++ height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin, y_scale ); + if ( face->os2.version != 0xFFFFU ) + { +- top_bearing = (FT_Short)( face->os2.sTypoLineGap / 2 ); +- advance_height = (FT_UShort)( face->os2.sTypoAscender - +- face->os2.sTypoDescender + +- face->os2.sTypoLineGap ); ++ /* sTypoDescender is negative */ ++ max_height = (FT_Short)(face->os2.sTypoAscender - ++ face->os2.sTypoDescender); ++ ++ top_bearing = (FT_Short)( ( max_height - height ) / 2 ); ++ advance_height = (FT_UShort)( max_height + face->os2.sTypoLineGap ); + } + else + { +- top_bearing = (FT_Short)( face->horizontal.Line_Gap / 2 ); +- advance_height = (FT_UShort)( face->horizontal.Ascender + +- face->horizontal.Descender + ++ max_height = (FT_Short)(face->horizontal.Ascender + ++ face->horizontal.Descender); ++ ++ top_bearing = (FT_Short)( ( max_height - height ) / 2 ); ++ advance_height = (FT_UShort)( max_height + + face->horizontal.Line_Gap ); + } + } +@@ -1817,7 +1808,7 @@ + + metrics.bearing_x = 0; + metrics.bearing_y = top_bearing; +- metrics.advance = advance_height; ++ metrics.advance = advance_height; + error = + face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, +@@ -1834,20 +1825,15 @@ + + #endif /* FT_CONFIG_OPTION_INCREMENTAL */ + +- /* We must adjust the top_bearing value from the bounding box given */ +- /* in the glyph header to the bounding box calculated with */ +- /* FT_Get_Outline_CBox(). */ +- + /* scale the metrics */ + if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) + { +- top = FT_MulFix( top_bearing + loader->bbox.yMax, y_scale ) +- - bbox.yMax; ++ top = FT_MulFix( top_bearing, y_scale ); + advance = FT_MulFix( advance_height, y_scale ); + } + else + { +- top = top_bearing + loader->bbox.yMax - bbox.yMax; ++ top = top_bearing; + advance = advance_height; + } + +@@ -1860,14 +1846,6 @@ + /* */ + left = ( bbox.xMin - bbox.xMax ) / 2; + +- /* grid-fit them if necessary */ +- if ( IS_HINTED( loader->load_flags ) ) +- { +- left = FT_PIX_FLOOR( left ); +- top = FT_PIX_CEIL( top ); +- advance = FT_PIX_ROUND( advance ); +- } +- + glyph->metrics.vertBearingX = left; + glyph->metrics.vertBearingY = top; + glyph->metrics.vertAdvance = advance; +@@ -1889,6 +1867,9 @@ + /* set glyph dimensions */ + glyph->metrics.width = bbox.xMax - bbox.xMin; + glyph->metrics.height = bbox.yMax - bbox.yMin; ++ ++ if ( IS_HINTED( loader->load_flags ) ) ++ ft_glyphslot_grid_fit_metrics( glyph ); + + return 0; + } +Index: src/truetype/ttobjs.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/truetype/ttobjs.c,v +retrieving revision 1.90 +retrieving revision 1.91 +diff -u -p -r1.90 -r1.91 +--- freetype2/src/truetype/ttobjs.c 1 Mar 2005 02:13:50 -0000 1.90 ++++ freetype2/src/truetype/ttobjs.c 31 Jul 2005 11:41:54 -0000 1.91 +@@ -121,19 +121,21 @@ + FT_Error error; + + +- if ( maxPoints > 0 ) +- maxPoints += 2; +- + FT_MEM_ZERO( zone, sizeof ( *zone ) ); + zone->memory = memory; + +- if ( FT_NEW_ARRAY( zone->org, maxPoints * 2 ) || +- FT_NEW_ARRAY( zone->cur, maxPoints * 2 ) || +- FT_NEW_ARRAY( zone->tags, maxPoints ) || +- FT_NEW_ARRAY( zone->contours, maxContours ) ) ++ if ( FT_NEW_ARRAY( zone->org, maxPoints ) || ++ FT_NEW_ARRAY( zone->cur, maxPoints ) || ++ FT_NEW_ARRAY( zone->tags, maxPoints ) || ++ FT_NEW_ARRAY( zone->contours, maxContours ) ) + { + tt_glyphzone_done( zone ); + } ++ else ++ { ++ zone->max_points = maxPoints; ++ zone->max_contours = maxContours; ++ } + + return error; + } +@@ -318,6 +320,162 @@ + /* */ + /*************************************************************************/ + ++#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++ /*************************************************************************/ ++ /* */ ++ /* */ ++ /* tt_size_run_fpgm */ ++ /* */ ++ /* */ ++ /* Run the font program */ ++ /* */ ++ /* */ ++ /* size :: A handle to the size object. */ ++ /* */ ++ /* */ ++ /* FreeType error code. 0 means success. */ ++ /* */ ++ FT_LOCAL_DEF( FT_Error ) ++ tt_size_run_fpgm( TT_Size size ) ++ { ++ TT_Face face = (TT_Face)size->root.face; ++ TT_ExecContext exec; ++ FT_Error error; ++ ++ ++ /* debugging instances have their own context */ ++ if ( size->debug ) ++ exec = size->context; ++ else ++ exec = TT_New_Context( face ); ++ ++ if ( !exec ) ++ return TT_Err_Could_Not_Find_Context; ++ ++ TT_Load_Context( exec, face, size ); ++ ++ exec->callTop = 0; ++ exec->top = 0; ++ ++ exec->period = 64; ++ exec->phase = 0; ++ exec->threshold = 0; ++ ++ exec->instruction_trap = FALSE; ++ exec->F_dot_P = 0x10000L; ++ ++ { ++ FT_Size_Metrics* metrics = &exec->metrics; ++ TT_Size_Metrics* tt_metrics = &exec->tt_metrics; ++ ++ ++ metrics->x_ppem = 0; ++ metrics->y_ppem = 0; ++ metrics->x_scale = 0; ++ metrics->y_scale = 0; ++ ++ tt_metrics->ppem = 0; ++ tt_metrics->scale = 0; ++ tt_metrics->ratio = 0x10000L; ++ } ++ ++ /* allow font program execution */ ++ TT_Set_CodeRange( exec, ++ tt_coderange_font, ++ face->font_program, ++ face->font_program_size ); ++ ++ /* disable CVT and glyph programs coderange */ ++ TT_Clear_CodeRange( exec, tt_coderange_cvt ); ++ TT_Clear_CodeRange( exec, tt_coderange_glyph ); ++ ++ if ( face->font_program_size > 0 ) ++ { ++ error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); ++ ++ if ( !error ) ++ error = face->interpreter( exec ); ++ } ++ else ++ error = TT_Err_Ok; ++ ++ if ( !error ) ++ TT_Save_Context( exec, size ); ++ ++ if ( !size->debug ) ++ TT_Done_Context( exec ); ++ ++ return error; ++ } ++ ++ ++ /*************************************************************************/ ++ /* */ ++ /* */ ++ /* tt_size_run_prep */ ++ /* */ ++ /* */ ++ /* Run the control value program */ ++ /* */ ++ /* */ ++ /* size :: A handle to the size object. */ ++ /* */ ++ /* */ ++ /* FreeType error code. 0 means success. */ ++ /* */ ++ FT_LOCAL_DEF( FT_Error ) ++ tt_size_run_prep( TT_Size size ) ++ { ++ TT_Face face = (TT_Face)size->root.face; ++ TT_ExecContext exec; ++ FT_Error error; ++ ++ ++ /* debugging instances have their own context */ ++ if ( size->debug ) ++ exec = size->context; ++ else ++ exec = TT_New_Context( face ); ++ ++ if ( !exec ) ++ return TT_Err_Could_Not_Find_Context; ++ ++ TT_Load_Context( exec, face, size ); ++ ++ exec->callTop = 0; ++ exec->top = 0; ++ ++ exec->instruction_trap = FALSE; ++ ++ TT_Set_CodeRange( exec, ++ tt_coderange_cvt, ++ face->cvt_program, ++ face->cvt_program_size ); ++ ++ TT_Clear_CodeRange( exec, tt_coderange_glyph ); ++ ++ if ( face->cvt_program_size > 0 ) ++ { ++ error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); ++ ++ if ( !error && !size->debug ) ++ error = face->interpreter( exec ); ++ } ++ else ++ error = TT_Err_Ok; ++ ++ /* save as default graphics state */ ++ size->GS = exec->GS; ++ ++ TT_Save_Context( exec, size ); ++ ++ if ( !size->debug ) ++ TT_Done_Context( exec ); ++ ++ return error; ++ } ++#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ ++ + + /*************************************************************************/ + /* */ +@@ -338,15 +496,11 @@ + { + TT_Size size = (TT_Size)ttsize; + FT_Error error = TT_Err_Ok; +- +- + #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +- + TT_Face face = (TT_Face)size->root.face; + FT_Memory memory = face->root.memory; + FT_Int i; + +- TT_ExecContext exec; + FT_UShort n_twilight; + TT_MaxProfile* maxp = &face->max_profile; + +@@ -387,17 +541,30 @@ + FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || + FT_NEW_ARRAY( size->cvt, size->cvt_size ) || + FT_NEW_ARRAY( size->storage, size->storage_size ) ) ++ { ++ tt_size_done( ttsize ); + +- goto Fail_Memory; ++ return error; ++ } + + /* reserve twilight zone */ + n_twilight = maxp->maxTwilightPoints; ++ ++ /* there are 4 phantom points (do we need this?) */ ++ n_twilight += 4; ++ + error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight ); + if ( error ) +- goto Fail_Memory; ++ { ++ tt_size_done( ttsize ); ++ ++ return error; ++ } + + size->twilight.n_points = n_twilight; + ++ size->GS = tt_default_graphics_state; ++ + /* set `face->interpreter' according to the debug hook present */ + { + FT_Library library = face->root.driver->root.library; +@@ -409,95 +576,17 @@ + face->interpreter = (TT_Interpreter)TT_RunIns; + } + +- /* Fine, now execute the font program! */ +- exec = size->context; +- /* size objects used during debugging have their own context */ +- if ( !size->debug ) +- exec = TT_New_Context( face ); +- +- if ( !exec ) +- { +- error = TT_Err_Could_Not_Find_Context; +- goto Fail_Memory; +- } +- +- size->GS = tt_default_graphics_state; +- TT_Load_Context( exec, face, size ); +- +- exec->callTop = 0; +- exec->top = 0; +- +- exec->period = 64; +- exec->phase = 0; +- exec->threshold = 0; +- +- { +- FT_Size_Metrics* metrics = &exec->metrics; +- TT_Size_Metrics* tt_metrics = &exec->tt_metrics; +- +- +- metrics->x_ppem = 0; +- metrics->y_ppem = 0; +- metrics->x_scale = 0; +- metrics->y_scale = 0; +- +- tt_metrics->ppem = 0; +- tt_metrics->scale = 0; +- tt_metrics->ratio = 0x10000L; +- } ++ /* Fine, now run the font program! */ ++ error = tt_size_run_fpgm( size ); + +- exec->instruction_trap = FALSE; +- +- exec->cvtSize = size->cvt_size; +- exec->cvt = size->cvt; +- +- exec->F_dot_P = 0x10000L; +- +- /* allow font program execution */ +- TT_Set_CodeRange( exec, +- tt_coderange_font, +- face->font_program, +- face->font_program_size ); +- +- /* disable CVT and glyph programs coderange */ +- TT_Clear_CodeRange( exec, tt_coderange_cvt ); +- TT_Clear_CodeRange( exec, tt_coderange_glyph ); +- +- if ( face->font_program_size > 0 ) +- { +- error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); +- if ( !error ) +- error = face->interpreter( exec ); +- +- if ( error ) +- goto Fail_Exec; +- } +- else +- error = TT_Err_Ok; +- +- TT_Save_Context( exec, size ); +- +- if ( !size->debug ) +- TT_Done_Context( exec ); ++ if ( error ) ++ tt_size_done( ttsize ); + + #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + size->ttmetrics.valid = FALSE; +- return error; +- +-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +- +- Fail_Exec: +- if ( !size->debug ) +- TT_Done_Context( exec ); +- +- Fail_Memory: + +- tt_size_done( ttsize ); + return error; +- +-#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ +- + } + + +@@ -516,9 +605,7 @@ + tt_size_done( FT_Size ttsize ) /* TT_Size */ + { + TT_Size size = (TT_Size)ttsize; +- + #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +- + FT_Memory memory = size->root.face->memory; + + +@@ -625,10 +712,8 @@ + #endif + + #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +- + { +- TT_ExecContext exec; +- FT_UInt i, j; ++ FT_UInt i; + + + /* Scale the cvt values to the new ppem. */ +@@ -637,12 +722,12 @@ + size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); + + /* All twilight points are originally zero */ +- for ( j = 0; j < (FT_UInt)size->twilight.n_points; j++ ) ++ for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ ) + { +- size->twilight.org[j].x = 0; +- size->twilight.org[j].y = 0; +- size->twilight.cur[j].x = 0; +- size->twilight.cur[j].y = 0; ++ size->twilight.org[i].x = 0; ++ size->twilight.org[i].y = 0; ++ size->twilight.cur[i].x = 0; ++ size->twilight.cur[i].y = 0; + } + + /* clear storage area */ +@@ -651,53 +736,8 @@ + + size->GS = tt_default_graphics_state; + +- /* get execution context and run prep program */ +- if ( size->debug ) +- exec = size->context; +- else +- exec = TT_New_Context( face ); +- /* debugging instances have their own context */ +- +- if ( !exec ) +- return TT_Err_Could_Not_Find_Context; +- +- TT_Load_Context( exec, face, size ); +- +- TT_Set_CodeRange( exec, +- tt_coderange_cvt, +- face->cvt_program, +- face->cvt_program_size ); +- +- TT_Clear_CodeRange( exec, tt_coderange_glyph ); +- +- exec->instruction_trap = FALSE; +- +- exec->top = 0; +- exec->callTop = 0; +- +- if ( face->cvt_program_size > 0 ) +- { +- error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); +- if ( error ) +- goto End; +- +- if ( !size->debug ) +- error = face->interpreter( exec ); +- } +- else +- error = TT_Err_Ok; +- +- size->GS = exec->GS; +- /* save default graphics state */ +- +- End: +- TT_Save_Context( exec, size ); +- +- if ( !size->debug ) +- TT_Done_Context( exec ); +- /* debugging instances keep their context */ ++ error = tt_size_run_prep( size ); + } +- + #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + if ( !error ) +Index: src/truetype/ttobjs.h +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/truetype/ttobjs.h,v +retrieving revision 1.36 +retrieving revision 1.38 +diff -u -p -r1.36 -r1.38 +--- freetype2/src/truetype/ttobjs.h 4 May 2004 16:53:45 -0000 1.36 ++++ freetype2/src/truetype/ttobjs.h 31 Jul 2005 11:41:54 -0000 1.38 +@@ -316,7 +316,10 @@ FT_BEGIN_HEADER + { + FT_SizeRec root; + +- FT_Size_Metrics metrics; /* slightly different from the root metrics */ ++ /* we have our own copy of metrics so that we can modify */ ++ /* it without affecting auto-hinting (when used) */ ++ FT_Size_Metrics metrics; ++ + TT_Size_Metrics ttmetrics; + + #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +@@ -413,6 +416,14 @@ FT_BEGIN_HEADER + + FT_LOCAL( void ) + tt_size_done( FT_Size ttsize ); /* TT_Size */ ++ ++#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++ FT_LOCAL( FT_Error ) ++ tt_size_run_fpgm( TT_Size size ); ++ ++ FT_LOCAL( FT_Error ) ++ tt_size_run_prep( TT_Size size ); ++#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + FT_LOCAL( FT_Error ) + tt_size_reset( TT_Size size ); +Index: src/type1/t1gload.c +=================================================================== +RCS file: /cvsroot/freetype/freetype2/src/type1/t1gload.c,v +retrieving revision 1.85 +retrieving revision 1.87 +diff -u -p -r1.85 -r1.87 +--- freetype2/src/type1/t1gload.c 13 May 2004 12:59:59 -0000 1.85 ++++ freetype2/src/type1/t1gload.c 23 Jun 2005 20:31:48 -0000 1.87 +@@ -315,11 +315,7 @@ + glyph->root.linearHoriAdvance = decoder.builder.advance.x; + glyph->root.internal->glyph_transformed = 0; + +- /* make up vertical metrics */ +- metrics->vertBearingX = 0; +- metrics->vertBearingY = 0; +- metrics->vertAdvance = 0; +- ++ metrics->vertAdvance = 0; + glyph->root.linearVertAdvance = 0; + + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; +@@ -363,42 +359,26 @@ + vec->y = FT_MulFix( vec->y, y_scale ); + } + +- FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); +- + /* Then scale the metrics */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); +- +- metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale ); +- metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale ); +- +- if ( hinting ) +- { +- metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); +- metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); +- +- metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); +- metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); +- } + } + + /* compute the other metrics */ + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); + +- /* grid fit the bounding box if necessary */ +- if ( hinting ) +- { +- cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); +- cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); +- cbox.xMax = FT_PIX_CEIL( cbox.xMax ); +- cbox.yMax = FT_PIX_CEIL( cbox.yMax ); +- } +- + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax; ++ ++ /* make up vertical ones */ ++ metrics->vertBearingX = 0; ++ metrics->vertBearingY = 0; ++ ++ if ( hinting ) ++ ft_glyphslot_grid_fit_metrics( &glyph->root ); + } + + /* Set control data to the glyph charstrings. Note that this is */ --- freetype-2.1.10.orig/debian/patches/030-bytecode-interpreter.diff +++ freetype-2.1.10/debian/patches/030-bytecode-interpreter.diff @@ -0,0 +1,11 @@ +--- freetype-2.1.10.orig/include/freetype/config/ftoption.h 2005-06-06 16:37:53.000000000 +0100 ++++ freetype-2.1.10/include/freetype/config/ftoption.h 2005-06-12 23:30:14.000000000 +0100 +@@ -436,7 +436,7 @@ + /* Do not #undef this macro here, since the build system might */ + /* define it for certain configurations only. */ + /* */ +-/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ ++#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + /*************************************************************************/ --- freetype-2.1.10.orig/debian/patches/004-freetype-2.1.7-ttgload-monospace-halfwidth.diff +++ freetype-2.1.10/debian/patches/004-freetype-2.1.7-ttgload-monospace-halfwidth.diff @@ -0,0 +1,18 @@ +diff -u freetype-2.1.9~/src/truetype/ttgload.c freetype-2.1.9/src/truetype/ttgload.c +--- freetype-2.1.9~/src/truetype/ttgload.c 2004-06-21 22:16:56.000000000 +0100 ++++ freetype-2.1.9/src/truetype/ttgload.c 2005-05-28 14:56:14.391524752 +0100 +@@ -142,7 +142,12 @@ + TT_Get_Metrics( &face->horizontal, idx, lsb, aw ); + + if ( check && face->postscript.isFixedPitch ) +- *aw = face->horizontal.advance_Width_Max; ++ { ++ if ( *aw > face->horizontal.advance_Width_Max * 0.55 || *aw == 0 ) ++ *aw = face->horizontal.advance_Width_Max; ++ else ++ *aw = face->horizontal.advance_Width_Max >> 1; ++ } + } + + +Only in freetype-2.1.9/src/truetype/: ttgload.c.orig --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-fixkerning.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-fixkerning.patch @@ -0,0 +1,14 @@ +--- freetype-2.1.10/src/sfnt/sfobjs.c.kerning 2005-09-13 14:33:28.000000000 +0200 ++++ freetype-2.1.10/src/sfnt/sfobjs.c 2005-09-13 14:33:47.000000000 +0200 +@@ -555,11 +555,9 @@ + if ( face->vertical_info ) + flags |= FT_FACE_FLAG_VERTICAL; + +-#if 0 + /* kerning available ? */ + if ( TT_FACE_HAS_KERNING( face ) ) + flags |= FT_FACE_FLAG_KERNING; +-#endif + + #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + /* Don't bother to load the tables unless somebody asks for them. */ --- freetype-2.1.10.orig/debian/patches/050-autohint-rounding.diff +++ freetype-2.1.10/debian/patches/050-autohint-rounding.diff @@ -0,0 +1,68 @@ +--- freetype2~/src/base/ftobjs.c 2003-03-21 19:27:54.000000000 +0800 ++++ freetype2/src/base/ftobjs.c 2003-03-23 01:11:55.000000000 +0800 +@@ -1394,6 +1394,11 @@ + FT_Error error = FT_Err_Ok; + FT_Driver driver; + FT_Driver_Class clazz; ++#ifdef FT_CONFIG_CHESTER_BLUE_SCALE ++ FT_Library library; ++ FT_Bool autohint; ++ FT_Module hinter; ++#endif + FT_Size_Metrics* metrics; + FT_Long dim_x, dim_y; + +@@ -1427,17 +1432,45 @@ + + /* Compute pixel sizes in 26.6 units */ + #ifdef FT_CONFIG_CHESTER_BLUE_SCALE +- dim_x = ( char_width * horz_resolution ) / 72; +- dim_y = ( char_height * vert_resolution ) / 72; ++ library = driver->root.library; ++ hinter - library->auto_hinter; ++ autohint = ++ FT_BOOL( hinter && ++ !( load_flags & ( FT_LOAD_NO_SCALE | ++ FT_LOAD_NO_RECURSE | ++ FT_LOAD_NO_HINTING | ++ FT_LOAD_NO_AUTOHINT ) ) && ++ FT_DRIVER_IS_SCALABLE( driver ) && ++ FT_DRIVER_USES_OUTLINES( driver ) ); ++ if ( autohint ) ++ { ++ if ( FT_DRIVER_HAS_HINTER( driver ) && ++ !( load_flags & FT_LOAD_FORCE_AUTOHINT ) ) ++ autohint = 0; ++ } ++ ++ if ( autohint ) ++ { ++ dim_x = ( char_width * horz_resolution + 36 ) / 72; /* round div */ ++ dim_y = ( char_height * vert_resolution + 36 ) / 72; /* round div */ ++ ++ metrics->x_ppem = (FT_UShort)( (dim_x+32) >> 6 ); /* round div */ ++ metrics->y_ppem = (FT_UShort)( (dim_y+32) >> 6 ); /* round div */ ++ } ++ else ++ { ++ dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ ++ dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ + +- metrics->x_ppem = (FT_UShort)( (dim_x+32) >> 6 ); +- metrics->y_ppem = (FT_UShort)( (dim_y+32) >> 6 ); ++ metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); /* floor div, already rounded */ ++ metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); /* floor div, already rounded */ ++ } + #else +- dim_x = ( ( ( char_width * horz_resolution ) / 72 ) + 32 ) & -64; +- dim_y = ( ( ( char_height * vert_resolution ) / 72 ) + 32 ) & -64; ++ dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ ++ dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ + +- metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); +- metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); ++ metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); /* floor div, already rounded */ ++ metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); /* floor div, already rounded */ + #endif + + metrics->x_scale = 0x10000L; --- freetype-2.1.10.orig/debian/patches/090-freetype-2.1.7-normalize-fix.diff +++ freetype-2.1.10/debian/patches/090-freetype-2.1.7-normalize-fix.diff @@ -0,0 +1,30 @@ +diff -u freetype-2.1.9~/src/truetype/ttinterp.c freetype-2.1.9/src/truetype/ttinterp.c +--- freetype-2.1.9~/src/truetype/ttinterp.c 2004-03-05 09:26:22.000000000 +0000 ++++ freetype-2.1.9/src/truetype/ttinterp.c 2005-05-28 15:07:26.317376496 +0100 +@@ -2474,7 +2474,7 @@ + W = Vx * Vx + Vy * Vy; + + /* Now, we want that Sqrt( W ) = 0x4000 */ +- /* Or 0x1000000 <= W < 0x1004000 */ ++ /* Or 0x10000000 <= W < 0x10004000 */ + + if ( Vx < 0 ) + { +@@ -2492,7 +2492,7 @@ + else + S2 = FALSE; + +- while ( W < 0x1000000L ) ++ while ( W < 0x10000000L ) + { + /* We need to increase W by a minimal amount */ + if ( Vx < Vy ) +@@ -2503,7 +2503,7 @@ + W = Vx * Vx + Vy * Vy; + } + +- while ( W >= 0x1004000L ) ++ while ( W >= 0x10004000L ) + { + /* We need to decrease W by a minimal amount */ + if ( Vx < Vy ) --- freetype-2.1.10.orig/debian/patches/401-odd_blue_num-safe_alloc.patch +++ freetype-2.1.10/debian/patches/401-odd_blue_num-safe_alloc.patch @@ -0,0 +1,110 @@ +diff -Nurp freetype-2.1.10/src/base/ftutil.c freetype-2.1.10.new/src/base/ftutil.c +--- freetype-2.1.10/src/base/ftutil.c 2005-03-03 23:59:06.000000000 +0100 ++++ freetype-2.1.10.new/src/base/ftutil.c 2006-05-30 17:05:10.000000000 +0200 +@@ -67,6 +67,11 @@ + } + FT_MEM_ZERO( *P, size ); + } ++ else if ( size < 0 ) ++ { ++ /* may help catch/prevent nasty security issues */ ++ return FT_Err_Invalid_Argument; ++ } + else + *P = NULL; + +@@ -99,6 +104,11 @@ + return FT_Err_Out_Of_Memory; + } + } ++ else if (size < 0) ++ { ++ /* may help catch/prevent security issues */ ++ return FT_Err_Invalid_Argument; ++ } + else + *P = NULL; + +@@ -127,6 +137,11 @@ + if ( !*P ) + return FT_Alloc( memory, size, P ); + ++ if ( size < 0 || current < 0 ) ++ { ++ return FT_Err_Invalid_Argument; ++ } ++ + /* if the new block if zero-sized, clear the current one */ + if ( size <= 0 ) + { +@@ -169,6 +184,11 @@ + if ( !*P ) + return FT_QAlloc( memory, size, P ); + ++ if ( size < 0 || current < 0 ) ++ { ++ return FT_Err_Invalid_Argument; ++ } ++ + /* if the new block if zero-sized, clear the current one */ + if ( size <= 0 ) + { +--- freetype-2.1.10/src/cache/ftccache.c 2005-05-23 23:24:16.000000000 +0200 ++++ freetype-2.1.10.new/src/cache/ftccache.c 2006-05-30 16:35:46.000000000 +0200 +@@ -246,7 +246,8 @@ + + + /* remove a node from the cache manager */ +- FT_EXPORT_DEF( void ) ++ /* this function is FT_BASE since it may be called by old rogue clients */ ++ FT_BASE_DEF( void ) + ftc_node_destroy( FTC_Node node, + FTC_Manager manager ) + { +diff -Nurp freetype-2.1.10/src/cff/cffload.c freetype-2.1.10.new/src/cff/cffload.c +--- freetype-2.1.10/src/cff/cffload.c 2005-05-06 07:49:46.000000000 +0200 ++++ freetype-2.1.10.new/src/cff/cffload.c 2006-05-30 16:28:56.000000000 +0200 +@@ -1235,7 +1235,7 @@ + } + + /* access element */ +- if ( off1 ) ++ if ( off1 && off2 > off1 ) + { + *pbyte_len = off2 - off1; + +@@ -2040,6 +2040,9 @@ + FT_FRAME_EXIT(); + if ( error ) + goto Exit; ++ ++ /* ensure that 'num_blue_values' is even */ ++ priv->num_blue_values &= ~1; + } + + /* read the local subrs, if any */ +diff -Nurp freetype-2.1.10/src/pshinter/pshglob.c freetype-2.1.10.new/src/pshinter/pshglob.c +--- freetype-2.1.10/src/pshinter/pshglob.c 2004-04-02 09:13:53.000000000 +0200 ++++ freetype-2.1.10.new/src/pshinter/pshglob.c 2006-05-30 16:28:56.000000000 +0200 +@@ -150,7 +150,7 @@ + FT_UNUSED( target ); + + +- for ( ; read_count > 0; read_count -= 2 ) ++ for ( ; read_count > 1; read_count -= 2 ) + { + FT_Int reference, delta; + FT_UInt count; +diff -Nurp freetype-2.1.10/src/type1/t1load.c freetype-2.1.10.new/src/type1/t1load.c +--- freetype-2.1.10/src/type1/t1load.c 2005-04-14 13:39:28.000000000 +0200 ++++ freetype-2.1.10.new/src/type1/t1load.c 2006-05-30 16:28:56.000000000 +0200 +@@ -1989,6 +1989,9 @@ + keyword_flags ); + if ( error ) + goto Exit; ++ ++ /* ensure even-ness of 'num_blue_values' */ ++ priv->num_blue_values &= ~1; + + #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + --- freetype-2.1.10.orig/debian/patches/012-freetype-2.1.7-autohint-cjkfonts-20031130.diff +++ freetype-2.1.10/debian/patches/012-freetype-2.1.7-autohint-cjkfonts-20031130.diff @@ -0,0 +1,2319 @@ +diff -u freetype-2.1.7-orig/src/autohint/ahglobal.c freetype-2.1.7/src/autohint/ahglobal.c +--- freetype-2.1.7-orig/src/autohint/ahglobal.c Thu Oct 16 07:20:56 2003 ++++ freetype-2.1.7/src/autohint/ahglobal.c Sat Nov 29 08:37:15 2003 +@@ -30,7 +30,7 @@ + /* cf. AH_BLUE_XXX constants in ahtypes.h */ + + static +- const char* const blue_chars[AH_BLUE_MAX] = ++ const char* const blue_chars_latin[AH_BLUE_MAX] = + { + "THEZOCQS", + "HEZLOCUS", +@@ -43,6 +43,35 @@ + }; + + ++ typedef struct AH_BlueTable_ ++ { ++ FT_ULong offset_blue_chars; ++ const char** blue_chars; ++ FT_ULong char_for_widths; ++ ++ } AH_BlueTable; ++ ++ ++ static const AH_BlueTable blue_table[AH_CHAR_TYPE_COUNT] = ++ { ++ { 0, blue_chars_latin, (FT_ULong)'o' }, ++ { 0xFEE0L, blue_chars_latin, 0xFF4FL }, ++ { 0, 0, 0 }, ++ { 0, 0, 0 } ++ }; ++ ++ ++#ifdef AH_DEBUG ++ static const char* const blue_names[AH_CHAR_TYPE_COUNT] = ++ { ++ "general latinate chars", ++ "CJK fullwidth latin chars", ++ 0, ++ 0 ++ }; ++#endif ++ ++ + /* simple insertion sort */ + static void + sort_values( FT_Int count, +@@ -71,7 +100,7 @@ + ah_hinter_compute_blues( AH_Hinter hinter ) + { + AH_Blue blue; +- AH_Globals globals = &hinter->globals->design; ++ AH_Globals globals = hinter->globals->designs; + FT_Pos flats [MAX_TEST_CHARACTERS]; + FT_Pos rounds[MAX_TEST_CHARACTERS]; + FT_Int num_flats; +@@ -81,6 +110,9 @@ + FT_GlyphSlot glyph; + FT_Error error; + FT_CharMap charmap; ++ FT_ULong offset; ++ FT_Byte type; ++ const char** blue_chars; + + + face = hinter->face; +@@ -97,8 +129,19 @@ + /* we compute the blues simply by loading each character from the */ + /* 'blue_chars[blues]' string, then compute its top-most or */ + /* bottom-most points (depending on `AH_IS_TOP_BLUE') */ ++ type = AH_CHAR_TYPE_LATINATE; + +- AH_LOG(( "blue zones computation\n" )); ++ Compute_Blues: ++ globals->has_blues = FALSE; ++ globals->baseline = 0; ++ ++ offset = blue_table[type].offset_blue_chars; ++ blue_chars = blue_table[type].blue_chars; ++ ++ if ( !blue_chars ) ++ goto Next_Type; ++ ++ AH_LOG(( "blue zones computation for %s\n", blue_names[type] )); + AH_LOG(( "------------------------------------------------\n" )); + + for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) +@@ -131,7 +174,7 @@ + AH_LOG(( "`%c'", *p )); + + /* load the character in the face -- skip unknown or empty ones */ +- glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p ); ++ glyph_index = FT_Get_Char_Index( face, offset + (FT_ULong)*p ); + if ( glyph_index == 0 ) + continue; + +@@ -221,10 +264,30 @@ + + } while ( next != idx ); + +- /* 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 ); ++ /* now, set the `round' flag depending on whether there exists */ ++ /* a extremum line segment within the current zone. */ ++ round = TRUE; ++ ++ { ++ FT_Int n = 0, p = prev; ++ FT_Bool is_top = AH_IS_TOP_BLUE( blue ); ++ ++ ++ while ( ( p = ( p >= last )? first : p + 1 ) != next ) ++ { ++ if ( FT_CURVE_TAG( glyph->outline.tags[p] ) == FT_CURVE_TAG_ON ) ++ { ++ if ( ( is_top && points[p].y < extremum->y ) || ++ ( !is_top && points[p].y > extremum->y ) ) ++ break; ++ ++ n++; ++ } ++ } ++ ++ if ( n >= 2 && p == next ) ++ round = FALSE; ++ } + + AH_LOG(( "%c ", round ? 'r' : 'f' )); + } +@@ -281,6 +344,30 @@ + } + + AH_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot )); ++ ++ if ( num_flats > 0 || num_rounds > 0 ) ++ globals->has_blues = TRUE; ++ } ++ ++ globals->baseline = globals->blue_refs[AH_BLUE_SMALL_BOTTOM]; ++ ++ if ( globals->baseline > -10000 ) ++ { ++ for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) ++ { ++ if ( globals->blue_refs[blue] > -10000 ) ++ { ++ globals->blue_refs[blue] -= globals->baseline; ++ globals->blue_shoots[blue] -= globals->baseline; ++ } ++ } ++ } ++ ++ Next_Type: ++ if ( ++type < AH_CHAR_TYPE_COUNT ) ++ { ++ globals++; ++ goto Compute_Blues; + } + + /* reset original face charmap */ +@@ -299,13 +386,23 @@ + AH_Outline outline = hinter->glyph; + AH_Segment segments; + AH_Segment limit; +- AH_Globals globals = &hinter->globals->design; ++ AH_Globals globals = hinter->globals->designs; + FT_Pos* widths; + FT_Int dimension; + FT_Int* p_num_widths; + FT_Error error = 0; + FT_Pos edge_distance_threshold = 32000; ++ FT_Byte type; ++ FT_ULong char_for_widths; ++ ++ ++ type = AH_CHAR_TYPE_LATINATE; + ++ Compute_Widths: ++ char_for_widths = blue_table[type].char_for_widths; ++ ++ if ( !char_for_widths ) ++ goto Next_Type; + + globals->num_widths = 0; + globals->num_heights = 0; +@@ -318,18 +415,18 @@ + FT_UInt glyph_index; + + +- glyph_index = FT_Get_Char_Index( hinter->face, 'o' ); ++ glyph_index = FT_Get_Char_Index( hinter->face, char_for_widths ); + if ( glyph_index == 0 ) +- return 0; ++ goto Next_Type; + + error = FT_Load_Glyph( hinter->face, glyph_index, FT_LOAD_NO_SCALE ); + if ( error ) +- goto Exit; ++ goto Next_Type; + + error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, + hinter->face ); + if ( error ) +- goto Exit; ++ goto Next_Type; + + ah_outline_compute_segments( hinter->glyph ); + ah_outline_link_segments( hinter->glyph ); +@@ -378,6 +475,13 @@ + p_num_widths = &globals->num_widths; + } + ++ Next_Type: ++ if ( type++ < AH_CHAR_TYPE_COUNT ) ++ { ++ globals++; ++ goto Compute_Widths; ++ } ++ + /* Now, compute the edge distance threshold as a fraction of the */ + /* smallest width in the font. Set it in `hinter->glyph' too! */ + if ( edge_distance_threshold == 32000 ) +@@ -386,8 +490,7 @@ + /* let's try 20% */ + hinter->glyph->edge_distance_threshold = edge_distance_threshold / 5; + +- Exit: +- return error; ++ return 0; + } + + +@@ -396,6 +499,192 @@ + { + return ah_hinter_compute_widths( hinter ) || + ah_hinter_compute_blues ( hinter ); ++ } ++ ++ ++ static const AH_CharType ++ ah_types_for_unicode[] = ++ { ++ /* Latin, Greek, Cyrillic */ ++ { AH_CHAR_TYPE_LATINATE, 0x21L, 0x52FL }, ++ ++ /* Hebrew */ ++ { AH_CHAR_TYPE_LATINATE, 0x5D0L, 0x600L }, ++ ++ /* Latin, Greek */ ++ { AH_CHAR_TYPE_LATINATE, 0x1E00L, 0x2000L }, ++ ++ /* CJK fullwidth Latin */ ++ { AH_CHAR_TYPE_LATIN_FULLWIDTH, 0xFF00L, 0xFF60L } ++ }; ++ ++ ++ static const AH_CharTypeTable ++ ah_types_table_unicode = ++ { ++ sizeof( ah_types_for_unicode ) / sizeof( AH_CharType ), ++ (AH_CharType *)ah_types_for_unicode ++ }; ++ ++ ++ FT_LOCAL_DEF( void ) ++ ah_hinter_compute_char_table( AH_Hinter hinter ) ++ { ++ FT_Memory memory = hinter->memory; ++ FT_Face face = hinter->face; ++ AH_CharTypeTable* table = hinter->globals->table; ++ FT_ULong num_glyphs = face->num_glyphs; ++ FT_Byte* types; ++ FT_Error error; ++ FT_CharMap charmap; ++ ++ ++ if ( table ) ++ return; ++ ++ if ( num_glyphs <= 0 ) ++ return; ++ ++ if ( FT_NEW_ARRAY( types, num_glyphs ) ) ++ return; ++ ++ FT_MEM_SET( types, AH_CHAR_TYPE_OTHER, num_glyphs ); ++ ++ charmap = face->charmap; ++ if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) ++ goto Exit; ++ ++ ++ { ++ FT_Bool empty = TRUE; ++ FT_ULong i; ++ ++ ++ for ( i = 0; i < ah_types_table_unicode.size; i++ ) ++ { ++ FT_UInt glyph_index; ++ FT_ULong start = ah_types_table_unicode.types[i].start; ++ FT_ULong last = ah_types_table_unicode.types[i].last; ++ FT_Byte type = ah_types_table_unicode.types[i].type; ++ FT_ULong ucs = FT_Get_Next_Char( face, start - 1, &glyph_index ); ++ ++ ++ while ( ucs && ucs <= last ) ++ { ++ if ( glyph_index < num_glyphs ) ++ { ++ empty = FALSE; ++ types[glyph_index] = type; ++ } ++ ++ ucs = FT_Get_Next_Char( face, ucs, &glyph_index ); ++ } ++ } ++ ++ if ( empty ) ++ goto Exit; ++ } ++ ++ ++ { ++ FT_Byte* cur = types; ++ FT_Byte* last = types + num_glyphs - 1; ++ FT_Byte type = AH_CHAR_TYPE_OTHER; ++ FT_ULong num = 0; ++ FT_ULong alloc_size; ++ ++ ++ while ( ++cur <= last ) ++ { ++ if ( *cur != type ) ++ { ++ type = *cur; ++ ++ if ( type < AH_CHAR_TYPE_OTHER ) ++ num++; ++ } ++ } ++ ++ alloc_size = sizeof( AH_CharTypeTable ) + num * sizeof( AH_CharType ); ++ if ( FT_ALLOC( table, alloc_size ) ) ++ goto Exit; ++ ++ table->size = num; ++ table->types = (AH_CharType *)( table + 1 ); ++ } ++ ++ ++ { ++ FT_Byte* cur = types + 1; ++ FT_Byte* last = types + face->num_glyphs - 1; ++ FT_Byte type = AH_CHAR_TYPE_OTHER; ++ FT_ULong num = 0; ++ FT_ULong i; ++ ++ ++ for ( i = 1; cur <= last; i++, cur++ ) ++ { ++ if ( *cur != type ) ++ { ++ if ( type < AH_CHAR_TYPE_OTHER ) ++ table->types[num - 1].last = i - 1; ++ ++ type = *cur; ++ if ( type < AH_CHAR_TYPE_OTHER ) ++ { ++ table->types[num].type = type; ++ table->types[num++].start = i; ++ } ++ } ++ } ++ ++ if ( type < AH_CHAR_TYPE_OTHER ) ++ table->types[num - 1].last = i - 1; ++ } ++ ++ hinter->globals->table = table; ++ ++ Exit: ++ FT_Set_Charmap( face, charmap ); ++ FT_FREE( types ); ++ } ++ ++ ++ FT_LOCAL_DEF( FT_Byte ) ++ ah_hinter_get_char_type( AH_Hinter hinter, ++ FT_ULong glyph_index ) ++ { ++ AH_CharTypeTable* table = hinter->globals->table; ++ ++ ++ if ( table && table->size > 0 && glyph_index ) ++ { ++ AH_CharType* cur; ++ AH_CharType* types = table->types; ++ FT_ULong min = 0; ++ FT_ULong max = table->size - 1; ++ FT_ULong mid; ++ ++ ++ if ( glyph_index < types[min].start || ++ glyph_index > types[max].last ) ++ return AH_CHAR_TYPE_OTHER; ++ ++ while ( min <= max ) ++ { ++ mid = ( min + max ) / 2; ++ cur = types + mid; ++ ++ if ( glyph_index < cur->start ) ++ max = mid - 1; ++ else if ( glyph_index > cur->last ) ++ min = mid + 1; ++ else ++ return cur->type; ++ } ++ } ++ ++ return AH_CHAR_TYPE_OTHER; + } + + +diff -u freetype-2.1.7-orig/src/autohint/ahglobal.h freetype-2.1.7/src/autohint/ahglobal.h +--- freetype-2.1.7-orig/src/autohint/ahglobal.h Tue Apr 22 16:49:24 2003 ++++ freetype-2.1.7/src/autohint/ahglobal.h Sat Nov 29 08:24:42 2003 +@@ -51,6 +51,14 @@ + ah_hinter_compute_globals( AH_Hinter hinter ); + + ++ FT_LOCAL( void ) ++ ah_hinter_compute_char_table( AH_Hinter hinter ); ++ ++ ++ FT_LOCAL( FT_Byte ) ++ ah_hinter_get_char_type( AH_Hinter hinter, ++ FT_ULong glyph_index ); ++ + FT_END_HEADER + + #endif /* __AHGLOBAL_H__ */ +diff -u freetype-2.1.7-orig/src/autohint/ahglyph.c freetype-2.1.7/src/autohint/ahglyph.c +--- freetype-2.1.7-orig/src/autohint/ahglyph.c Wed May 28 14:52:05 2003 ++++ freetype-2.1.7/src/autohint/ahglyph.c Sat Nov 29 08:24:42 2003 +@@ -22,7 +22,6 @@ + + #include + #include "ahglyph.h" +-#include "ahangles.h" + #include "ahglobal.h" + #include "aherrors.h" + +@@ -52,11 +51,11 @@ + printf ( "Table of %s edges:\n", + !dimension ? "vertical" : "horizontal" ); + printf ( " [ index | pos | dir | link |" +- " serif | blue | opos | pos ]\n" ); ++ " serif | blue | opos | pos | diff ]\n" ); + + for ( edge = edges; edge < edge_limit; edge++ ) + { +- printf ( " [ %5d | %4d | %5s | %4d | %5d | %c | %5.2f | %5.2f ]\n", ++ printf ( " [ %5d | %4d | %5s | %4d | %6d | %c | %5.2f | %5.2f | %5.2f ]\n", + edge - edges, + (int)edge->fpos, + edge->dir == AH_DIR_UP +@@ -72,7 +71,8 @@ + edge->serif ? ( edge->serif - edges ) : -1, + edge->blue_edge ? 'y' : 'n', + edge->opos / 64.0, +- edge->pos / 64.0 ); ++ edge->pos / 64.0, ++ ( edge->pos - edge->opos ) / 64.0 ); + } + + edges = outline->vert_edges; +@@ -370,6 +370,12 @@ + char* tag = gloader->current.outline.tags; + + ++#ifdef AH_DEBUG ++ ah_dump_segments( outline ); ++ ah_dump_edges( outline ); ++ printf( "\n" ); ++ #endif ++ + /* we assume that the glyph loader has already been checked for storage */ + for ( ; point < point_limit; point++, vec++, tag++ ) + { +@@ -594,6 +600,7 @@ + + point->out_dir = ah_compute_direction( ovec.x, ovec.y ); + ++#if 0 + #ifndef AH_OPTION_NO_WEAK_INTERPOLATION + if ( point->flags & ( AH_FLAG_CONIC | AH_FLAG_CUBIC ) ) + { +@@ -624,6 +631,7 @@ + else if ( point->in_dir == -point->out_dir ) + goto Is_Weak_Point; + #endif ++#endif + } + } + } +@@ -709,6 +717,7 @@ + } + + ++#if 0 + /* compute all inflex points in a given glyph */ + static void + ah_outline_compute_inflections( AH_Outline outline ) +@@ -822,6 +831,54 @@ + ; + } + } ++#endif ++ ++ ++ /* compute all strong points in a given glyph */ ++ static void ++ ah_outline_compute_strongs( AH_Outline outline ) ++ { ++ AH_Point* contour = outline->contours; ++ AH_Point* contour_limit = contour + outline->num_contours; ++ ++ ++ /* load original coordinates in (u,v) */ ++ ah_setup_uv( outline, AH_UV_FXY ); ++ ++ for ( ; contour < contour_limit; contour++ ) ++ { ++ FT_Pos dx1, dx2, dy1, dy2; ++ AH_Point point = contour[0]; ++ AH_Point first = point; ++ AH_Point before; ++ AH_Point after; ++ ++ ++ after = point->next; ++ before = point->prev; ++ dx1 = point->u - before->u; ++ dy1 = point->v - before->v; ++ ++ do ++ { ++ dx2 = after->u - point->u; ++ dy2 = after->v - point->v; ++ ++ if ( dx1 == 0 || dx2 == 0 || ( dx1 ^ dx2 ) < 0 ) ++ point->flags |= AH_FLAG_STRONG_X; ++ ++ if ( dy1 == 0 || dy2 == 0 || ( dy1 ^ dy2 ) < 0 ) ++ point->flags |= AH_FLAG_STRONG_Y; ++ ++ before = point; ++ point = after; ++ after = after->next; ++ dx1 = dx2; ++ dy1 = dy2; ++ ++ } while ( point != first ); ++ } ++ } + + + FT_LOCAL_DEF( void ) +@@ -925,11 +982,34 @@ + segment->last = point; + segment->pos = ( min_pos + max_pos ) >> 1; + ++#if 0 + /* a segment is round if either its first or last point */ + /* is a control point */ + if ( ( segment->first->flags | point->flags ) & + AH_FLAG_CONTROL ) + segment->flags |= AH_EDGE_ROUND; ++#else ++ /* a segment is round if it doesn't have successive */ ++ /* on-curve points. */ ++ { ++ AH_Point pt = segment->first; ++ AH_Flags f0 = pt->flags & AH_FLAG_CONTROL; ++ AH_Flags f1; ++ ++ ++ for ( ; pt != point; f0 = f1 ) ++ { ++ pt = pt->next; ++ f1 = pt->flags & AH_FLAG_CONTROL; ++ ++ if ( !f0 && !f1 ) ++ break; ++ ++ if ( pt == point ) ++ segment->flags |= AH_EDGE_ROUND; ++ } ++ } ++#endif + + /* compute segment size */ + min_pos = max_pos = point->v; +@@ -972,7 +1052,10 @@ + segment->first = point; + segment->last = point; + segment->contour = contour; +- segment->score = 32000; ++ segment->score1 = 0x7FFFFFFFL; ++ segment->score2 = 0x7FFFFFFFL; ++ segment->length = 0; ++ segment->sign = 0; + segment->link = NULL; + on_edge = 1; + +@@ -1035,7 +1118,10 @@ + segment->first = min_point; + segment->last = min_point; + segment->pos = min_pos; +- segment->score = 32000; ++ segment->score1 = 0x7FFFFFFFL; ++ segment->score2 = 0x7FFFFFFFL; ++ segment->length = 0; ++ segment->sign = 0; + segment->link = NULL; + + num_segments++; +@@ -1053,7 +1139,10 @@ + segment->first = max_point; + segment->last = max_point; + segment->pos = max_pos; +- segment->score = 32000; ++ segment->score1 = 0x7FFFFFFFL; ++ segment->score2 = 0x7FFFFFFFL; ++ segment->length = 0; ++ segment->sign = 0; + segment->link = NULL; + + num_segments++; +@@ -1080,11 +1169,13 @@ + AH_Segment segment_limit; + AH_Direction major_dir; + int dimension; ++ FT_Pos score_limit; + + + segments = outline->horz_segments; + segment_limit = segments + outline->num_hsegments; + major_dir = outline->horz_major_dir; ++ score_limit = FT_DivFix( 64*3*9, outline->y_scale ); + + for ( dimension = 1; dimension >= 0; dimension-- ) + { +@@ -1203,20 +1294,28 @@ + max = seg2->max_coord; + + len = max - min; +- if ( len >= 8 ) ++ if ( len >= 4 ) + { +- score = dist + 3000 / len; ++ score = 8*dist; + +- if ( score < seg1->score ) ++ if ( score < seg1->score1 && ++ !( score > seg1->score2 && 4*len < seg1->length ) ) + { +- seg1->score = score; +- seg1->link = seg2; ++ seg1->score1 = 9*dist; ++ seg1->score2 = 7*dist; ++ seg1->length = len; ++ seg1->sign = -1; ++ seg1->link = seg2; + } + +- if ( score < seg2->score ) ++ if ( score < seg2->score1 && ++ !( score > seg2->score2 && 4*len < seg2->length ) ) + { +- seg2->score = score; +- seg2->link = seg1; ++ seg2->score1 = 9*dist; ++ seg2->score2 = 7*dist; ++ seg2->length = len; ++ seg2->sign = +1; ++ seg2->link = seg1; + } + } + } +@@ -1225,6 +1324,73 @@ + #endif /* 1 */ + + /* now, compute the `serif' segments */ ++ { ++ AH_Segment seg, link1, link2; ++ FT_Pos pos1, pos2; ++ ++ ++ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) ++ { ++ if ( seg1->sign >= 0 || seg1->score1 >= score_limit ) ++ continue; ++ ++ link1 = seg1->link; ++ if ( link1->link != seg1 ) ++ continue; ++ ++ pos1 = seg1->pos; ++ pos2 = link1->pos; ++ ++ ++ for ( seg2 = segments; seg2 < segment_limit; seg2++ ) ++ { ++ if ( seg2->sign >= 0 || ++ seg2->score1 <= seg1->score1 || seg2->pos > pos1 ) ++ continue; ++ ++ link2 = seg2->link; ++ if ( link2->link != seg2 ) ++ continue; ++ ++ if ( link2->pos < pos2 || ++ seg1->score1*4 <= seg2->score1 ) ++ continue; ++ ++ /* seg2->pos < pos1 < pos2 < seg2->link->pos */ ++ ++ if ( seg1->length < seg2->length*2 ) ++ { ++ seg1->link = link1->link = 0; ++ seg1->sign = link1->sign = 0; ++ } ++ else ++ { ++ for ( seg = segments; seg < segment_limit; seg++ ) ++ { ++ AH_Segment link = seg->link; ++ ++ ++ if ( link == seg2 ) ++ { ++ seg->sign = 0; ++ seg->link = 0; ++ seg->serif = link1; ++ } ++ else if ( link == link2 ) ++ { ++ seg->sign = 0; ++ seg->link = 0; ++ seg->serif = seg1; ++ } ++ } ++ } ++ ++ break; ++ } ++ } ++ } ++ ++ + for ( seg1 = segments; seg1 < segment_limit; seg1++ ) + { + seg2 = seg1->link; +@@ -1234,8 +1400,13 @@ + seg2->num_linked++; + if ( seg2->link != seg1 ) + { +- seg1->link = 0; +- seg1->serif = seg2->link; ++ seg1->link = 0; ++ ++ if ( seg2->score1 < score_limit || ++ seg1->score1 < seg2->score1*4 ) ++ seg1->serif = seg2->link; ++ else ++ seg2->num_linked--; + } + } + } +@@ -1243,6 +1414,7 @@ + segments = outline->vert_segments; + segment_limit = segments + outline->num_vsegments; + major_dir = outline->vert_major_dir; ++ score_limit = FT_DivFix( 64*3*9, outline->x_scale ); + } + } + +@@ -1310,12 +1482,46 @@ + FT_Pos dist; + + ++ if ( edge->dir != seg->dir ) ++ continue; ++ + dist = seg->pos - edge->fpos; + if ( dist < 0 ) + dist = -dist; + + if ( dist < edge_distance_threshold ) + { ++ AH_Segment link = seg->link; ++ ++ ++ /* check if all linked segments of the candidate edge */ ++ /* can make a single edge. */ ++ if ( link ) ++ { ++ AH_Segment seg1 = edge->first; ++ AH_Segment link1; ++ ++ ++ do ++ { ++ link1 = seg1->link; ++ if ( link1 ) ++ { ++ dist = link->pos - link1->pos; ++ if ( dist < 0 ) ++ dist = -dist; ++ ++ dist = FT_MulFix( dist, scale ); ++ if ( dist >= edge_distance_threshold ) ++ break; ++ } ++ ++ } while ( ( seg1 = seg1->edge_next ) != edge->first ); ++ ++ if ( dist >= edge_distance_threshold ) ++ continue; ++ } ++ + found = edge; + break; + } +@@ -1341,6 +1547,7 @@ + edge->fpos = seg->pos; + edge->opos = edge->pos = FT_MulFix( seg->pos, scale ); + seg->edge_next = seg; ++ edge->dir = seg->dir; + } + else + { +@@ -1391,8 +1598,6 @@ + { + FT_Int is_round = 0; /* does it contain round segments? */ + FT_Int is_straight = 0; /* does it contain straight segments? */ +- FT_Pos ups = 0; /* number of upwards segments */ +- FT_Pos downs = 0; /* number of downwards segments */ + + + seg = edge->first; +@@ -1408,12 +1613,6 @@ + else + is_straight++; + +- /* check for segment direction */ +- if ( seg->dir == up_dir ) +- ups += seg->max_coord-seg->min_coord; +- else +- downs += seg->max_coord-seg->min_coord; +- + /* check for links -- if seg->serif is set, then seg->link must */ + /* be ignored */ + is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge ); +@@ -1479,18 +1678,6 @@ + if ( is_round > 0 && is_round >= is_straight ) + edge->flags |= AH_EDGE_ROUND; + +- /* set the edge's main direction */ +- edge->dir = AH_DIR_NONE; +- +- if ( ups > downs ) +- edge->dir = up_dir; +- +- else if ( ups < downs ) +- edge->dir = -up_dir; +- +- else if ( ups == downs ) +- edge->dir = 0; /* both up and down! */ +- + /* gets rid of serifs if link is set */ + /* XXX: This gets rid of many unpleasant artefacts! */ + /* Example: the `c' in cour.pfa at size 13 */ +@@ -1523,7 +1710,7 @@ + ah_outline_compute_segments ( outline ); + ah_outline_link_segments ( outline ); + ah_outline_compute_edges ( outline ); +- ah_outline_compute_inflections( outline ); ++ ah_outline_compute_strongs ( outline ); + } + + +@@ -1542,12 +1729,15 @@ + { + AH_Edge edge = outline->horz_edges; + AH_Edge edge_limit = edge + outline->num_hedges; +- AH_Globals globals = &face_globals->design; ++ AH_Globals globals = &face_globals->designs[face_globals->cur_type]; + FT_Fixed y_scale = outline->y_scale; + + FT_Bool blue_active[AH_BLUE_MAX]; + + ++ if ( !globals->has_blues ) ++ return; ++ + /* compute which blue zones are active, i.e. have their scaled */ + /* size < 3/4 pixels */ + { +@@ -1588,6 +1778,18 @@ + FT_Pos best_dist; /* initial threshold */ + + ++ if ( edge->serif ) ++ { ++ FT_Pos dist = edge->serif->pos - edge->pos; ++ ++ ++ if ( dist < 0 ) ++ dist = -dist; ++ ++ if ( dist < 128 ) ++ continue; ++ } ++ + /* compute the initial threshold as a fraction of the EM size */ + best_dist = FT_MulFix( face_globals->face->units_per_EM / 40, y_scale ); + +@@ -1686,7 +1888,11 @@ + FT_Pos delta; + + +- delta = globals->scaled.blue_refs - globals->design.blue_refs; ++ if ( !globals->scaled.has_blues ) ++ return; ++ ++ delta = globals->scaled.blue_refs - ++ globals->designs[globals->cur_type].blue_refs; + + for ( ; edge < edge_limit; edge++ ) + { +diff -u freetype-2.1.7-orig/src/autohint/ahhint.c freetype-2.1.7/src/autohint/ahhint.c +--- freetype-2.1.7-orig/src/autohint/ahhint.c Mon Oct 20 17:29:45 2003 ++++ freetype-2.1.7/src/autohint/ahhint.c Sat Nov 29 08:39:27 2003 +@@ -22,9 +22,9 @@ + #include + #include "ahhint.h" + #include "ahglyph.h" +-#include "ahangles.h" + #include "aherrors.h" + #include FT_OUTLINE_H ++#include FT_TRUETYPE_TABLES_H + + + #define FACE_GLOBALS( face ) ( (AH_Face_Globals)(face)->autohint.data ) +@@ -112,7 +112,8 @@ + + if ( !hinter->do_stem_adjust ) + { +- /* leave stem widths unchanged */ ++ if ( dist < 48 ) ++ dist += ( 48 - dist )/2 ; + } + else if ( ( vertical && !hinter->do_vert_snapping ) || + ( !vertical && !hinter->do_horz_snapping ) ) +@@ -120,6 +121,7 @@ + /* smooth hinting process: very lightly quantize the stem width */ + /* */ + ++#if 0 + /* leave the widths of serifs alone */ + + if ( ( stem_flags & AH_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) ) +@@ -132,24 +134,35 @@ + } + else if ( dist < 56 ) + dist = 56; ++#endif + + { +- FT_Pos delta = dist - globals->stds[vertical]; ++ FT_Pos delta; + + +- if ( delta < 0 ) +- delta = -delta; +- +- if ( delta < 40 ) ++ if ( ( vertical && globals->num_heights > 0 ) || ++ ( !vertical && globals->num_widths > 0 ) ) + { +- dist = globals->stds[vertical]; +- if ( dist < 48 ) +- dist = 48; ++ delta = dist - globals->stds[vertical]; ++ ++ if ( delta < 0 ) ++ delta = -delta; + +- goto Done_Width; ++ if ( delta < 40 ) ++ { ++ dist = globals->stds[vertical]; ++ if ( dist < 48 ) ++ dist = 48; ++ ++ goto Done_Width; ++ } + } + +- if ( dist < 3 * 64 ) ++ if ( dist < 54 ) ++ { ++ dist += ( 54 - dist )/2 ; ++ } ++ else if ( dist < 3 * 64 ) + { + delta = dist & 63; + dist &= -64; +@@ -157,17 +170,18 @@ + if ( delta < 10 ) + dist += delta; + +- else if ( delta < 32 ) ++ else if ( delta < 22 ) + dist += 10; + ++ else if ( delta < 42 ) ++ dist += delta; ++ + else if ( delta < 54 ) + dist += 54; + + else + dist += delta; + } +- else +- dist = ( dist + 32 ) & -64; + } + } + else +@@ -409,6 +423,129 @@ + serif->pos = base->pos + sign * dist; + } + ++ ++ static FT_Pos ++ ah_hint_normal_stem( AH_Hinter hinter, ++ AH_Edge edge, ++ AH_Edge edge2, ++ FT_Pos anchor, ++ FT_Int vertical ) ++ { ++ FT_Pos org_len, cur_len, org_center; ++ FT_Pos cur_pos1, cur_pos2; ++ FT_Pos d_off1, u_off1, d_off2, u_off2, delta; ++ FT_Pos offset; ++ FT_Pos threshold = 64; ++ ++ ++ if ( !hinter->do_stem_adjust ) ++ { ++ if ( ( edge->flags & AH_EDGE_ROUND ) && ++ ( edge2->flags & AH_EDGE_ROUND ) ) ++ { ++ if ( vertical ) ++ threshold = 64 - AH_LIGHT_MODE_MAX_HORZ_GAP; ++ else ++ threshold = 64 - AH_LIGHT_MODE_MAX_VERT_GAP; ++ } ++ else ++ { ++ if ( vertical ) ++ threshold = 64 - AH_LIGHT_MODE_MAX_HORZ_GAP/3; ++ else ++ threshold = 64 - AH_LIGHT_MODE_MAX_VERT_GAP/3; ++ } ++ } ++ ++ org_len = edge2->opos - edge->opos; ++ cur_len = ah_compute_stem_width( hinter, vertical, org_len, ++ edge->flags, edge2->flags ); ++ org_center = ( edge->opos + edge2->opos ) / 2 + anchor; ++ cur_pos1 = org_center - cur_len / 2; ++ cur_pos2 = cur_pos1 + cur_len; ++ d_off1 = cur_pos1 - ( cur_pos1 & -64 ); ++ d_off2 = cur_pos2 - ( cur_pos2 & -64 ); ++ u_off1 = 64 - d_off1; ++ u_off2 = 64 - d_off2; ++ delta = 0; ++ ++ ++ if ( d_off1 == 0 || d_off2 == 0 ) ++ goto Exit; ++ ++ if ( cur_len <= threshold ) ++ { ++ if ( d_off2 < cur_len ) ++ { ++ if ( u_off1 <= d_off2 ) ++ delta = u_off1; ++ else ++ delta = -d_off2; ++ } ++ ++ goto Exit; ++ } ++ ++ if ( threshold < 64 ) ++ { ++ if ( d_off1 >= threshold || u_off1 >= threshold || ++ d_off2 >= threshold || u_off2 >= threshold ) ++ goto Exit; ++ } ++ ++ offset = cur_len % 64; ++ ++ if ( offset < 32 ) ++ { ++ if ( u_off1 <= offset || d_off2 <= offset ) ++ goto Exit; ++ } ++ else ++ offset = 64 - threshold; ++ ++ d_off1 = threshold - u_off1; ++ u_off1 = u_off1 - offset; ++ u_off2 = threshold - d_off2; ++ d_off2 = d_off2 - offset; ++ ++ if ( d_off1 <= u_off1 ) ++ u_off1 = -d_off1; ++ ++ if ( d_off2 <= u_off2 ) ++ u_off2 = -d_off2; ++ ++ if ( ABS( u_off1 ) <= ABS( u_off2 ) ) ++ delta = u_off1; ++ else ++ delta = u_off2; ++ ++ Exit: ++#if 1 ++ if ( !hinter->do_stem_adjust ) ++ { ++ if ( delta > AH_LIGHT_MODE_MAX_DELTA_ABS ) ++ delta = AH_LIGHT_MODE_MAX_DELTA_ABS; ++ else if ( delta < -AH_LIGHT_MODE_MAX_DELTA_ABS ) ++ delta = -AH_LIGHT_MODE_MAX_DELTA_ABS; ++ } ++#endif ++ ++ cur_pos1 += delta; ++ ++ if ( edge->opos < edge2->opos ) ++ { ++ edge->pos = cur_pos1; ++ edge2->pos = cur_pos1 + cur_len; ++ } ++ else ++ { ++ edge->pos = cur_pos1 + cur_len; ++ edge2->pos = cur_pos1; ++ } ++ ++ return delta; ++ } ++ + + /*************************************************************************/ + /*************************************************************************/ +@@ -438,6 +575,7 @@ + { + AH_Edge edge; + AH_Edge anchor = 0; ++ FT_Pos delta = 0; + int has_serifs = 0; + + +@@ -449,7 +587,7 @@ + + /* we begin by aligning all stems relative to the blue zone */ + /* if needed -- that's only for horizontal edges */ +- if ( dimension ) ++ if ( dimension && hinter->do_blue_hints ) + { + for ( edge = edges; edge < edge_limit; edge++ ) + { +@@ -486,14 +624,10 @@ + ah_align_linked_edge( hinter, edge1, edge2, dimension ); + edge2->flags |= AH_EDGE_DONE; + } +- +- if ( !anchor ) +- anchor = edge; + } + } + +- /* now we will align all stem edges, trying to maintain the */ +- /* relative order of stems in the glyph */ ++ /* now we will align all stem edges. */ + for ( edge = edges; edge < edge_limit; edge++ ) + { + AH_EdgeRec* edge2; +@@ -520,6 +654,7 @@ + continue; + } + ++#if 0 + if ( !anchor ) + { + +@@ -686,6 +821,93 @@ + if ( edge > edges && edge->pos < edge[-1].pos ) + edge->pos = edge[-1].pos; + } ++#else /* 1 */ ++ ++ if ( !dimension && !anchor ) ++ { ++ if ( hinter->globals->is_fixedpitch && !hinter->composite ) ++ { ++ AH_Edge left = edge; ++ AH_Edge right = edge_limit - 1; ++ AH_EdgeRec left1, left2, right1, right2; ++ FT_Pos target, center1, center2; ++ FT_Pos delta1, delta2, d1, d2; ++ ++ ++ while ( right > left && !right->link ) ++ right--; ++ ++ left1 = *left; ++ left2 = *left->link; ++ right1 = *right->link; ++ right2 = *right; ++ ++ delta = ( ( ( hinter->pp2.x + 32 ) & -64 ) - hinter->pp2.x )/2; ++ target = left->opos + ( right->opos - left->opos )/2 + delta - 16; ++ ++ delta1 = delta; ++ delta1 += ah_hint_normal_stem( hinter, left, left->link, ++ delta1, 0 ); ++ ++ if ( left->link != right ) ++ ah_hint_normal_stem( hinter, right->link, right, delta1, 0 ); ++ ++ center1 = left->pos + ( right->pos - left->pos )/2; ++ ++ if ( center1 >= target ) ++ delta2 = delta - 32; ++ else ++ delta2 = delta + 32; ++ ++ delta2 += ah_hint_normal_stem( hinter, &left1, &left2, delta2, 0 ); ++ ++ if ( delta1 != delta2 ) ++ { ++ if ( left->link != right ) ++ ah_hint_normal_stem( hinter, &right1, &right2, delta2, 0 ); ++ ++ center2 = left1.pos + ( right2.pos - left1.pos )/2; ++ ++ d1 = center1 - target; ++ d2 = center2 - target; ++ ++ if ( ABS( d2 ) < ABS( d1 ) ) ++ { ++ left->pos = left1.pos; ++ left->link->pos = left2.pos; ++ ++ if ( left->link != right ) ++ { ++ right->link->pos = right1.pos; ++ right->pos = right2.pos; ++ } ++ ++ delta1 = delta2; ++ } ++ } ++ ++ delta = delta1; ++ right->link->flags |= AH_EDGE_DONE; ++ right->flags |= AH_EDGE_DONE; ++ } ++ else ++ { ++ delta = ah_hint_normal_stem( hinter, edge, edge2, 0, 0 ); ++ } ++ ++ anchor = edge; ++ } ++ else ++ { ++ ah_hint_normal_stem( hinter, edge, edge2, ++ delta, dimension ); ++ anchor = edge; ++ } ++ ++ edge->flags |= AH_EDGE_DONE; ++ edge2->flags |= AH_EDGE_DONE; ++ ++#endif /* 1 */ + } + + /* make sure that lowercase m's maintain their symmetry */ +@@ -704,7 +926,8 @@ + /* one pixel higher or lower. */ + + n_edges = edge_limit - edges; +- if ( !dimension && ( n_edges == 6 || n_edges == 12 ) ) ++ if ( hinter->do_blue_hints && ++ !dimension && ( n_edges == 6 || n_edges == 12 ) ) + { + AH_EdgeRec *edge1, *edge2, *edge3; + FT_Pos dist1, dist2, span, delta; +@@ -730,7 +953,9 @@ + if ( span < 0 ) + span = -span; + +- if ( span < 8 ) ++ if ( edge1->link == edge1 + 1 && ++ edge2->link == edge2 + 1 && ++ edge3->link == edge3 + 1 && span < 8 ) + { + delta = edge3->pos - ( 2 * edge2->pos - edge1->pos ); + edge3->pos -= delta; +@@ -761,25 +986,48 @@ + continue; + + if ( edge->serif ) +- ah_align_serif_edge( hinter, edge->serif, edge, dimension ); +- else if ( !anchor ) + { +- edge->pos = ( edge->opos + 32 ) & -64; +- anchor = edge; ++ ah_align_serif_edge( hinter, edge->serif, edge, dimension ); ++ edge->flags |= AH_EDGE_DONE; ++ has_serifs--; + } +- else +- edge->pos = anchor->pos + +- ( ( edge->opos-anchor->opos + 32 ) & -64 ); ++ } ++ ++ if ( !has_serifs ) ++ goto Next_Dimension; ++ ++ for ( edge = edges; edge < edge_limit; edge++ ) ++ { ++ AH_Edge before, after; + +- edge->flags |= AH_EDGE_DONE; + +- if ( edge > edges && edge->pos < edge[-1].pos ) +- edge->pos = edge[-1].pos; ++ if ( edge->flags & AH_EDGE_DONE ) ++ continue; ++ ++ before = after = edge; ++ ++ while ( --before >= edges ) ++ if ( before->flags & AH_EDGE_DONE ) ++ break; ++ ++ while ( ++after < edge_limit ) ++ if ( after->flags & AH_EDGE_DONE ) ++ break; ++ ++ if ( before >= edges || after < edge_limit ) ++ { ++ if ( before < edges ) ++ edge->pos = edge->opos + ( after->pos - after->opos ); ++ ++ else if ( after >= edge_limit ) ++ edge->pos = edge->opos + ( before->pos - before->opos ); + +- if ( edge + 1 < edge_limit && +- edge[1].flags & AH_EDGE_DONE && +- edge->pos > edge[1].pos ) +- edge->pos = edge[1].pos; ++ else ++ edge->pos = before->pos + ++ FT_MulDiv( edge->fpos - before->fpos, ++ after->pos - before->pos, ++ after->fpos - before->fpos ); ++ } + } + + Next_Dimension: +@@ -806,10 +1054,12 @@ + AH_Edge edges; + AH_Edge edge_limit; + FT_Int dimension; ++ FT_Bool snapping; + + + edges = outline->horz_edges; + edge_limit = edges + outline->num_hedges; ++ snapping = hinter->do_vert_snapping; + + for ( dimension = 1; dimension >= 0; dimension-- ) + { +@@ -821,7 +1071,8 @@ + { + /* move the points of each segment */ + /* in each edge to the edge's position */ +- AH_Segment seg = edge->first; ++ AH_Segment seg = edge->first; ++ FT_Pos delta = edge->pos - edge->opos; + + + do +@@ -829,23 +1080,47 @@ + AH_Point point = seg->first; + + +- for (;;) ++ if ( snapping ) + { +- if ( dimension ) ++ for (;;) + { +- point->y = edge->pos; +- point->flags |= AH_FLAG_TOUCH_Y; ++ if ( dimension ) ++ { ++ point->y = edge->pos; ++ point->flags |= AH_FLAG_TOUCH_Y; ++ } ++ else ++ { ++ point->x = edge->pos; ++ point->flags |= AH_FLAG_TOUCH_X; ++ } ++ ++ if ( point == seg->last ) ++ break; ++ ++ point = point->next; + } +- else ++ } ++ else ++ { ++ for (;;) + { +- point->x = edge->pos; +- point->flags |= AH_FLAG_TOUCH_X; +- } ++ if ( dimension ) ++ { ++ point->y += delta; ++ point->flags |= AH_FLAG_TOUCH_Y; ++ } ++ else ++ { ++ point->x += delta; ++ point->flags |= AH_FLAG_TOUCH_X; ++ } + +- if ( point == seg->last ) +- break; ++ if ( point == seg->last ) ++ break; + +- point = point->next; ++ point = point->next; ++ } + } + + seg = seg->edge_next; +@@ -855,6 +1130,7 @@ + + edges = outline->vert_edges; + edge_limit = edges + outline->num_vedges; ++ snapping = hinter->do_horz_snapping; + } + } + +@@ -871,6 +1147,7 @@ + AH_Point points; + AH_Point point_limit; + AH_Flags touch_flag; ++ AH_Flags strong_flag; + + + points = outline->points; +@@ -879,6 +1156,7 @@ + edges = outline->horz_edges; + edge_limit = edges + outline->num_hedges; + touch_flag = AH_FLAG_TOUCH_Y; ++ strong_flag = AH_FLAG_STRONG_Y; + + for ( dimension = 1; dimension >= 0; dimension-- ) + { +@@ -899,8 +1177,7 @@ + #ifndef AH_OPTION_NO_WEAK_INTERPOLATION + /* if this point is candidate to weak interpolation, we will */ + /* interpolate it after all strong points have been processed */ +- if ( ( point->flags & AH_FLAG_WEAK_INTERPOLATION ) && +- !( point->flags & AH_FLAG_INFLECTION ) ) ++ if ( !( point->flags & strong_flag ) ) + continue; + #endif + +@@ -1034,6 +1311,7 @@ + edges = outline->vert_edges; + edge_limit = edges + outline->num_vedges; + touch_flag = AH_FLAG_TOUCH_X; ++ strong_flag = AH_FLAG_STRONG_X; + } + } + +@@ -1234,10 +1512,8 @@ + + + FT_LOCAL_DEF( void ) +- ah_hinter_align_points( AH_Hinter hinter ) ++ ah_hinter_align_normal_points( AH_Hinter hinter ) + { +- ah_hinter_align_edge_points( hinter ); +- + #ifndef AH_OPTION_NO_STRONG_INTERPOLATION + ah_hinter_align_strong_points( hinter ); + #endif +@@ -1263,17 +1539,69 @@ + static void + ah_hinter_scale_globals( AH_Hinter hinter, + FT_Fixed x_scale, +- FT_Fixed y_scale ) ++ FT_Fixed y_scale, ++ FT_Byte type ) + { + FT_Int n; + AH_Face_Globals globals = hinter->globals; +- AH_Globals design = &globals->design; ++ AH_Globals design = &globals->designs[type]; + AH_Globals scaled = &globals->scaled; ++ FT_Pos baseline = design->baseline; ++ + ++ globals->x_scale_linear = x_scale; ++ globals->y_scale_linear = y_scale; ++ globals->cur_type = type; + + /* copy content */ + *scaled = *design; + ++#ifdef FT_CONFIG_CHESTER_BLUE_SCALE ++ ++ /* try to optimize the y_scale so that the top of non-capital letters ++ * is aligned on a pixel boundary whenever possible ++ */ ++ if ( design->has_blues ) ++ { ++ FT_Pos shoot = design->blue_shoots[AH_BLUE_SMALL_TOP]; ++ FT_Pos ref = design->blue_refs[AH_BLUE_SMALL_TOP]; ++ ++ ++ baseline = FT_MulFix( baseline, y_scale ); ++ ++ /* the value of 'shoot' will be -1000 if the font doesn't have */ ++ /* small latin letters; we simply check the sign here... */ ++ if ( shoot > 0 ) ++ { ++ FT_Pos fitted; ++ ++ ++ shoot = FT_MulFix( shoot, y_scale ); ++ ref = FT_MulFix( ref, y_scale ); ++ ++ if ( shoot < 6*64 ) ++ fitted = ( shoot + 44 ) & -64; ++ else if ( shoot < 8*64 ) ++ fitted = ( shoot + 38 ) & -64; ++ else ++ fitted = ( shoot + 32 ) & -64; ++ ++ ++ if ( ref <= fitted && fitted < shoot ) ++ fitted = shoot; ++ else if ( fitted < ref ) ++ shoot = ref; ++ ++ if ( fitted > shoot ) ++ { ++ y_scale = FT_MulDiv( y_scale, fitted, shoot ); ++ baseline -= ( fitted - shoot )/2; ++ } ++ } ++ } ++ ++#endif /* FT_CONFIG_CHESTER_BLUE_SCALE */ ++ + /* scale the standard widths & heights */ + for ( n = 0; n < design->num_widths; n++ ) + scaled->widths[n] = FT_MulFix( design->widths[n], x_scale ); +@@ -1284,10 +1612,20 @@ + scaled->stds[0] = ( design->num_widths > 0 ) ? scaled->widths[0] : 32000; + scaled->stds[1] = ( design->num_heights > 0 ) ? scaled->heights[0] : 32000; + ++ globals->x_scale = x_scale; ++ globals->y_scale = y_scale; ++ ++ if ( !design->has_blues ) ++ return; ++ ++ ++ scaled->baseline = ( baseline + 32 ) & -64; ++ + /* scale the blue zones */ + for ( n = 0; n < AH_BLUE_MAX; n++ ) + { + FT_Pos delta, delta2; ++ FT_Pos ref, shoot, delta3, delta4; + + + delta = design->blue_shoots[n] - design->blue_refs[n]; +@@ -1306,13 +1644,37 @@ + if ( delta < 0 ) + delta2 = -delta2; + +- scaled->blue_refs[n] = +- ( FT_MulFix( design->blue_refs[n], y_scale ) + 32 ) & -64; +- scaled->blue_shoots[n] = scaled->blue_refs[n] + delta2; +- } ++ if ( n == AH_BLUE_SMALL_BOTTOM ) ++ { ++ scaled->blue_shoots[n] = delta2; ++ scaled->blue_refs[n] = 0; ++ continue; ++ } + +- globals->x_scale = x_scale; +- globals->y_scale = y_scale; ++ shoot = FT_MulFix( design->blue_shoots[n], y_scale ); ++ ref = FT_MulFix( design->blue_refs[n], y_scale ); ++ delta3 = ( ( shoot + 32 ) & -64 ) - shoot; ++ delta4 = ( ( ref + 32 ) & -64 ) - ref; ++ ++ if ( !hinter->do_stem_adjust ) ++ { ++ if ( delta3 > 16 ) delta3 = 16; ++ if ( delta3 < -16 ) delta3 = -16; ++ if ( delta4 > 16 ) delta4 = 16; ++ if ( delta4 < -16 ) delta4 = -16; ++ } ++ ++ shoot += delta3; ++ ref += delta4; ++ ++ if ( ABS( delta3 ) < ABS( delta4 ) ) ++ ref = shoot - delta2; ++ else ++ shoot = ref + delta2; ++ ++ scaled->blue_refs[n] = ref; ++ scaled->blue_shoots[n] = shoot; ++ } + } + + +@@ -1320,7 +1682,7 @@ + ah_hinter_align( AH_Hinter hinter ) + { + ah_hinter_align_edge_points( hinter ); +- ah_hinter_align_points( hinter ); ++ ah_hinter_align_normal_points( hinter ); + } + + +@@ -1401,7 +1763,7 @@ + hinter->globals = face_globals; + + if ( globals ) +- face_globals->design = *globals; ++ face_globals->designs[0] = *globals; + else + ah_hinter_compute_globals( hinter ); + +@@ -1410,6 +1772,27 @@ + ah_hinter_done_face_globals; + face_globals->face = face; + ++ ah_hinter_compute_char_table( hinter ); ++ ++ { ++ TT_OS2* os2 = FT_Get_Sfnt_Table( face, ft_sfnt_os2 ); ++ ++ ++ if ( os2 && os2->version != 0xFFFFU ) ++ face_globals->is_fixedpitch = FT_BOOL( os2->panose[3] == 9 ); ++ else ++ face_globals->is_fixedpitch = FT_BOOL( FT_IS_FIXED_WIDTH( face ) != 0 ); ++ ++ ++ face_globals->has_tt_bytecode_interp = FALSE; ++ ++#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++ if ( !strcmp( face->driver->root.clazz->module_name, "truetype" ) || ++ !strcmp( face->driver->root.clazz->module_name, "type42" ) ) ++ face_globals->has_tt_bytecode_interp = TRUE; ++#endif ++ } ++ + Exit: + return error; + } +@@ -1423,6 +1806,8 @@ + FT_Memory memory = face->memory; + + ++ FT_Done_Size( globals->size_EM ); ++ FT_FREE( globals->table ); + FT_FREE( globals ); + } + +@@ -1441,12 +1826,17 @@ + FT_Error error; + AH_Outline outline = hinter->glyph; + AH_Loader gloader = hinter->loader; ++ FT_Pos baseline = 0; ++ FT_Byte type = hinter->globals->cur_type; + + + /* load the glyph */ +- error = FT_Load_Glyph( face, glyph_index, load_flags ); +- if ( error ) +- goto Exit; ++ if ( !hinter->globals->has_tt_bytecode_interp ) ++ { ++ error = FT_Load_Glyph( face, glyph_index, load_flags ); ++ if ( error ) ++ goto Exit; ++ } + + /* Set `hinter->transformed' after loading with FT_LOAD_NO_RECURSE. */ + hinter->transformed = internal->glyph_transformed; +@@ -1463,6 +1853,11 @@ + FT_Matrix_Invert( &imatrix ); + FT_Vector_Transform( &hinter->trans_delta, &imatrix ); + } ++ else ++ { ++ hinter->trans_delta.x = 0; ++ hinter->trans_delta.y = 0; ++ } + + /* set linear horizontal metrics */ + slot->linearHoriAdvance = slot->metrics.horiAdvance; +@@ -1472,17 +1867,22 @@ + { + case FT_GLYPH_FORMAT_OUTLINE: + ++ if ( hinter->do_blue_hints ) ++ baseline = hinter->globals->designs[type].baseline; ++ + /* translate glyph outline if we need to */ +- if ( hinter->transformed ) ++ if ( hinter->transformed || baseline != 0 ) + { + FT_UInt n = slot->outline.n_points; + FT_Vector* point = slot->outline.points; ++ FT_Pos x_off = hinter->trans_delta.x; ++ FT_Pos y_off = hinter->trans_delta.y - baseline; + + + for ( ; n > 0; point++, n-- ) + { +- point->x += hinter->trans_delta.x; +- point->y += hinter->trans_delta.y; ++ point->x += x_off; ++ point->y += y_off; + } + } + +@@ -1524,7 +1924,7 @@ + /* perform feature detection */ + ah_outline_detect_features( outline ); + +- if ( hinter->do_vert_hints ) ++ if ( hinter->do_blue_hints ) + { + ah_outline_compute_blue_edges( outline, hinter->globals ); + ah_outline_scale_blue_edges( outline, hinter->globals ); +@@ -1539,6 +1939,8 @@ + + /* we now need to hint the metrics according to the change in */ + /* width/positioning that occured during the hinting process */ ++ if ( !hinter->globals->is_fixedpitch && !hinter->composite && ++ type <= AH_CHAR_TYPE_HORIZONTAL ) + { + FT_Pos old_advance, old_rsb, old_lsb, new_lsb; + AH_Edge edge1 = outline->vert_edges; /* leftmost edge */ +@@ -1551,8 +1953,8 @@ + old_lsb = edge1->opos; + new_lsb = edge1->pos; + +- hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; +- hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64; ++ hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; ++ hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 40 ) & -64; + + #if 0 + /* try to fix certain bad advance computations */ +@@ -1705,6 +2107,13 @@ + FT_BBox bbox; + + ++ if ( hinter->do_blue_hints ) ++ { ++ if ( hinter->globals->scaled.baseline != 0 ) ++ FT_Outline_Translate( &gloader->base.outline, ++ 0, hinter->globals->scaled.baseline ); ++ } ++ + /* transform the hinted outline if needed */ + if ( hinter->transformed ) + FT_Outline_Transform( &gloader->base.outline, &hinter->trans_matrix ); +@@ -1725,14 +2134,7 @@ + slot->metrics.horiBearingX = bbox.xMin; + slot->metrics.horiBearingY = bbox.yMax; + +- /* for mono-width fonts (like Andale, Courier, etc.) we need */ +- /* to keep the original rounded advance width */ +- if ( !FT_IS_FIXED_WIDTH( slot->face ) ) +- slot->metrics.horiAdvance = hinter->pp2.x - hinter->pp1.x; +- else +- slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance, +- x_scale ); +- ++ slot->metrics.horiAdvance = hinter->pp2.x - hinter->pp1.x; + slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + 32 ) & -64; + + /* now copy outline into glyph slot */ +@@ -1754,6 +2156,236 @@ + } + + ++#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++ ++#define AH_MAX_COMPOSITE_RECURSE 5 ++ ++ static FT_Error ++ ah_hinter_load_truetype( AH_Hinter hinter, ++ FT_UInt glyph_index, ++ FT_Int32 load_flags, ++ int depth, ++ short **num_contours, ++ short **num_points, ++ int *num_simple_glyphs, ++ int *size_array ) ++ { ++ FT_Face face = hinter->face; ++ FT_Memory memory = hinter->memory; ++ FT_GlyphSlot slot = face->glyph; ++ FT_Error error = FT_Err_Ok; ++ ++ ++ if ( depth == 0 ) ++ { ++ *num_contours = 0; ++ *num_points = 0; ++ *num_simple_glyphs = 0; ++ *size_array = 0; ++ } ++ ++ error = FT_Load_Glyph( face, glyph_index, load_flags ); ++ ++ if ( error ) ++ return error; ++ ++ switch ( slot->format ) ++ { ++ case FT_GLYPH_FORMAT_OUTLINE: ++ { ++ int size_cur = *size_array; ++ ++ ++ if ( depth == 0 ) ++ return ah_hinter_load( hinter, 0, load_flags, 0 ); ++ ++ if ( slot->outline.n_contours == 0 ) ++ break; ++ ++ if ( *num_simple_glyphs >= size_cur ) ++ { ++ if ( FT_RENEW_ARRAY( *num_contours, size_cur, size_cur + 16 ) || ++ FT_RENEW_ARRAY( *num_points, size_cur, size_cur + 16 ) ) ++ goto Exit; ++ *size_array += 16; ++ } ++ ++ (*num_contours)[ (*num_simple_glyphs) ] = slot->outline.n_contours; ++ (*num_points)[ (*num_simple_glyphs)++ ] = slot->outline.n_points; ++ break; ++ } ++ ++ case FT_GLYPH_FORMAT_COMPOSITE: ++ if ( depth + 1 >= AH_MAX_COMPOSITE_RECURSE ) ++ return AH_Err_Invalid_Composite; ++ ++ if ( slot->num_subglyphs > 0 ) ++ { ++ FT_UInt* indices; ++ int num_subglyphs = slot->num_subglyphs; ++ int i; ++ ++ ++ hinter->composite = TRUE; ++ ++ if ( FT_NEW_ARRAY( indices, num_subglyphs ) ) ++ goto Exit; ++ ++ for ( i = 0; i < num_subglyphs; i++ ) ++ indices[i] = slot->subglyphs[i].index; ++ ++ ++ for ( i = 0; i < num_subglyphs; i++ ) ++ { ++ error = ah_hinter_load_truetype( hinter, ++ indices[i], ++ load_flags, ++ depth + 1, ++ num_contours, ++ num_points, ++ num_simple_glyphs, ++ size_array ); ++ if ( error ) ++ { ++ FT_FREE( indices ); ++ goto Exit; ++ } ++ } ++ ++ FT_FREE( indices ); ++ ++ if ( depth == 0 ) ++ { ++ FT_Size size_EM, size; ++ FT_Vector* points; ++ FT_Vector* limit; ++ int num = *num_simple_glyphs, j; ++ short n_contours, n_points; ++ short *array_c, *array_p; ++ ++ ++ if ( num == 0 ) ++ break; ++ ++ size = face->size; ++ size_EM = hinter->globals->size_EM; ++ ++ if ( !size_EM ) ++ { ++ error = FT_New_Size( face, &hinter->globals->size_EM ); ++ if ( error ) ++ goto Exit; ++ ++ size_EM = hinter->globals->size_EM; ++ FT_Activate_Size( size_EM ); ++ ++ error = FT_Set_Pixel_Sizes( face, ++ face->units_per_EM, ++ face->units_per_EM ); ++ if ( error ) ++ { ++ FT_Activate_Size( size ); ++ goto Exit; ++ } ++ } ++ else ++ FT_Activate_Size( size_EM ); ++ ++ ++ load_flags &= ~FT_LOAD_NO_RECURSE & ++ ~FT_LOAD_NO_SCALE; ++ load_flags |= FT_LOAD_NO_BITMAP | ++ FT_LOAD_NO_AUTOHINT | ++ FT_LOAD_IGNORE_TRANSFORM; ++ ++ error = FT_Load_Glyph( face, glyph_index, load_flags ); ++ ++ FT_Activate_Size( size ); ++ ++ if ( error ) ++ goto Exit; ++ ++ ++ array_c = *num_contours; ++ array_p = *num_points; ++ n_contours = 0; ++ n_points = 0; ++ ++ for ( i = 0; i < num; i++ ) ++ { ++ n_contours += *array_c++; ++ n_points += *array_p++; ++ } ++ ++ if ( slot->outline.n_points != n_points || ++ slot->outline.n_contours != n_contours ) ++ { ++ error = AH_Err_Invalid_Composite; ++ goto Exit; ++ } ++ ++ ++ points = slot->outline.points; ++ limit = points + slot->outline.n_points; ++ ++ while ( points < limit ) ++ { ++ points->x >>= 6; ++ points->y >>= 6; ++ points++; ++ } ++ ++ slot->metrics.horiAdvance >>= 6; ++ slot->metrics.vertAdvance >>= 6; ++ ++ array_c = *num_contours; ++ array_p = *num_points; ++ ++ for ( i = 0; i < num - 1; i++ ) ++ { ++ slot->outline.n_contours = *array_c++; ++ slot->outline.n_points = *array_p++; ++ ++ error = ah_hinter_load( hinter, 0, load_flags, 1 ); ++ if ( error ) ++ goto Exit; ++ ++ n_points = slot->outline.n_points; ++ slot->outline.points += n_points; ++ slot->outline.tags += n_points; ++ slot->outline.contours += slot->outline.n_contours; ++ n_contours -= slot->outline.n_contours; ++ ++ for ( j = 0; j < n_contours; j++ ) ++ slot->outline.contours[j] -= n_points; ++ } ++ ++ slot->outline.n_contours = *array_c; ++ slot->outline.n_points = *array_p; ++ ++ error = ah_hinter_load( hinter, 0, load_flags, 0 ); ++ } ++ } ++ break; ++ ++ default: ++ error = AH_Err_Unimplemented_Feature; ++ } ++ ++ ++ Exit: ++ if ( depth == 0 ) ++ { ++ FT_FREE( *num_contours ); ++ FT_FREE( *num_points ); ++ } ++ ++ return error; ++ } ++ ++#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ ++ ++ + /* load and hint a given glyph */ + FT_LOCAL_DEF( FT_Error ) + ah_hinter_load_glyph( AH_Hinter hinter, +@@ -1768,6 +2400,7 @@ + FT_Fixed y_scale = size->metrics.y_scale; + AH_Face_Globals face_globals = FACE_GLOBALS( face ); + FT_Render_Mode hint_mode = FT_LOAD_TARGET_MODE( load_flags ); ++ FT_Byte type; + + + /* first of all, we need to check that we're using the correct face and */ +@@ -1787,46 +2420,6 @@ + + } + +-#ifdef FT_CONFIG_CHESTER_BLUE_SCALE +- +- /* try to optimize the y_scale so that the top of non-capital letters +- * is aligned on a pixel boundary whenever possible +- */ +- { +- AH_Globals design = &face_globals->design; +- FT_Pos shoot = design->blue_shoots[AH_BLUE_SMALL_TOP]; +- +- +- /* the value of 'shoot' will be -1000 if the font doesn't have */ +- /* small latin letters; we simply check the sign here... */ +- if ( shoot > 0 ) +- { +- FT_Pos scaled = FT_MulFix( shoot, y_scale ); +- FT_Pos fitted = ( scaled + 32 ) & -64; +- +- +- if ( scaled != fitted ) +- { +- /* adjust y_scale +- */ +- y_scale = FT_MulDiv( y_scale, fitted, scaled ); +- +- /* adust x_scale +- */ +- if ( fitted < scaled ) +- x_scale -= x_scale / 50; /* x_scale*0.98 with integers */ +- } +- } +- } +- +-#endif /* FT_CONFIG_CHESTER_BLUE_SCALE */ +- +- /* now, we must check the current character pixel size to see if we */ +- /* need to rescale the global metrics */ +- if ( face_globals->x_scale != x_scale || +- face_globals->y_scale != y_scale ) +- ah_hinter_scale_globals( hinter, x_scale, y_scale ); +- + ah_loader_rewind( hinter->loader ); + + /* reset hinting flags according to load flags and current render target */ +@@ -1850,11 +2443,51 @@ + + hinter->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); + ++ type = ah_hinter_get_char_type( hinter, glyph_index ); ++ ++ hinter->do_blue_hints = face_globals->designs[type].has_blues; ++ hinter->composite = FALSE; ++ ++ /* now, we must check the current character pixel size to see if we */ ++ /* need to rescale the global metrics */ ++ if ( face_globals->x_scale_linear != x_scale || ++ face_globals->y_scale_linear != y_scale || ++ face_globals->cur_type != type ) ++ ah_hinter_scale_globals( hinter, x_scale, y_scale, type ); ++ + load_flags |= FT_LOAD_NO_SCALE + | FT_LOAD_IGNORE_TRANSFORM; + load_flags &= ~FT_LOAD_RENDER; + +- error = ah_hinter_load( hinter, glyph_index, load_flags, 0 ); ++#ifndef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++ ++ error = ah_hinter_load( hinter, glyph_index, load_flags, 0 ); ++ ++#else ++ ++ if ( face_globals->has_tt_bytecode_interp ) ++ { ++ short* num_contours; ++ short* num_points; ++ int num_simple_glyphs; ++ int size_array; ++ ++ ++ load_flags |= FT_LOAD_NO_RECURSE; ++ ++ error = ah_hinter_load_truetype( hinter, ++ glyph_index, ++ load_flags, ++ 0, ++ &num_contours, ++ &num_points, ++ &num_simple_glyphs, ++ &size_array ); ++ } ++ else ++ error = ah_hinter_load( hinter, glyph_index, load_flags, 0 ); ++ ++#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + Exit: + return error; +@@ -1885,7 +2518,7 @@ + goto Fail; + } + +- *globals = FACE_GLOBALS( face )->design; ++ *globals = FACE_GLOBALS( face )->designs[0]; + *global_hints = globals; + *global_len = sizeof( *globals ); + +diff -u freetype-2.1.7-orig/src/autohint/ahtypes.h freetype-2.1.7/src/autohint/ahtypes.h +--- freetype-2.1.7-orig/src/autohint/ahtypes.h Wed May 28 14:52:05 2003 ++++ freetype-2.1.7/src/autohint/ahtypes.h Sat Nov 29 08:24:43 2003 +@@ -138,6 +138,8 @@ + /* weak interpolation */ + #define AH_FLAG_WEAK_INTERPOLATION 256 + #define AH_FLAG_INFLECTION 512 ++#define AH_FLAG_STRONG_X 1024 ++#define AH_FLAG_STRONG_Y 2048 + + typedef FT_Int AH_Flags; + +@@ -264,7 +266,10 @@ + AH_Segment link; /* link segment */ + AH_Segment serif; /* primary segment for serifs */ + FT_Pos num_linked; /* number of linked segments */ +- FT_Pos score; ++ FT_Pos score1; ++ FT_Pos score2; ++ FT_Pos length; ++ FT_Int sign; + + AH_Point first; /* first point in edge segment */ + AH_Point last; /* last point in edge segment */ +@@ -402,6 +407,37 @@ + typedef FT_Int AH_Hinter_Flags; + + ++#define AH_LIGHT_MODE_MAX_HORZ_GAP 9 ++#define AH_LIGHT_MODE_MAX_VERT_GAP 15 ++#define AH_LIGHT_MODE_MAX_DELTA_ABS 14 ++ ++ enum ++ { ++ AH_CHAR_TYPE_LATINATE = 0, ++ AH_CHAR_TYPE_LATIN_FULLWIDTH, ++ AH_CHAR_TYPE_HORIZONTAL, ++ AH_CHAR_TYPE_OTHER, ++ AH_CHAR_TYPE_COUNT ++ }; ++ ++ ++ typedef struct AH_CharType_ ++ { ++ FT_Byte type; ++ FT_ULong start; ++ FT_ULong last; ++ ++ } AH_CharType; ++ ++ ++ typedef struct AH_CharTypeTable_ ++ { ++ FT_ULong size; ++ AH_CharType* types; ++ ++ } AH_CharTypeTable; ++ ++ + /*************************************************************************/ + /* */ + /* */ +@@ -440,6 +476,10 @@ + FT_Pos blue_refs [AH_BLUE_MAX]; + FT_Pos blue_shoots[AH_BLUE_MAX]; + ++ FT_Pos baseline; ++ ++ FT_Bool has_blues; ++ + } AH_GlobalsRec, *AH_Globals; + + +@@ -470,12 +510,21 @@ + typedef struct AH_Face_GlobalsRec_ + { + FT_Face face; +- AH_GlobalsRec design; ++ AH_GlobalsRec designs[AH_CHAR_TYPE_COUNT]; + AH_GlobalsRec scaled; + FT_Fixed x_scale; + FT_Fixed y_scale; + FT_Bool control_overshoot; + ++ FT_Fixed x_scale_linear; ++ FT_Fixed y_scale_linear; ++ ++ AH_CharTypeTable* table; ++ FT_Byte cur_type; ++ FT_Size size_EM; ++ FT_Bool is_fixedpitch; ++ FT_Bool has_tt_bytecode_interp; ++ + } AH_Face_GlobalsRec, *AH_Face_Globals; + + +@@ -494,6 +543,7 @@ + AH_Loader loader; + FT_Vector pp1; + FT_Vector pp2; ++ FT_Bool composite; + + FT_Bool transformed; + FT_Vector trans_delta; +@@ -504,6 +554,7 @@ + FT_Bool do_horz_snapping; /* disable X stem size snapping */ + FT_Bool do_vert_snapping; /* disable Y stem size snapping */ + FT_Bool do_stem_adjust; /* disable light stem snapping */ ++ FT_Bool do_blue_hints; /* disable blue hinting */ + + } AH_HinterRec, *AH_Hinter; + +diff -u freetype-2.1.7-orig/src/autohint/autohint.c freetype-2.1.7/src/autohint/autohint.c +--- freetype-2.1.7-orig/src/autohint/autohint.c Fri Jun 29 02:48:46 2001 ++++ freetype-2.1.7/src/autohint/autohint.c Sat Nov 29 08:24:43 2003 +@@ -22,7 +22,6 @@ + #define FT_MAKE_OPTION_SINGLE_OBJECT + + #include +-#include "ahangles.c" + #include "ahglyph.c" + #include "ahglobal.c" + #include "ahhint.c" --- freetype-2.1.10.orig/debian/patches/005-ft2demos-2.1.7-ftbench.diff +++ freetype-2.1.10/debian/patches/005-ft2demos-2.1.7-ftbench.diff @@ -0,0 +1,74 @@ +--- ft2demos-2.1.10.orig/src/ftbench.c 2005-03-01 06:30:31.000000000 +0000 ++++ ft2demos-2.1.10/src/ftbench.c 2005-06-12 23:06:07.000000000 +0100 +@@ -57,7 +57,7 @@ + int preload = 0; + FT_Byte* memory_file = NULL; + long memory_size; +- ++FT_UInt num_charcodes; + + /* + * Dummy face requester (the face object is already loaded) +@@ -107,17 +107,25 @@ + if (cmap) + return; /* Already available */ + +- cmap = (charmap_t*)calloc(face->num_glyphs, sizeof(charmap_t)); +- + if (face->charmap) + { +- i = 0; ++ /* A glyph may have multiple cmap entries in some fonts such that */ ++ /* the num_charcodes may be greater than face->num_glyphs. */ ++ /* To be safe, count num_charcodes before calling calloc. */ ++ /* */ ++ num_charcodes = 0; + charcode = FT_Get_First_Char(face, &gindex); ++ while ( gindex ) ++ { ++ num_charcodes++; ++ charcode = FT_Get_Next_Char(face, charcode, &gindex); ++ } + +- /* certain fonts contain a broken charmap that will map character codes */ +- /* to out-of-bounds glyph indices. Take care of that here !! */ +- /* */ +- while ( gindex && i < face->num_glyphs ) ++ cmap = (charmap_t*)calloc(num_charcodes, sizeof(charmap_t)); ++ ++ i = 0; ++ charcode = FT_Get_First_Char(face, &gindex); ++ while ( gindex ) + { + cmap[i].index = gindex; + cmap[i].charcode = charcode; +@@ -126,13 +134,18 @@ + } + } + else ++ { + /* no charmap, do an identity mapping */ +- for (i = 0; i < face->num_glyphs; i++) ++ num_charcodes = face->num_glyphs; ++ ++ cmap = (charmap_t*)calloc(num_charcodes, sizeof(charmap_t)); ++ ++ for (i = 0; i < num_charcodes; i++) + { + cmap[i].index = i; + cmap[i].charcode = i; +- i++; + } ++ } + } + + +@@ -154,7 +167,7 @@ + t0 = get_time(); + do + { +- for (i = 0; i < face->num_glyphs; i++) ++ for (i = 0; i < num_charcodes; i++) + if (!(*bench_func)(cmap[i].index, cmap[i].charcode)) + done++; + n++; --- freetype-2.1.10.orig/debian/patches/050-more-rounding.diff +++ freetype-2.1.10/debian/patches/050-more-rounding.diff @@ -0,0 +1,22 @@ +--- freetype-2.1.4rc2~/src/base/ftobjs.c 2003-03-22 19:49:39.000000000 +0800 ++++ freetype-2.1.4rc2/src/base/ftobjs.c 2003-03-22 21:24:23.000000000 +0800 +@@ -1426,19 +1426,11 @@ + char_height = 1 * 64; + + /* Compute pixel sizes in 26.6 units */ +-#ifdef FT_CONFIG_CHESTER_BLUE_SCALE +- dim_x = ( char_width * horz_resolution + 36 ) / 72; /* round div */ +- dim_y = ( char_height * vert_resolution + 36 ) / 72; /* round div */ +- +- metrics->x_ppem = (FT_UShort)( (dim_x+32) >> 6 ); /* round div */ +- metrics->y_ppem = (FT_UShort)( (dim_y+32) >> 6 ); /* round div */ +-#else + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ + + metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); /* floor div, already rounded */ + metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); /* floor div, already rounded */ +-#endif + + metrics->x_scale = 0x10000L; + metrics->y_scale = 0x10000L; --- freetype-2.1.10.orig/debian/patches/040-ftobjs-more-rounding.diff +++ freetype-2.1.10/debian/patches/040-ftobjs-more-rounding.diff @@ -0,0 +1,28 @@ +--- freetype-2.1.4rc2~/src/base/ftobjs.c Thu Mar 20 08:04:40 2003 ++++ freetype-2.1.4rc2/src/base/ftobjs.c Fri Mar 21 16:36:16 2003 +@@ -1427,17 +1427,17 @@ + + /* Compute pixel sizes in 26.6 units */ + #ifdef FT_CONFIG_CHESTER_BLUE_SCALE +- dim_x = ( char_width * horz_resolution ) / 72; +- dim_y = ( char_height * vert_resolution ) / 72; ++ dim_x = ( char_width * horz_resolution + 36 ) / 72; /* round div */ ++ dim_y = ( char_height * vert_resolution + 36 ) / 72; /* round div */ + +- metrics->x_ppem = (FT_UShort)( (dim_x+32) >> 6 ); +- metrics->y_ppem = (FT_UShort)( (dim_y+32) >> 6 ); ++ metrics->x_ppem = (FT_UShort)( (dim_x+32) >> 6 ); /* round div */ ++ metrics->y_ppem = (FT_UShort)( (dim_y+32) >> 6 ); /* round div */ + #else +- dim_x = ( ( ( char_width * horz_resolution ) / 72 ) + 32 ) & -64; +- dim_y = ( ( ( char_height * vert_resolution ) / 72 ) + 32 ) & -64; ++ dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ ++ dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; /* round div */ + +- metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); +- metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); ++ metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); /* floor div, already rounded */ ++ metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); /* floor div, already rounded */ + #endif + + metrics->x_scale = 0x10000L; --- freetype-2.1.10.orig/debian/patches/310-ft2demos-2.1.9-graph-link.diff +++ freetype-2.1.10/debian/patches/310-ft2demos-2.1.9-graph-link.diff @@ -0,0 +1,11 @@ +--- ft2demos-2.1.9~/graph/x11/rules.mk 2005-05-28 17:30:38.382184104 +0100 ++++ ft2demos-2.1.9/graph/x11/rules.mk 2005-05-28 17:29:13.836037072 +0100 +@@ -72,7 +72,7 @@ + #ifeq ($(PLATFORM),unix) + # GRAPH_LINK += $(X11_LIB:%=-R%) + #endif +- GRAPH_LINK += $(X11_LIB:%=-L%) -lX11 ++ GRAPH_LINK += $(X11_LIB:%=-L%) -lX11 -lm + + # Solaris needs a -lsocket in GRAPH_LINK. + # --- freetype-2.1.10.orig/debian/patches/032-force-unpatented-hinting.diff +++ freetype-2.1.10/debian/patches/032-force-unpatented-hinting.diff @@ -0,0 +1,11 @@ +--- freetype-2.1.4~/include/freetype/config/ftoption.h 2003-05-21 02:24:06.000000000 +0800 ++++ freetype-2.1.4/include/freetype/config/ftoption.h 2003-05-24 20:40:55.000000000 +0800 +@@ -423,7 +423,7 @@ + /* For this to work you must also define */ + /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING. */ + /* */ +-/* #define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING */ ++#define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING + + + /*************************************************************************/ --- freetype-2.1.10.orig/debian/patches/022-psh-bluescale.diff +++ freetype-2.1.10/debian/patches/022-psh-bluescale.diff @@ -0,0 +1,38 @@ +diff -ru /home/dchest/ft-clean/freetype2/src/pshinter/pshalgo3.c ./src/pshinter/pshalgo3.c +--- /home/dchest/ft-clean/freetype2/src/pshinter/pshalgo3.c 2003-01-30 18:24:18.000000000 -0500 ++++ ./src/pshinter/pshalgo3.c 2003-02-01 21:54:36.000000000 -0500 +@@ -1908,6 +1908,34 @@ + if ( error ) + goto Exit; + ++ /* try to optimize the y_scale so that the top of non-capital letters ++ * is aligned on a pixel boundary whenever possible ++ */ ++ { ++ PSH_Dimension dim_x = &glyph->globals->dimension[0]; ++ PSH_Dimension dim_y = &glyph->globals->dimension[1]; ++ ++ FT_Fixed x_scale = dim_x->scale_mult; ++ FT_Fixed y_scale = dim_y->scale_mult; ++ ++ FT_Fixed scaled; ++ FT_Fixed fitted; ++ ++ scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale ); ++ fitted = (scaled + 32) & -64; ++ ++ if (scaled != fitted ) { ++ ++ y_scale = FT_MulDiv( y_scale, fitted, scaled ); ++ ++ if ( fitted < scaled ) ++ x_scale -= x_scale/50; ++ ++ psh_globals_set_scale( glyph->globals, x_scale, y_scale, 0, 0); ++ ++ } ++ } ++ + glyph->do_horz_hints = 1; + glyph->do_vert_hints = 1; + --- freetype-2.1.10.orig/debian/patches/080-freetype-2.1.7-backwards-compat.diff +++ freetype-2.1.10/debian/patches/080-freetype-2.1.7-backwards-compat.diff @@ -0,0 +1,33 @@ +diff -u freetype-2.1.9~/src/base/ftapi.c freetype-2.1.9/src/base/ftapi.c +--- freetype-2.1.9~/src/base/ftapi.c 2002-03-30 13:16:33.000000000 +0000 ++++ freetype-2.1.9/src/base/ftapi.c 2005-05-28 15:02:50.052375160 +0100 +@@ -118,4 +118,18 @@ + } + + ++ FT_BASE_DEF( FT_Short ) ++ FT_Get_Short( FT_Stream stream ) ++ { ++ return FT_GET_SHORT(); ++ } ++ ++ ++ FT_BASE_DEF( FT_Long ) ++ FT_Get_Long( FT_Stream stream ) ++ { ++ return FT_GET_LONG(); ++ } ++ ++ + /* END */ +diff -u freetype-2.1.9~/src/base/ftbase.c freetype-2.1.9/src/base/ftbase.c +--- freetype-2.1.9~/src/base/ftbase.c 2004-02-25 12:58:54.000000000 +0000 ++++ freetype-2.1.9/src/base/ftbase.c 2005-05-28 15:03:33.820721360 +0100 +@@ -30,6 +30,7 @@ + #include "ftobjs.c" + #include "ftnames.c" + #include "ftrfork.c" ++#include "ftapi.c" + + #if defined( __APPLE__ ) && !defined ( DARWIN_NO_CARBON ) + #include "ftmac.c" --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-memleak.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-memleak.patch @@ -0,0 +1,15 @@ +--- freetype-2.1.10/src/cache/ftcimage.c.memleak 2005-08-24 15:40:33.000000000 +0200 ++++ freetype-2.1.10/src/cache/ftcimage.c 2005-08-24 15:40:56.000000000 +0200 +@@ -78,6 +78,12 @@ + /* we will now load the glyph image */ + error = clazz->family_load_glyph( family, gindex, cache, + &inode->glyph ); ++ ++ if ( error ) ++ { ++ FTC_INode_Free( inode, cache ); ++ inode = NULL; ++ } + } + + *pinode = inode; --- freetype-2.1.10.orig/debian/patches/403-pcf-strlen.patch +++ freetype-2.1.10/debian/patches/403-pcf-strlen.patch @@ -0,0 +1,32 @@ +--- freetype-2.1.4/src/pcf/pcfread.c.strlen2 2003-01-22 17:45:28.000000000 -0500 ++++ freetype-2.1.4/src/pcf/pcfread.c 2006-06-28 15:01:19.000000000 -0400 +@@ -428,6 +428,14 @@ + + for ( i = 0; i < nprops; i++ ) + { ++ /* 2006:0500 (mbarnes) - Detect invalid string length. ++ * XXX Is this is best error code to return? */ ++ if ( props[i].name < 0 ) ++ { ++ error = FT_Err_Invalid_File_Format; ++ goto Bail; ++ } ++ + /* XXX: make atom */ + if ( FT_NEW_ARRAY( properties[i].name, + ft_strlen( strings + props[i].name ) + 1 ) ) +@@ -438,6 +446,14 @@ + + if ( props[i].isString ) + { ++ /* 2006:0500 (mbarnes) - Detect invalid string length. ++ * XXX Is this the best error code to return? */ ++ if ( props[i].value < 0 ) ++ { ++ error = FT_Err_Invalid_File_Format; ++ goto Bail; ++ } ++ + if ( FT_NEW_ARRAY( properties[i].value.atom, + ft_strlen( strings + props[i].value ) + 1 ) ) + goto Bail; --- freetype-2.1.10.orig/debian/patches/021-bluescale-rescaling-fix.diff +++ freetype-2.1.10/debian/patches/021-bluescale-rescaling-fix.diff @@ -0,0 +1,53 @@ +Date: Fri, 14 Mar 2003 11:16:31 -0500 +From: David Chester +Subject: [Devel] new fixes +To: devel@freetype.org + +Hello. + +Would the following be possible for 2.1.4? Without this patch, the bluescale +code isn't really doing very much. + +I've sent a message about this problem before, so please excuse me if you are +already aware, and waiting for 2.1.5; however, if it is perhaps an oversight, +it would be nice if these changes could make it in for 2.1.4. The difference +between the rendering with and without this patch can be seen especially with +ftview and Times New Roman sizes 14 and 20. + +Thanks very much. +David Chester + +diff -ru ../ft-clean/src/autohint/ahhint.c ./src/autohint/ahhint.c +--- ../ft-clean/src/autohint/ahhint.c 2003-02-18 17:36:04.000000000 -0500 ++++ ./src/autohint/ahhint.c 2003-03-14 10:28:40.000000000 -0500 +@@ -1680,12 +1680,12 @@ + { + /* adjust y_scale + */ +- y_scale = FT_MulDiv( y_scale, fitted, scaled ); ++ face->size->metrics.y_scale = FT_MulDiv( y_scale, fitted, scaled ); + + /* adust x_scale + */ + if ( fitted < scaled ) +- x_scale -= x_scale/50; /* x_scale*0.98 with integers */ ++ face->size->metrics.x_scale -= x_scale/50; /* x_scale*0.98 */ + } + } + } +@@ -1695,7 +1695,9 @@ + /* need to rescale the global metrics */ + if ( face_globals->x_scale != x_scale || + face_globals->y_scale != y_scale ) +- ah_hinter_scale_globals( hinter, x_scale, y_scale ); ++ ah_hinter_scale_globals( hinter, ++ face->size->metrics.x_scale, ++ face->size->metrics.y_scale ); + + ah_loader_rewind( hinter->loader ); + + +_______________________________________________ +Devel mailing list +Devel@freetype.org +http://www.freetype.org/mailman/listinfo/devel --- freetype-2.1.10.orig/debian/patches/freetype-2.1.10-security-ttgload-fix.patch +++ freetype-2.1.10/debian/patches/freetype-2.1.10-security-ttgload-fix.patch @@ -0,0 +1,33 @@ +diff -uNrp freetype-2.1.10.orig/src/truetype/ttgload.c freetype-2.1.10/src/truetype/ttgload.c +--- freetype-2.1.10.orig/src/truetype/ttgload.c 2005-04-06 07:34:41.000000000 -0700 ++++ freetype-2.1.10/src/truetype/ttgload.c 2007-05-22 15:36:05.000000000 -0700 +@@ -465,7 +465,11 @@ + + n_points = 0; + if ( n_contours > 0 ) ++ { + n_points = cont[-1] + 1; ++ if ( n_points < 0 ) ++ goto Invalid_Outline; ++ } + + error = FT_GlyphLoader_CheckPoints( gloader, n_points + 4, 0 ); + if ( error ) +@@ -771,7 +775,7 @@ + { + FT_GlyphLoader gloader = load->gloader; + FT_Outline* outline = &gloader->current.outline; +- FT_UInt n_points = outline->n_points; ++ FT_Int n_points = outline->n_points; + #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + FT_UInt n_ins; + #endif +@@ -838,7 +842,7 @@ + FT_Vector* deltas; + FT_Memory memory = load->face->memory; + FT_StreamRec saved_stream = *(load->stream); +- FT_UInt i; ++ FT_Int i; + + + /* TT_Vary_Get_Glyph_Deltas uses a frame, thus we have to save */ --- freetype-2.1.10.orig/debian/patches/031-compile-unpatented-hinting.diff +++ freetype-2.1.10/debian/patches/031-compile-unpatented-hinting.diff @@ -0,0 +1,11 @@ +--- freetype-2.1.4~/include/freetype/config/ftoption.h 2003-05-21 02:24:06.000000000 +0800 ++++ freetype-2.1.4/include/freetype/config/ftoption.h 2003-05-24 20:40:55.000000000 +0800 +@@ -410,7 +410,7 @@ + /* defining TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to */ + /* select it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */ + /* */ +-/* #define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING */ ++#define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING + + + /*************************************************************************/