From a929ba9b205c9756f1c0d3c261185e3bacf7fdad Mon Sep 17 00:00:00 2001
From: Werner Lemberg
Date: Sun, 25 Jun 2000 06:47:11 +0000
Subject: [PATCH] applying formatting again
---
config/modules.mk | 2 +-
config/unix/config.guess | 324 ++++++--
config/unix/config.sub | 163 +++-
config/win32/w32-lcc.mk | 3 +-
docs/tutorial/index.html | 32 +-
src/base/ftextend.c | 1 +
src/base/ftglyph.c | 4 +-
src/base/ftmm.c | 6 +-
src/base/ftobjs.c | 924 +++++++++++-----------
src/base/ftoutln.c | 23 +-
src/cff/t2driver.c | 44 +-
src/cff/t2gload.c | 16 +-
src/cff/t2objs.c | 11 +-
src/cid/cidgload.c | 28 +-
src/cid/cidobjs.c | 10 +-
src/cid/cidparse.c | 4 +-
src/cid/cidriver.c | 56 +-
src/psnames/psdriver.h | 10 +-
src/psnames/psmodule.c | 166 ++--
src/psnames/psmodule.h | 6 +-
src/sfnt/sfdriver.c | 12 +-
src/sfnt/sfdriver.h | 2 +-
src/sfnt/ttcmap.c | 4 +-
src/sfnt/ttload.c | 32 +-
src/sfnt/ttpost.c | 2 +-
src/sfnt/ttsbit.c | 16 +-
src/truetype/ttdriver.c | 58 +-
src/truetype/ttgload.c | 123 +--
src/truetype/ttinterp.c | 20 +-
src/truetype/ttobjs.c | 23 +-
src/type1/t1afm.h | 72 +-
src/type1/t1driver.c | 357 ++++-----
src/type1/t1driver.h | 38 +-
src/type1/t1gload.c | 1611 ++++++++++++++++++++------------------
src/type1/t1gload.h | 379 ++++-----
src/type1/t1hinter.c | 1198 ++++++++++++++--------------
36 files changed, 3096 insertions(+), 2684 deletions(-)
diff --git a/config/modules.mk b/config/modules.mk
index 8215e2df5..110ee8128 100644
--- a/config/modules.mk
+++ b/config/modules.mk
@@ -51,7 +51,7 @@ make_module_list: clean_module_list
#
ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
OPEN_MODULE := @echo #
- CLOSE_MODULE := >> $(subst /,\,$(FT_MODULE_LIST))
+ CLOSE_MODULE := >> $(subst $(SEP),$(HOSTSEP),$(FT_MODULE_LIST))
else
OPEN_MODULE := @echo "
CLOSE_MODULE := " >> $(FT_MODULE_LIST)
diff --git a/config/unix/config.guess b/config/unix/config.guess
index e1b587170..499496436 100644
--- a/config/unix/config.guess
+++ b/config/unix/config.guess
@@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
-#
+
+version='2000-06-13'
+
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -23,8 +25,7 @@
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner .
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-# Please send patches to .
+# Please send patches to .
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -37,6 +38,46 @@
# (but try to keep the structure clean).
#
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of this system.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit"
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case "$1" in
+ --version | --vers* | -V )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ exec >&2
+ echo "$me: invalid option $1"
+ echo "$help"
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
@@ -68,6 +109,43 @@ trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # Netbsd (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ # Determine the machine/vendor (is the vendor relevant).
+ case "${UNAME_MACHINE}" in
+ amiga) machine=m68k-cbm ;;
+ arm32) machine=arm-unknown ;;
+ atari*) machine=m68k-atari ;;
+ sun3*) machine=m68k-sun ;;
+ mac68k) machine=m68k-apple ;;
+ macppc) machine=powerpc-apple ;;
+ hp3[0-9][05]) machine=m68k-hp ;;
+ ibmrt|romp-ibm) machine=romp-ibm ;;
+ *) machine=${UNAME_MACHINE}-unknown ;;
+ esac
+ # The Operating System including object format.
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ # The OS release
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -77,41 +155,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <$dummy.s
+ .data
+\$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
.globl main
+ .align 4
.ent main
main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
.end main
EOF
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./$dummy
- case "$?" in
- 7)
+ case `./$dummy` in
+ 0-0)
UNAME_MACHINE="alpha"
;;
- 15)
+ 1-0)
UNAME_MACHINE="alphaev5"
;;
- 14)
+ 1-1)
UNAME_MACHINE="alphaev56"
;;
- 10)
+ 1-101)
UNAME_MACHINE="alphapca56"
;;
- 16)
+ 2-303)
UNAME_MACHINE="alphaev6"
;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
esac
fi
rm -f $dummy.s $dummy
@@ -129,9 +217,6 @@ EOF
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -162,9 +247,6 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
- arm32:NetBSD:*:*)
- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
@@ -221,15 +303,12 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
+ # "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
@@ -253,15 +332,9 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -274,9 +347,6 @@ EOF
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
- macppc:NetBSD:*:*)
- echo powerpc-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
@@ -292,6 +362,7 @@ EOF
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
+#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -331,7 +402,7 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
@@ -408,7 +479,7 @@ EOF
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
@@ -429,6 +500,8 @@ EOF
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
#include
#include
@@ -553,10 +626,13 @@ EOF
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
- echo alpha-cray-unicosmk${UNAME_RELEASE}
+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
@@ -569,13 +645,10 @@ EOF
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+ i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@@ -585,17 +658,8 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
- if test -x /usr/bin/objformat; then
- if test "elf" = "`/usr/bin/objformat`"; then
- echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
- exit 0
- fi
- fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
- exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
@@ -623,6 +687,9 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
@@ -644,6 +711,10 @@ EOF
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
+ elf_i?86)
+ echo "${UNAME_MACHINE}-pc-linux"
+ exit 0
+ ;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
@@ -657,7 +728,7 @@ EOF
exit 0
;;
elf32arm*)
- echo "${UNAME_MACHINE}-unknown-linux-gnu"
+ echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0
;;
armelf_linux*)
@@ -668,7 +739,7 @@ EOF
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
- elf32ppc)
+ elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <
@@ -695,51 +766,65 @@ EOF
if test "$?" = 0 ; then
LIBC="libc1"
fi
- fi
+ fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
+ shelf_linux)
+ echo "${UNAME_MACHINE}-unknown-linux-gnu"
+ exit 0
+ ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <$dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
+ cat <$dummy.s
+ .data
+ \$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
+ .globl main
+ .align 4
+ .ent main
+ main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./$dummy
- case "$?" in
- 7)
+ case `./$dummy` in
+ 0-0)
UNAME_MACHINE="alpha"
;;
- 15)
+ 1-0)
UNAME_MACHINE="alphaev5"
;;
- 14)
+ 1-1)
UNAME_MACHINE="alphaev56"
;;
- 10)
+ 1-101)
UNAME_MACHINE="alphapca56"
;;
- 16)
+ 2-303)
UNAME_MACHINE="alphaev6"
;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
esac
objdump --private-headers $dummy | \
@@ -753,6 +838,7 @@ EOF
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c < /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -768,6 +854,8 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
+ elif test "${UNAME_MACHINE}" = "s390"; then
+ echo s390-ibm-linux && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -789,6 +877,7 @@ EOF
cat >$dummy.c <
#ifdef __cplusplus
+#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -860,7 +949,11 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
+ i?86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
pc:*:*:*)
+ # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
@@ -974,8 +1067,26 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
+ *:Darwin:*:*)
+ echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ if test "${UNAME_MACHINE}" = "x86pc"; then
+ UNAME_MACHINE=pc
+ fi
+ echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+ exit 0 ;;
*:QNX:*:4*)
- echo i386-qnx-qnx${UNAME_VERSION}
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-W:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
esac
@@ -1116,6 +1227,47 @@ then
esac
fi
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 < in order to provide the needed
+information to handle your system.
+
+config.guess version = $version
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "version='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/unix/config.sub b/config/unix/config.sub
index 28426bb8f..6e5f1a80c 100644
--- a/config/unix/config.sub
+++ b/config/unix/config.sub
@@ -1,6 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+version='2000-06-20'
+
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -25,6 +29,8 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+# Please send patches to .
+#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
@@ -45,30 +51,61 @@
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit"
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case "$1" in
+ --version | --vers* | -V )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ exec >&2
+ echo "$me: invalid option $1"
+ echo "$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- linux-gnu*)
+ nto-qnx* | linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -94,7 +131,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
+ -apple | -axis)
os=
basic_machine=$1
;;
@@ -169,15 +206,19 @@ case $basic_machine in
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
+ | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+ | hppa64 \
+ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
+ | alphaev6[78] \
+ | we32k | ns16k | clipper | i370 | sh | sh[34] \
+ | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
- | thumb | d10v | fr30)
+ | thumb | d10v | fr30 | avr)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
@@ -186,7 +227,7 @@ case $basic_machine in
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
+ i[234567]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -196,13 +237,16 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
- vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
+ vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
- | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
+ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
+ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
+ | hppa2.0n-* | hppa64-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+ | alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
@@ -210,9 +254,10 @@ case $basic_machine in
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
- | f301-* | armv*-* | t3e-* \
+ | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
- | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
+ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
+ | bs2000-* | tic54x-* | c54x-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -310,6 +355,9 @@ case $basic_machine in
crds | unos)
basic_machine=m68k-crds
;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -464,9 +512,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-mingw32
;;
- i386-qnx | qnx)
- basic_machine=i386-qnx
- ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -513,6 +558,10 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -585,6 +634,9 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
@@ -617,7 +669,7 @@ case $basic_machine in
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
- pentiumpro | p6 | 6x86)
+ pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
@@ -626,7 +678,7 @@ case $basic_machine in
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | 6x86-*)
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -729,6 +781,10 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
symmetry)
basic_machine=i386-sequent
os=-dynix
@@ -737,6 +793,10 @@ case $basic_machine in
basic_machine=t3e-cray
os=-unicos
;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -838,6 +898,9 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
+ sh3 | sh4)
+ base_machine=sh-unknown
+ ;;
sparc | sparcv9)
basic_machine=sparc-sun
;;
@@ -918,12 +981,25 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i[34567]86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto*)
+ os=-nto-qnx
+ ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
@@ -940,6 +1016,9 @@ case $os in
-opened*)
os=-openedition
;;
+ -wince*)
+ os=-wince
+ ;;
-osfrose*)
os=-osfrose
;;
@@ -964,6 +1043,9 @@ case $os in
-ns2 )
os=-nextstep2
;;
+ -nsk)
+ os=-nsk
+ ;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -977,9 +1059,6 @@ case $os in
-oss*)
os=-sysv3
;;
- -qnx)
- os=-qnx4
- ;;
-svr4)
os=-sysv4
;;
@@ -1230,3 +1309,11 @@ case $basic_machine in
esac
echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "version='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/win32/w32-lcc.mk b/config/win32/w32-lcc.mk
index f042d2382..1ac7b8250 100644
--- a/config/win32/w32-lcc.mk
+++ b/config/win32/w32-lcc.mk
@@ -119,7 +119,8 @@ ifdef BUILD_FREETYPE
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
- lcclib /out:$(subst /,\\,$@) $(subst /,\\,$(OBJECTS_LIST))
+ lcclib /out:$(subst $(SEP),$(HOSTSEP),$@) \
+ $(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST))
endif
diff --git a/docs/tutorial/index.html b/docs/tutorial/index.html
index a9e04edf7..b09b696f8 100644
--- a/docs/tutorial/index.html
+++ b/docs/tutorial/index.html
@@ -94,7 +94,7 @@
Load each modules that FreeType knows about in the library.
This means that by default, your new library object is able
- to handle TrueType, Type 1, CID-keyed & OpenType/CFF fonts
+ to handle TrueType, Type 1, CID-keyed & OpenType/CFF fonts
gracefully.
@@ -240,7 +240,8 @@
FreeType 2 reference manual in order to learn how to use it.
Note that providing a custom stream might also be used to access a
- TrueType font embedded in a Postscript Type42 wrapper..
+ TrueType font embedded in a Postscript Type 42 wrapper.
+
@@ -487,27 +488,26 @@
If there is a glyph image in another format (e.g. a vectorial
- outline), load it in the glyph slot. Then, scale it to the
- current size, unless the FT_LOAD_NO_SCALE flag is
- set.
+ outline), load it in the glyph slot. Then, scale it to the
+ current size, unless the FT_LOAD_NO_SCALE flag is
+ set.
-
If the glyph image was loaded and scaled, try to grid-fit it (which
- dramatically improves its quality) unless the flag
+
If the glyph image was loaded and scaled, try to grid-fit it
+ (which dramatically improves its quality) unless the flag
FT_LOAD_NO_HINTING is set.
-
-
If the glyph image is scalable, transform it through the current
- transform (that can be set with FT_Set_Transform).
+
If the glyph image is scalable, transform it through the
+ current transform (which can be set with
+ FT_Set_Transform()).
-
-
Finally, if the FT_LOAD_RENDER flag is set, convert the
- glyph image into a bitmap. By default, this means a 1-bit
- monochrome bitmap, unless FT_LOAD_ANTI_ALIAS is set,
- where an 8-bit 256-gray-levels anti-aliased bitmap is generated.
-
+
Finally, if the FT_LOAD_RENDER flag is set, convert
+ the glyph image into a bitmap. By default, this means a 1-bit
+ monochrome bitmap, unless FT_LOAD_ANTI_ALIAS is set,
+ in which case an 8-bit 256-gray-levels anti-aliased bitmap is
+ generated.
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 7b4f22283..0ac950156 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -143,6 +143,7 @@
FT_Int n = registry->num_extensions;
FT_Extension_Class* cur = registry->classes + n;
+
if ( n >= FT_MAX_EXTENSIONS )
return FT_Err_Too_Many_Extensions;
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 33f09b502..472143cf2 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -210,8 +210,8 @@
/* transform the outline -- note that the original metrics are NOT */
/* transformed by this, only the outline points themselves... */
FT_Outline_Translate( &face->glyph->outline,
- origin_x,
- origin_y );
+ origin_x,
+ origin_y );
/* compute the size in pixels of the outline */
FT_Outline_Get_CBox( &face->glyph->outline, &cbox );
diff --git a/src/base/ftmm.c b/src/base/ftmm.c
index 4f6457261..a8c6871f1 100644
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -48,7 +48,7 @@
func = (FT_Get_MM_Func)driver->root.clazz->get_interface(
- FT_MODULE(driver), "get_mm" );
+ FT_MODULE( driver ), "get_mm" );
if ( func )
error = func( face, master );
}
@@ -77,7 +77,7 @@
func = (FT_Set_MM_Design_Func)driver->root.clazz->get_interface(
- FT_MODULE(driver), "set_mm_design" );
+ FT_MODULE( driver ), "set_mm_design" );
if ( func )
error = func( face, num_coords, coords );
}
@@ -106,7 +106,7 @@
func = (FT_Set_MM_Blend_Func)driver->root.clazz->get_interface(
- FT_MODULE(driver), "set_mm_blend" );
+ FT_MODULE( driver ), "set_mm_blend" );
if ( func )
error = func( face, num_coords, coords );
}
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index f8889add2..843bf0f2b 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -23,6 +23,8 @@
#include
+#include /* for strcmp() */
+
/*************************************************************************/
/*************************************************************************/
@@ -325,38 +327,43 @@
/*************************************************************************/
/*************************************************************************/
- /**************************************************************************
- *
- * The glyph loader is a simple object which is used to load a set of
- * glyphs easily. It is critical for the correct loading of composites.
- *
- * Ideally, one can see it as a stack of abstract "glyph" objects.
- *
- * loader.base is really the bottom of the stack. It describes a
- * single glyph image made of the juxtaposition of several
- * glyphs (those 'in the stack')
- *
- * loader.current describes the top of the stack, on which a new
- * glyph can be loaded.
- *
- * Rewind clears the stack
- * Prepare means set up "loader.current" for addition of a new glyph image
- * Add means add the 'current' glyph image to the 'base' one, and
- * prepare for another one..
- *
- * the glyph loader is now a base object. Each driver used to re-implement
- * it in one way or the other, which wasted code and energy..
- *
- *************************************************************************/
-
- /* create a new glyph loader */
- BASE_FUNC(FT_Error) FT_GlyphLoader_New( FT_Memory memory,
- FT_GlyphLoader* *aloader )
+
+ /*************************************************************************/
+ /* */
+ /* The glyph loader is a simple object which is used to load a set of */
+ /* glyphs easily. It is critical for the correct loading of composites. */
+ /* */
+ /* Ideally, one can see it as a stack of abstract `glyph' objects. */
+ /* */
+ /* loader.base Is really the bottom of the stack. It describes a */
+ /* single glyph image made of the juxtaposition of */
+ /* several glyphs (those `in the stack'). */
+ /* */
+ /* loader.current Describes the top of the stack, on which a new */
+ /* glyph can be loaded. */
+ /* */
+ /* Rewind Clears the stack. */
+ /* Prepare Set up `loader.current' for addition of a new glyph */
+ /* image. */
+ /* Add Add the `current' glyph image to the `base' one, */
+ /* and prepare for another one. */
+ /* */
+ /* The glyph loader is now a base object. Each driver used to */
+ /* re-implement it in one way or the other, which wasted code and */
+ /* energy. */
+ /* */
+ /*************************************************************************/
+
+
+ /* create a new glyph loader */
+ BASE_FUNC( FT_Error ) FT_GlyphLoader_New( FT_Memory memory,
+ FT_GlyphLoader** aloader )
{
FT_GlyphLoader* loader;
FT_Error error;
- if (!ALLOC(loader, sizeof(*loader)))
+
+ if ( !ALLOC( loader, sizeof ( *loader ) ) )
{
loader->memory = memory;
*aloader = loader;
@@ -365,12 +372,13 @@
}
- /* rewind the glyph loader - reset counters to 0 */
- BASE_FUNC(void) FT_GlyphLoader_Rewind( FT_GlyphLoader* loader )
+ /* rewind the glyph loader - reset counters to 0 */
+ BASE_FUNC( void ) FT_GlyphLoader_Rewind( FT_GlyphLoader* loader )
{
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
+
base->outline.n_points = 0;
base->outline.n_contours = 0;
base->num_subglyphs = 0;
@@ -379,11 +387,13 @@
}
- /* reset the glyph loader, frees all allocated tables and starts from zero */
- BASE_FUNC(void) FT_GlyphLoader_Reset( FT_GlyphLoader* loader )
+ /* reset the glyph loader, frees all allocated tables */
+ /* and starts from zero */
+ BASE_FUNC( void ) FT_GlyphLoader_Reset( FT_GlyphLoader* loader )
{
FT_Memory memory = loader->memory;
+
FREE( loader->base.outline.points );
FREE( loader->base.outline.tags );
FREE( loader->base.outline.contours );
@@ -398,69 +408,73 @@
}
- /* delete a glyph loader */
- BASE_FUNC(void) FT_GlyphLoader_Done( FT_GlyphLoader* loader )
+ /* delete a glyph loader */
+ BASE_FUNC( void ) FT_GlyphLoader_Done( FT_GlyphLoader* loader )
{
- if (loader)
+ if ( loader )
{
FT_Memory memory = loader->memory;
+
FT_GlyphLoader_Reset(loader);
FREE( loader );
}
}
- /* re-adjust the 'current' outline fields */
- static void FT_GlyphLoader_Adjust_Points( FT_GlyphLoader* loader )
+ /* re-adjust the `current' outline fields */
+ static void FT_GlyphLoader_Adjust_Points( FT_GlyphLoader* loader )
{
FT_Outline* base = &loader->base.outline;
FT_Outline* current = &loader->current.outline;
+
current->points = base->points + base->n_points;
current->tags = base->tags + base->n_points;
current->contours = base->contours + base->n_contours;
/* handle extra points table - if any */
- if (loader->use_extra)
- loader->current.extra_points = loader->base.extra_points + base->n_points;
+ if ( loader->use_extra )
+ loader->current.extra_points =
+ loader->base.extra_points + base->n_points;
}
-
- BASE_FUNC(FT_Error) FT_GlyphLoader_Create_Extra( FT_GlyphLoader* loader )
+ BASE_FUNC( FT_Error ) FT_GlyphLoader_Create_Extra(
+ FT_GlyphLoader* loader )
{
FT_Error error;
FT_Memory memory = loader->memory;
+
if ( !ALLOC_ARRAY( loader->base.extra_points,
loader->max_points, FT_Vector ) )
{
loader->use_extra = 1;
- FT_GlyphLoader_Adjust_Points(loader);
+ FT_GlyphLoader_Adjust_Points( loader );
}
return error;
}
-
-
- /* re-adjust the 'current' subglyphs field */
- static void FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader* loader )
+ /* re-adjust the `current' subglyphs field */
+ static void FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader* loader )
{
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
+
current->subglyphs = base->subglyphs + base->num_subglyphs;
}
- /* ensure that we can add n_points and n_contours to our glyph. this */
- /* function reallocates its outline tables if necessary. Note that */
- /* it DOESN'T change the number of points within the loader !! */
- BASE_FUNC(FT_Error) FT_GlyphLoader_Check_Points( FT_GlyphLoader* loader,
- FT_UInt n_points,
- FT_UInt n_contours )
+ /* Ensure that we can add `n_points' and `n_contours' to our glyph. this */
+ /* function reallocates its outline tables if necessary. Note that it */
+ /* DOESN'T change the number of points within the loader! */
+ BASE_FUNC( FT_Error ) FT_GlyphLoader_Check_Points(
+ FT_GlyphLoader* loader,
+ FT_UInt n_points,
+ FT_UInt n_contours )
{
FT_Memory memory = loader->memory;
FT_Error error = FT_Err_Ok;
@@ -470,18 +484,21 @@
FT_UInt new_max;
+
/* check points & tags */
new_max = base->n_points + current->n_points + n_points;
- if (new_max > loader->max_points)
+ if ( new_max > loader->max_points )
{
- new_max = (new_max+7) & -8;
- if ( REALLOC_ARRAY( base->points, base->n_points, new_max, FT_Vector ) ||
- REALLOC_ARRAY( base->tags, base->n_points, new_max, FT_Byte ) )
+ new_max = ( new_max + 7 ) & -8;
+ if ( REALLOC_ARRAY( base->points, base->n_points,
+ new_max, FT_Vector ) ||
+ REALLOC_ARRAY( base->tags, base->n_points,
+ new_max, FT_Byte ) )
goto Exit;
if ( loader->use_extra &&
- REALLOC_ARRAY( loader->base.extra_points, base->n_points, new_max,
- FT_Vector ) )
+ REALLOC_ARRAY( loader->base.extra_points, base->n_points,
+ new_max, FT_Vector ) )
goto Exit;
adjust = 1;
@@ -491,17 +508,18 @@
/* check contours */
new_max = base->n_contours + current->n_contours +
n_contours;
- if (new_max > loader->max_contours)
+ if ( new_max > loader->max_contours )
{
- new_max = (new_max+3) & -4;
- if (REALLOC_ARRAY( base->contours, base->n_contours, new_max, FT_Short ))
+ new_max = ( new_max + 3 ) & -4;
+ if ( REALLOC_ARRAY( base->contours, base->n_contours,
+ new_max, FT_Short ) )
goto Exit;
adjust = 1;
loader->max_contours = new_max;
}
- if (adjust)
+ if ( adjust )
FT_GlyphLoader_Adjust_Points( loader );
Exit:
@@ -509,11 +527,12 @@
}
- /* ensure that we can add n_subglyphs to our glyph. this function */
- /* reallocates its subglyphs table if necessary. Note that it DOES */
- /* NOT change the number of subglyphs within the loader !! */
- BASE_FUNC(FT_Error) FT_GlyphLoader_Check_Subglyphs( FT_GlyphLoader* loader,
- FT_UInt n_subs )
+ /* Ensure that we can add `n_subglyphs' to our glyph. this function */
+ /* reallocates its subglyphs table if necessary. Note that it DOES */
+ /* NOT change the number of subglyphs within the loader! */
+ BASE_FUNC( FT_Error ) FT_GlyphLoader_Check_Subglyphs(
+ FT_GlyphLoader* loader,
+ FT_UInt n_subs )
{
FT_Memory memory = loader->memory;
FT_Error error = FT_Err_Ok;
@@ -522,12 +541,13 @@
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
+
new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
- if (new_max > loader->max_subglyphs)
+ if ( new_max > loader->max_subglyphs )
{
- new_max = (new_max+1) & -2;
- if (REALLOC_ARRAY( base->subglyphs, base->num_subglyphs,
- new_max, FT_SubGlyph ))
+ new_max = ( new_max + 1 ) & -2;
+ if ( REALLOC_ARRAY( base->subglyphs, base->num_subglyphs,
+ new_max, FT_SubGlyph ) )
goto Exit;
loader->max_subglyphs = new_max;
@@ -540,11 +560,12 @@
}
- /* prepare loader for the addition of a new glyph on top of the base one */
- BASE_FUNC(void) FT_GlyphLoader_Prepare( FT_GlyphLoader* loader )
+ /* prepare loader for the addition of a new glyph on top of the base one */
+ BASE_FUNC( void ) FT_GlyphLoader_Prepare( FT_GlyphLoader* loader )
{
FT_GlyphLoad* current = &loader->current;
+
current->outline.n_points = 0;
current->outline.n_contours = 0;
current->num_subglyphs = 0;
@@ -554,8 +575,8 @@
}
- /* add current glyph to the base image - and prepare for another */
- BASE_FUNC(void) FT_GlyphLoader_Add( FT_GlyphLoader* loader )
+ /* add current glyph to the base image - and prepare for another */
+ BASE_FUNC( void ) FT_GlyphLoader_Add( FT_GlyphLoader* loader )
{
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
@@ -564,6 +585,7 @@
FT_UInt n_base_points = base->outline.n_points;
FT_UInt n;
+
base->outline.n_points += current->outline.n_points;
base->outline.n_contours += current->outline.n_contours;
base->num_subglyphs += current->num_subglyphs;
@@ -577,38 +599,44 @@
}
- BASE_FUNC(FT_Error) FT_GlyphLoader_Copy_Points( FT_GlyphLoader* target,
- FT_GlyphLoader* source )
+ BASE_FUNC( FT_Error ) FT_GlyphLoader_Copy_Points(
+ FT_GlyphLoader* target,
+ FT_GlyphLoader* source )
{
FT_Error error;
FT_UInt num_points = source->base.outline.n_points;
FT_UInt num_contours = source->base.outline.n_contours;
+
error = FT_GlyphLoader_Check_Points( target, num_points, num_contours );
- if (!error)
+ if ( !error )
{
FT_Outline* out = &target->base.outline;
FT_Outline* in = &source->base.outline;
+
- MEM_Copy( out->points, in->points, num_points * sizeof(FT_Vector) );
- MEM_Copy( out->tags, in->tags, num_points * sizeof(char) );
- MEM_Copy( out->contours, in->contours, num_contours * sizeof(short) );
+ MEM_Copy( out->points, in->points,
+ num_points * sizeof ( FT_Vector ) );
+ MEM_Copy( out->tags, in->tags,
+ num_points * sizeof ( char ) );
+ MEM_Copy( out->contours, in->contours,
+ num_contours * sizeof ( short ) );
- /* do we need to copy the extra points ? */
- if (target->use_extra && source->use_extra)
+ /* do we need to copy the extra points? */
+ if ( target->use_extra && source->use_extra )
MEM_Copy( target->base.extra_points, source->base.extra_points,
- num_points * sizeof(FT_Vector) );
+ num_points * sizeof ( FT_Vector ) );
out->n_points = num_points;
out->n_contours = num_contours;
FT_GlyphLoader_Adjust_Points( target );
}
+
return error;
}
-
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -628,22 +656,23 @@
FT_Memory memory = driver->root.memory;
FT_Error error = FT_Err_Ok;
- if (FT_DRIVER_USES_OUTLINES(driver))
+
+ if ( FT_DRIVER_USES_OUTLINES( driver ) )
error = FT_GlyphLoader_New( memory, &slot->loader );
- if (!error && clazz->init_slot)
+ if ( !error && clazz->init_slot )
error = clazz->init_slot( slot );
return error;
}
- static void ft_glyphslot_clear( FT_GlyphSlot slot )
+ static void ft_glyphslot_clear( FT_GlyphSlot slot )
{
/* clear all public fields in the glyph slot */
- MEM_Set( &slot->metrics, 0, sizeof(slot->metrics) );
- MEM_Set( &slot->outline, 0, sizeof(slot->outline) );
- MEM_Set( &slot->bitmap, 0, sizeof(slot->bitmap) );
+ MEM_Set( &slot->metrics, 0, sizeof ( slot->metrics ) );
+ MEM_Set( &slot->outline, 0, sizeof ( slot->outline ) );
+ MEM_Set( &slot->bitmap, 0, sizeof ( slot->bitmap ) );
slot->bitmap_left = 0;
slot->bitmap_top = 0;
@@ -659,30 +688,29 @@
}
- static void ft_glyphslot_done( FT_GlyphSlot slot )
+ static void ft_glyphslot_done( FT_GlyphSlot slot )
{
FT_Driver driver = slot->face->driver;
FT_Driver_Class* clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
+
/* free bitmap buffer if needed */
if ( slot->flags & ft_glyph_own_bitmap )
FREE( slot->bitmap.buffer );
/* free glyph loader */
- if (FT_DRIVER_USES_OUTLINES(driver))
+ if ( FT_DRIVER_USES_OUTLINES( driver ) )
{
FT_GlyphLoader_Done( slot->loader );
slot->loader = 0;
}
- if (clazz->done_slot)
+ if ( clazz->done_slot )
clazz->done_slot( slot );
}
-
-
/*************************************************************************/
/* */
/* */
@@ -703,15 +731,15 @@
/* */
/* FreeType error code. 0 means success. */
/* */
-
FT_EXPORT_FUNC( FT_Error ) FT_New_GlyphSlot( FT_Face face,
FT_GlyphSlot* aslot )
{
- FT_Error error;
- FT_Driver driver;
- FT_Driver_Class* clazz;
- FT_Memory memory;
- FT_GlyphSlot slot;
+ FT_Error error;
+ FT_Driver driver;
+ FT_Driver_Class* clazz;
+ FT_Memory memory;
+ FT_GlyphSlot slot;
+
*aslot = 0;
@@ -728,7 +756,7 @@
slot->face = face;
error = ft_glyphslot_init( slot );
- if (error)
+ if ( error )
{
ft_glyphslot_done( slot );
FREE( slot );
@@ -766,15 +794,17 @@
FT_GlyphSlot* parent;
FT_GlyphSlot cur;
+
/* Remove slot from its parent face's list */
parent = &slot->face->glyph;
cur = *parent;
+
while ( cur )
{
if ( cur == slot )
{
*parent = cur->next;
- ft_glyphslot_done(slot);
+ ft_glyphslot_done( slot );
FREE( slot );
break;
}
@@ -784,9 +814,8 @@
}
-
- /* forward declaration */
- static FT_Renderer ft_lookup_glyph_renderer( FT_GlyphSlot slot );
+ /* forward declaration */
+ static FT_Renderer ft_lookup_glyph_renderer( FT_GlyphSlot slot );
/*************************************************************************/
@@ -796,8 +825,8 @@
/* */
/* */
/* A function used to set the transformation that is applied to glyph */
- /* images just before they're converted to bitmaps in a glyph slot */
- /* when FT_Render_Glyph is called.. */
+ /* images just before they are converted to bitmaps in a glyph slot */
+ /* when FT_Render_Glyph() is called. */
/* */
/* */
/* face :: A handle to the source face object. */
@@ -882,10 +911,9 @@
/* transformed with the information passed to a previous call to */
/* FT_Set_Transform. */
/* */
- /* Note that this also transforms the "face.glyph.advance" field, */
- /* but **NOT** the values in "face.glyph.metrics".. */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
/* */
-
FT_EXPORT_FUNC( FT_Error ) FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
FT_Int load_flags )
@@ -894,6 +922,7 @@
FT_Driver driver;
FT_GlyphSlot slot;
+
if ( !face || !face->size || !face->glyph )
return FT_Err_Invalid_Face_Handle;
@@ -913,10 +942,11 @@
face->size,
glyph_index,
load_flags );
- if (error) goto Exit;
+ if ( error )
+ goto Exit;
/* compute the advance */
- if (load_flags & FT_LOAD_VERTICAL_LAYOUT)
+ if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
slot->advance.x = 0;
slot->advance.y = slot->metrics.vertAdvance;
@@ -928,12 +958,13 @@
}
/* now, transform the glyph image when needed */
- if (face->transform_flags)
+ if ( face->transform_flags )
{
/* get renderer */
FT_Renderer renderer = ft_lookup_glyph_renderer( slot );
- if (renderer)
+
+ if ( renderer )
error = renderer->clazz->transform_glyph( renderer, slot,
&face->transform_matrix,
&face->transform_delta );
@@ -953,7 +984,7 @@
/* */
/* */
/* A function used to load a single glyph within a given glyph slot, */
- /* for a given size, according to its character code ! */
+ /* for a given size, according to its character code. */
/* */
/* */
/* face :: A handle to a target face object where the glyph */
@@ -967,21 +998,22 @@
/* glyph loading process (e.g., whether the outline */
/* should be scaled, whether to load bitmaps or not, */
/* whether to hint the outline, etc). */
+ /* */
/* */
/* FreeType error code. 0 means success. */
/* */
/* */
/* If the face has no current charmap, or if the character code */
/* is not defined in the charmap, this function will return an */
- /* error.. */
+ /* error. */
/* */
/* If the glyph image is not a bitmap, and if the bit flag */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
/* transformed with the information passed to a previous call to */
- /* FT_Set_Transform. */
+ /* FT_Set_Transform(). */
/* */
- /* Note that this also transforms the "face.glyph.advance" field, */
- /* but **NOT** the values in "face.glyph.metrics".. */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Load_Char( FT_Face face,
FT_ULong char_code,
@@ -989,11 +1021,12 @@
{
FT_UInt glyph_index;
+
if ( !face )
return FT_Err_Invalid_Face_Handle;
glyph_index = (FT_UInt)char_code;
- if (face->charmap)
+ if ( face->charmap )
glyph_index = FT_Get_Char_Index( face, char_code );
return glyph_index ? FT_Load_Glyph( face, glyph_index, load_flags )
@@ -1001,8 +1034,6 @@
}
-
-
/* destructor for sizes list */
static
void destroy_size( FT_Memory memory,
@@ -1010,11 +1041,11 @@
FT_Driver driver )
{
/* finalize client-specific data */
- if (size->generic.finalizer)
+ if ( size->generic.finalizer )
size->generic.finalizer( size );
/* finalize format-specific stuff */
- if (driver->clazz->done_size)
+ if ( driver->clazz->done_size )
driver->clazz->done_size( size );
FREE( size );
@@ -1029,6 +1060,7 @@
{
FT_Driver_Class* clazz = driver->clazz;
+
/* Discard glyph slots for this face */
/* Beware! FT_Done_GlyphSlot() changes the field `face->slot' */
while ( face->glyph )
@@ -1046,11 +1078,11 @@
face->generic.finalizer( face );
/* finalize format-specific stuff */
- if (clazz->done_face)
- clazz->done_face(face);
+ if ( clazz->done_face )
+ clazz->done_face( face );
/* close the stream for this face if needed */
- if ( (face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM) == 0 )
+ if ( ( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) == 0 )
ft_done_stream( &face->stream );
/* get rid of it */
@@ -1066,14 +1098,11 @@
driver );
/* see if we need to drop the driver's glyph loader */
- if (FT_DRIVER_USES_OUTLINES(driver))
+ if ( FT_DRIVER_USES_OUTLINES( driver ) )
FT_GlyphLoader_Done( driver->glyph_loader );
-
-
}
-
/*************************************************************************/
/* */
/* */
@@ -1095,6 +1124,7 @@
FT_Face face = 0;
FT_Error error;
+
clazz = driver->clazz;
memory = driver->root.memory;
@@ -1173,6 +1203,7 @@
{
FT_Open_Args args;
+
/* test for valid `library' and `aface' delayed to FT_Open_Face() */
if ( !pathname )
return FT_Err_Invalid_Argument;
@@ -1232,6 +1263,7 @@
{
FT_Open_Args args;
+
/* test for valid `library' and `face' delayed to FT_Open_Face() */
if ( !file_base )
return FT_Err_Invalid_Argument;
@@ -1315,14 +1347,15 @@
/* it. Otherwise, we'll scan the list of registered drivers. */
if ( args->flags & ft_open_driver && args->driver )
{
- driver = FT_DRIVER(args->driver);
+ driver = FT_DRIVER( args->driver );
/* not all modules are drivers, so check... */
- if ( FT_MODULE_IS_DRIVER(driver) )
+ if ( FT_MODULE_IS_DRIVER( driver ) )
{
FT_Int num_params = 0;
FT_Parameter* params = 0;
+
if ( args->flags & ft_open_params )
{
num_params = args->num_params;
@@ -1346,15 +1379,17 @@
FT_Module* cur = library->modules;
FT_Module* limit = cur + library->num_modules;
+
for ( ; cur < limit; cur++ )
{
/* not all modules are font drivers, so check... */
- if ( FT_MODULE_IS_DRIVER(cur[0]) )
+ if ( FT_MODULE_IS_DRIVER( cur[0] ) )
{
FT_Int num_params = 0;
FT_Parameter* params = 0;
- driver = FT_DRIVER(cur[0]);
+
+ driver = FT_DRIVER( cur[0] );
if ( args->flags & ft_open_params )
{
@@ -1525,6 +1560,7 @@
FT_Driver_Class* clazz;
+
/* test for valid `parameters' delayed to ft_new_input_stream() */
if ( !face )
@@ -1543,11 +1579,11 @@
error = FT_Err_Unimplemented_Feature;
clazz = driver->clazz;
- if (clazz->attach_file)
+ if ( clazz->attach_file )
error = clazz->attach_file( face, stream );
/* close the attached stream */
- if ( !parameters->stream || (parameters->flags & ft_open_stream) )
+ if ( !parameters->stream || ( parameters->flags & ft_open_stream ) )
ft_done_stream( &stream );
Exit:
@@ -1572,10 +1608,11 @@
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Done_Face( FT_Face face )
{
- FT_Error error;
- FT_Driver driver;
- FT_Memory memory;
- FT_ListNode node;
+ FT_Error error;
+ FT_Driver driver;
+ FT_Memory memory;
+ FT_ListNode node;
+
error = FT_Err_Invalid_Face_Handle;
if ( face && face->driver )
@@ -1628,6 +1665,7 @@
FT_Size size = 0;
FT_ListNode node = 0;
+
*asize = 0;
if ( !face || !asize || !face->driver )
@@ -1644,7 +1682,7 @@
size->face = face;
- if (clazz->init_size)
+ if ( clazz->init_size )
error = clazz->init_size( size );
/* in case of success, add to the face's list */
@@ -1725,6 +1763,24 @@
}
+ static void ft_recompute_scaled_metrics( FT_Face face,
+ FT_Size_Metrics* metrics )
+ {
+ /* Compute root ascender, descender, test height, and max_advance */
+ metrics->ascender = ( FT_MulFix( face->ascender,
+ metrics->y_scale ) + 32 ) & -64;
+
+ metrics->descender = ( FT_MulFix( face->descender,
+ metrics->y_scale ) + 32 ) & -64;
+
+ metrics->height = ( FT_MulFix( face->height,
+ metrics->y_scale ) + 32 ) & -64;
+
+ metrics->max_advance = ( FT_MulFix( face->max_advance_width,
+ metrics->x_scale ) + 32 ) & -64;
+ }
+
+
/*************************************************************************/
/* */
/* */
@@ -1759,27 +1815,6 @@
/* When dealing with fixed-size faces (i.e., non-scalable formats), */
/* use the function FT_Set_Pixel_Sizes(). */
/* */
-
- static void ft_recompute_scaled_metrics( FT_Face face,
- FT_Size_Metrics* metrics )
- {
- /* Compute root ascender, descender, test height, and max_advance */
- metrics->ascender = ( FT_MulFix( face->ascender,
- metrics->y_scale ) + 32 ) & -64;
-
- metrics->descender = ( FT_MulFix( face->descender,
- metrics->y_scale ) + 32 ) & -64;
-
- metrics->height = ( FT_MulFix( face->height,
- metrics->y_scale ) + 32 ) & -64;
-
- metrics->max_advance = ( FT_MulFix( face->max_advance_width,
- metrics->x_scale ) + 32 ) & -64;
- }
-
-
-
-
FT_EXPORT_FUNC( FT_Error ) FT_Set_Char_Size( FT_Face face,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
@@ -1838,7 +1873,7 @@
ft_recompute_scaled_metrics( face, metrics );
- if (clazz->set_char_sizes)
+ if ( clazz->set_char_sizes )
error = clazz->set_char_sizes( face->size,
char_width,
char_height,
@@ -1913,7 +1948,7 @@
ft_recompute_scaled_metrics( face, metrics );
- if (clazz->set_pixel_sizes)
+ if ( clazz->set_pixel_sizes )
error = clazz->set_pixel_sizes( face->size,
pixel_width,
pixel_height );
@@ -1972,9 +2007,9 @@
if ( driver->clazz->get_kerning )
{
error = driver->clazz->get_kerning( face,
- left_glyph,
- right_glyph,
- kerning );
+ left_glyph,
+ right_glyph,
+ kerning );
}
else
{
@@ -2156,7 +2191,7 @@
driver = face->driver;
func = (FT_Get_Sfnt_Table_Func)driver->root.clazz->get_interface(
- FT_MODULE(driver), "get_sfnt" );
+ FT_MODULE( driver ), "get_sfnt" );
if ( func )
table = func( face, tag );
@@ -2180,28 +2215,30 @@
/* lookup a renderer by glyph format in the library's list */
static FT_Renderer ft_lookup_renderer( FT_Library library,
FT_Glyph_Format format,
- FT_ListNode *node )
+ FT_ListNode* node )
{
FT_ListNode cur = library->renderers.head;
FT_Renderer result = 0;
+
- if (node)
+ if ( node )
*node = 0;
- while (cur)
+ while ( cur )
{
- FT_Renderer renderer = FT_RENDERER(cur->data);
+ FT_Renderer renderer = FT_RENDERER( cur->data );
- if (renderer->glyph_format == format)
+
+ if ( renderer->glyph_format == format )
{
- if (node)
+ if ( node )
*node = cur;
result = renderer;
break;
}
-
}
+
return result;
}
@@ -2209,10 +2246,11 @@
static FT_Renderer ft_lookup_glyph_renderer( FT_GlyphSlot slot )
{
FT_Face face = slot->face;
- FT_Library library = FT_FACE_LIBRARY(face);
+ FT_Library library = FT_FACE_LIBRARY( face );
FT_Renderer result = library->cur_renderer;
+
- if (!result || result->glyph_format != slot->format)
+ if ( !result || result->glyph_format != slot->format )
result = ft_lookup_renderer( library, slot->format, 0 );
return result;
@@ -2235,13 +2273,14 @@
FT_Error error;
FT_ListNode node;
- if (ALLOC(node,sizeof(*node)))
+ if ( ALLOC( node, sizeof ( *node ) ) )
goto Exit;
{
- FT_Renderer render = FT_RENDERER(module);
+ FT_Renderer render = FT_RENDERER( module );
FT_Renderer_Class* clazz = (FT_Renderer_Class*)module->clazz;
+
render->clazz = clazz;
render->glyph_format = clazz->glyph_format;
@@ -2250,7 +2289,8 @@
clazz->raster_class->raster_new )
{
error = clazz->raster_class->raster_new( memory, &render->raster );
- if (error) goto Fail;
+ if ( error )
+ goto Fail;
render->raster_render = clazz->raster_class->raster_render;
render->render = clazz->render_glyph;
@@ -2264,8 +2304,8 @@
}
Fail:
- if (error)
- FREE(node);
+ if ( error )
+ FREE( node );
Exit:
return error;
@@ -2278,13 +2318,15 @@
FT_Memory memory = library->memory;
FT_ListNode node;
+
node = FT_List_Find( &library->renderers, module );
- if (node)
+ if ( node )
{
- FT_Renderer render = FT_RENDERER(module);
+ FT_Renderer render = FT_RENDERER( module );
+
/* release raster object, if any */
- if (render->raster)
+ if ( render->raster )
render->clazz->raster_class->raster_done( render->raster );
/* remove from list */
@@ -2296,74 +2338,73 @@
}
-
- /*************************************************************************
- *
- *
- * FT_Get_Renderer
- *
- *
- * retrieves the current renderer for a given glyph format.
- *
- *
- * library :: handle to library object
- * format :: glyph format
- *
- *
- * renderer handle. 0 if none found.
- *
- *
- * An error will be returned if a module already exists by that
- * name, or if the module requires a version of freetype that is
- * too great
- *
- * To add a new renderer, simply use FT_Add_Module. To retrieve
- * a renderer by its name, use FT_Get_Module
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(FT_Renderer) FT_Get_Renderer( FT_Library library,
- FT_Glyph_Format format )
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Get_Renderer */
+ /* */
+ /* */
+ /* Retrieves the current renderer for a given glyph format. */
+ /* */
+ /* */
+ /* library :: A handle to the library object. */
+ /* */
+ /* format :: The glyph format. */
+ /* */
+ /* */
+ /* A renderer handle. 0 if none found. */
+ /* */
+ /* */
+ /* An error will be returned if a module already exists by that name, */
+ /* or if the module requires a version of FreeType that is too great. */
+ /* */
+ /* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
+ /* renderer by its name, use FT_Get_Module(). */
+ /*
+ FT_EXPORT_FUNC( FT_Renderer ) FT_Get_Renderer( FT_Library library,
+ FT_Glyph_Format format )
{
return ft_lookup_renderer( library, format, 0 );
}
- /*************************************************************************
- *
- *
- * FT_Set_Renderer
- *
- *
- * Sets the current renderer to use, and set additional mode
- *
- *
- * library :: handle to library object
- * renderer :: handle to renderer object
- * num_params :: number of additional parameters
- * params :: additional parameters
- *
- *
- * Error code. 0 means success.
- *
- *
- * in case of success, the renderer will be used to convert glyph
- * images in the renderer's known format into bitmaps.
- *
- * This doesn't change the current renderer for other formats..
- *
- *************************************************************************/
-
- FT_EXPORT_DEF(FT_Error) FT_Set_Renderer( FT_Library library,
- FT_Renderer renderer,
- FT_UInt num_params,
- FT_Parameter* parameters )
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Set_Renderer */
+ /* */
+ /* */
+ /* Sets the current renderer to use, and set additional mode. */
+ /* */
+ /* */
+ /* library :: A handle to the library object. */
+ /* */
+ /* renderer :: A handle to the renderer object. */
+ /* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* params :: Additional parameters. */
+ /* */
+ /* */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* */
+ /* In case of success, the renderer will be used to convert glyph */
+ /* images in the renderer's known format into bitmaps. */
+ /* */
+ /* This doesn't change the current renderer for other formats. */
+ /* */
+ FT_EXPORT_DEF( FT_Error ) FT_Set_Renderer( FT_Library library,
+ FT_Renderer renderer,
+ FT_UInt num_params,
+ FT_Parameter* parameters )
{
FT_ListNode node;
FT_Error error = FT_Err_Ok;
+
node = FT_List_Find( &library->renderers, renderer );
- if (!node)
+ if ( !node )
{
error = FT_Err_Invalid_Argument;
goto Exit;
@@ -2371,17 +2412,18 @@
FT_List_Up( &library->renderers, node );
- if (renderer->glyph_format == ft_glyph_format_outline )
+ if ( renderer->glyph_format == ft_glyph_format_outline )
library->cur_renderer = renderer;
- if (num_params > 0)
+ if ( num_params > 0 )
{
FTRenderer_setMode set_mode = renderer->clazz->set_mode;
+
for ( ; num_params > 0; num_params-- )
{
error = set_mode( renderer, parameters->tag, parameters->data );
- if (error)
+ if ( error )
break;
}
}
@@ -2391,68 +2433,67 @@
}
-
- /*************************************************************************
- *
- *
- * FT_Render_Glyph
- *
- *
- * Converts a given glyph image to a bitmap. It does so by inspecting
- * the glyph image format, find the relevant renderer, and invoke it
- *
- *
- * slot :: handle to the glyph slot containing the image to
- * convert
- *
- * render_mode :: a set of bit flags indicating which kind of bitmap
- * to render. For now, only 'ft_render_mode_anti_alias'
- * is supported by the available renderers, but others
- * could appear later (e.g. LCD or TV optimised)
- *
- *
- * Error code. 0 means success.
- *
- *
- * in case of success, the renderer will be used to convert glyph
- * images in the renderer's known format into bitmaps.
- *
- * This doesn't change the current renderer for other formats..
- *
- * The slot's native image should be considered lost after the
- * conversion..
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(FT_Error) FT_Render_Glyph( FT_GlyphSlot slot,
- FT_UInt render_mode )
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Render_Glyph */
+ /* */
+ /* */
+ /* Converts a given glyph image to a bitmap. It does so by */
+ /* inspecting the glyph image format, find the relevant renderer, and */
+ /* invoke it. */
+ /* */
+ /* */
+ /* slot :: A handle to the glyph slot containing the image to */
+ /* convert. */
+ /* */
+ /* render_mode :: A set of bit flags indicating which kind of bitmap */
+ /* to render. For now, only */
+ /* `ft_render_mode_anti_alias' is supported by the */
+ /* available renderers, but others could appear later */
+ /* (e.g. optimized for TV or LCD). */
+ /* */
+ /* */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* */
+ /* In case of success, the renderer will be used to convert glyph */
+ /* images in the renderer's known format into bitmaps. */
+ /* */
+ /* This doesn't change the current renderer for other formats. */
+ /* */
+ /* The slot's native image should be considered lost after the */
+ /* conversion. */
+ /* */
+ FT_EXPORT_FUNC( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_UInt render_mode )
{
FT_Error error = FT_Err_Ok;
FT_Renderer renderer;
+
- if (slot)
+ if ( slot )
{
FT_Face face = slot->face;
- FT_Library library = FT_FACE_LIBRARY(face);
+ FT_Library library = FT_FACE_LIBRARY( face );
+
- /* if it's already a bitmap, no need to do anything */
- switch (slot->format)
+ /* if it is already a bitmap, no need to do anything */
+ switch ( slot->format )
{
- case ft_glyph_format_bitmap: /* already a bitmap, don't do anything */
- break;
+ case ft_glyph_format_bitmap: /* already a bitmap, don't do anything */
+ break;
- default:
- {
- /* small shortcut for the very common case */
- if (slot->format == ft_glyph_format_outline)
- renderer = library->cur_renderer;
- else
- renderer = ft_lookup_renderer( library, slot->format, 0 );
+ default:
+ /* small shortcut for the very common case */
+ if ( slot->format == ft_glyph_format_outline )
+ renderer = library->cur_renderer;
+ else
+ renderer = ft_lookup_renderer( library, slot->format, 0 );
- error = FT_Err_Unimplemented_Feature;
- if (renderer)
- error = renderer->render( renderer, slot, render_mode );
- }
+ error = FT_Err_Unimplemented_Feature;
+ if ( renderer )
+ error = renderer->render( renderer, slot, render_mode );
}
}
else
@@ -2460,6 +2501,7 @@
return error;
}
+
/*************************************************************************/
/*************************************************************************/
@@ -2473,6 +2515,7 @@
/*************************************************************************/
/*************************************************************************/
+
/*************************************************************************/
/* */
/* */
@@ -2480,7 +2523,7 @@
/* */
/* */
/* Destroys a given module object. For drivers, this also destroys */
- /* all child faces.. */
+ /* all child faces. */
/* */
/* */
/* module :: A handle to the target driver object. */
@@ -2494,59 +2537,60 @@
FT_Memory memory = module->memory;
FT_Module_Class* clazz = module->clazz;
+
/* finalize client-data - before anything else */
if ( module->generic.finalizer )
module->generic.finalizer( module );
/* if the module is a renderer */
- if (FT_MODULE_IS_RENDERER(module))
- ft_remove_renderer(module);
+ if ( FT_MODULE_IS_RENDERER( module ) )
+ ft_remove_renderer( module );
/* if the module is a font driver, add some steps */
- if (FT_MODULE_IS_DRIVER(module))
- Destroy_Driver( FT_DRIVER(module) );
+ if ( FT_MODULE_IS_DRIVER( module ) )
+ Destroy_Driver( FT_DRIVER( module ) );
/* finalize the module object */
- if (clazz->module_done)
- clazz->module_done(module);
+ if ( clazz->module_done )
+ clazz->module_done( module );
/* discard it */
FREE( module );
}
- /*************************************************************************
- *
- *
- * FT_Add_Module
- *
- *
- * Add a new module to a given library instance.
- *
- *
- * library :: handle to library object
- * clazz :: pointer to class descriptor for the module
- *
- *
- * Error code. 0 means success
- *
- *
- * An error will be returned if a module already exists by that
- * name, or if the module requires a version of freetype that is
- * too great
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(FT_Error) FT_Add_Module( FT_Library library,
- const FT_Module_Class* clazz )
+
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Add_Module */
+ /* */
+ /* */
+ /* Adds a new module to a given library instance. */
+ /* */
+ /* */
+ /* library :: A handle to the library object. */
+ /* clazz :: A pointer to class descriptor for the module. */
+ /* */
+ /* */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* */
+ /* An error will be returned if a module already exists by that name, */
+ /* or if the module requires a version of FreeType that is too great. */
+ /* */
+ FT_EXPORT_FUNC( FT_Error ) FT_Add_Module( FT_Library library,
+ const FT_Module_Class* clazz )
{
FT_Error error;
FT_Memory memory;
FT_Module module;
FT_UInt nn;
- #define FREETYPE_VER_FIXED (((FT_Long)FREETYPE_MAJOR << 16) | FREETYPE_MINOR)
- if (!library || !clazz)
+#define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) |
+ FREETYPE_MINOR )
+
+ if ( !library || !clazz )
return FT_Err_Invalid_Argument;
/* check freetype version */
@@ -2580,7 +2624,7 @@
}
/* allocate module object */
- if (ALLOC(module,clazz->module_size))
+ if ( ALLOC( module,clazz->module_size ) )
goto Exit;
/* base initialisation */
@@ -2589,88 +2633,96 @@
module->clazz = (FT_Module_Class*)clazz;
/* if the module is a renderer - this must be performed before */
- /* the normal module initialisation.. */
- if (FT_MODULE_IS_RENDERER(module))
+ /* the normal module initialization. */
+ if ( FT_MODULE_IS_RENDERER( module ) )
{
/* add to the renderers list */
- error = ft_add_renderer(module);
- if (error) goto Fail;
+ error = ft_add_renderer( module );
+ if ( error )
+ goto Fail;
}
/* if the module is a font driver */
- if (FT_MODULE_IS_DRIVER(module))
+ if ( FT_MODULE_IS_DRIVER( module ) )
{
/* allocate glyph loader if needed */
- FT_Driver driver = FT_DRIVER(module);
+ FT_Driver driver = FT_DRIVER( module );
+
driver->clazz = (FT_Driver_Class*)module->clazz;
- if (FT_DRIVER_USES_OUTLINES(driver))
+ if ( FT_DRIVER_USES_OUTLINES( driver ) )
{
error = FT_GlyphLoader_New( memory, &driver->glyph_loader );
- if (error) goto Fail;
+ if ( error )
+ goto Fail;
}
}
- if (clazz->module_init)
+ if ( clazz->module_init )
{
- error = clazz->module_init(module);
- if (error) goto Fail;
+ error = clazz->module_init( module );
+ if ( error )
+ goto Fail;
}
/* add module to the library's table */
- library->modules[ library->num_modules++ ] = module;
+ library->modules[library->num_modules++] = module;
-
Exit:
return error;
Fail:
- if (FT_MODULE_IS_DRIVER(module))
+ if ( FT_MODULE_IS_DRIVER( module ) )
{
- FT_Driver driver = FT_DRIVER(module);
+ FT_Driver driver = FT_DRIVER( module );
- if (FT_DRIVER_USES_OUTLINES(driver))
+
+ if ( FT_DRIVER_USES_OUTLINES( driver ) )
FT_GlyphLoader_Done( driver->glyph_loader );
}
- if (FT_MODULE_IS_RENDERER(module))
+ if ( FT_MODULE_IS_RENDERER( module ) )
{
- FT_Renderer renderer = FT_RENDERER(module);
- if (renderer->raster)
+ FT_Renderer renderer = FT_RENDERER( module );
+
+
+ if ( renderer->raster )
renderer->clazz->raster_class->raster_done( renderer->raster );
}
- FREE(module);
+
+ FREE( module );
goto Exit;
}
- /*************************************************************************
- *
- *
- * FT_Get_Module
- *
- *
- * Find a module by its name.
- *
- *
- * library :: handle to library object
- * module_name :: the module's ASCII name.
- *
- *
- * Module handle, 0 if none was found.
- *
- *
- * You'd better be familiar with FreeType internals to know which
- * module to look for :-)
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(FT_Module) FT_Get_Module( FT_Library library,
- const char* module_name )
+
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Get_Module */
+ /* */
+ /* */
+ /* Finds a module by its name. */
+ /* */
+ /* */
+ /* library :: A handle to the library object. */
+ /* */
+ /* module_name :: The module's name (as an ASCII string). */
+ /* */
+ /* */
+ /* A module handle. 0 if none was found. */
+ /* */
+ /* */
+ /* You should better be familiar with FreeType internals to know */
+ /* which module to look for :-) */
+ /* */
+ FT_EXPORT_FUNC( FT_Module ) FT_Get_Module( FT_Library library,
+ const char* module_name )
{
FT_Module result = 0;
FT_Module* cur = library->modules;
FT_Module* limit = cur + library->num_modules;
+
for ( ; cur < limit; cur++ )
if ( strcmp( cur[0]->clazz->module_name, module_name ) == 0 )
{
@@ -2681,66 +2733,70 @@
return result;
}
- /*************************************************************************
- *
- *
- * FT_Get_Module_Interface
- *
- *
- * Find a module and returns it's specific interface as a void*
- *
- *
- * library :: handle to library object
- * module_name :: the module's ASCII name.
- *
- *
- * Module specific interface, if any
- *
- *
- * You'd better be familiar with FreeType internals to know which
- * module to look for, and what it's interface is :-)
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(const void*) FT_Get_Module_Interface( FT_Library library,
- const char* mod_name )
+
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Get_Module_Interface */
+ /* */
+ /* */
+ /* Finds a module and returns its specific interface as a typeless */
+ /* pointer. */
+ /* */
+ /* */
+ /* library :: A handle to the library object. */
+ /* */
+ /* module_name :: The module's name (as an ASCII string). */
+ /* */
+ /* */
+ /* A module-specific interface if available, 0 otherwise. */
+ /* */
+ /* */
+ /* You should better be familiar with FreeType internals to know */
+ /* which module to look for, and what its interface is :-) */
+ /* */
+ FT_EXPORT_FUNC(const void*) FT_Get_Module_Interface(
+ FT_Library library,
+ const char* mod_name )
{
FT_Module module;
+
module = FT_Get_Module( library, mod_name );
+
return module ? module->clazz->module_interface : 0;
}
- /*************************************************************************
- *
- *
- * FT_Remove_Module
- *
- *
- * Removes a given module from a library instance.
- *
- *
- * library :: handle to library object
- * module :: handle to module object
- *
- *
- * Error code (module not listed)
- *
- *
- * The module object is destroyed by the function in case of success
- *
- *************************************************************************/
-
- FT_EXPORT_FUNC(FT_Error) FT_Remove_Module( FT_Library library,
- FT_Module module )
+ /*************************************************************************/
+ /* */
+ /* */
+ /* FT_Remove_Module */
+ /* */
+ /* */
+ /* Removes a given module from a library instance. */
+ /* */
+ /* */
+ /* library :: A handle to a library object. */
+ /* */
+ /* module :: A handle to a module object. */
+ /* */
+ /* */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* */
+ /* The module object is destroyed by the function in case of success. */
+ /*
+ FT_EXPORT_FUNC( FT_Error ) FT_Remove_Module( FT_Library library,
+ FT_Module module )
{
/* try to find the module from the table, then remove it from there */
- if (library && module)
+ if ( library && module )
{
FT_Module* cur = library->modules;
FT_Module* limit = cur + library->num_modules;
+
for ( ; cur < limit; cur++ )
{
if (cur[0] == module)
@@ -2748,7 +2804,7 @@
/* remove it from the table */
library->num_modules--;
limit--;
- while (cur < limit)
+ while ( cur < limit )
{
cur[0] = cur[1];
cur++;
@@ -2756,7 +2812,7 @@
limit[0] = 0;
/* destroy the module */
- Destroy_Module(module);
+ Destroy_Module( module );
return FT_Err_Ok;
}
@@ -2766,13 +2822,6 @@
}
-
-
-
-
-
-
-
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -2785,6 +2834,7 @@
/*************************************************************************/
/*************************************************************************/
+
/*************************************************************************/
/* */
/* */
@@ -2871,6 +2921,7 @@
{
FT_Module module = library->modules[n];
+
if ( module )
{
Destroy_Module( module );
@@ -2893,8 +2944,8 @@
/* FT_Set_Debug_Hook */
/* */
/* */
- /* Sets a debug hook function for debugging the interpreter of a */
- /* font format. */
+ /* Sets a debug hook function for debugging the interpreter of a font */
+ /* format. */
/* */
/* */
/* library :: A handle to the library object. */
@@ -2920,9 +2971,6 @@
}
-
-
-
/*************************************************************************/
/* */
/* */
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 8c6afc06e..beb378931 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -573,16 +573,17 @@
/* */
/* */
/* Renders an outline within a bitmap using the current scan-convert. */
- /* This functions uses a FT_Raster_Params as argument, allowing */
- /* advanced features like direct composition/translucency, etc. */
+ /* This functions uses an FT_Raster_Params structure as an argument, */
+ /* allowing advanced features like direct composition, translucency, */
+ /* etc. */
/* */
/* */
/* library :: A handle to a FreeType library object. */
/* */
/* outline :: A pointer to the source outline descriptor. */
/* */
- /* params :: A pointer to a FT_Raster_Params used to describe */
- /* the rendering operation. */
+ /* params :: A pointer to a FT_Raster_Params structure used to */
+ /* describe the rendering operation. */
/* */
/* */
/* FreeType error code. 0 means success. */
@@ -592,7 +593,7 @@
/* scan-line converter will be serialized. */
/* */
/* */
- /* You should know what you're doing and the role of FT_Raster_Params */
+ /* You should know what you are doing and how FT_Raster_Params works */
/* to use this function. */
/* */
/* The field `params.source' will be set to `outline' before the scan */
@@ -606,6 +607,7 @@
FT_Error error;
FT_Renderer renderer;
+
if ( !library )
{
error = FT_Err_Invalid_Library_Handle;
@@ -620,7 +622,7 @@
/* retrieve the current outline renderer */
renderer = library->cur_renderer;
- if (!renderer)
+ if ( !renderer )
{
/* XXXX: should use another error code */
error = FT_Err_Invalid_Argument;
@@ -671,7 +673,8 @@
{
FT_Raster_Params params;
- if (!bitmap)
+
+ if ( !bitmap )
return FT_Err_Invalid_Argument;
/* other checks are delayed to FT_Outline_Render */
@@ -686,8 +689,6 @@
}
-
-
/*************************************************************************/
/* */
/* */
@@ -713,6 +714,7 @@
{
FT_Pos xz, yz;
+
xz = FT_MulFix( vector->x, matrix->xx ) +
FT_MulFix( vector->y, matrix->xy );
@@ -724,8 +726,6 @@
}
-
-
/*************************************************************************/
/* */
/* */
@@ -753,6 +753,7 @@
FT_Vector* vec = outline->points;
FT_Vector* limit = vec + outline->n_points;
+
for ( ; vec < limit; vec++ )
FT_Vector_Transform( vec, matrix );
}
diff --git a/src/cff/t2driver.c b/src/cff/t2driver.c
index 2a599751f..cf3149a48 100644
--- a/src/cff/t2driver.c
+++ b/src/cff/t2driver.c
@@ -78,7 +78,7 @@
/* formats. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* */
/* Only horizontal layouts (left-to-right & right-to-left) are */
@@ -169,7 +169,7 @@
/* whether to hint the outline, etc). */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
static
FT_Error Load_Glyph( T2_GlyphSlot slot,
@@ -282,8 +282,10 @@
{
FT_Module sfnt;
- /* we simply pass our request to the "sfnt" module */
+
+ /* we simply pass our request to the `sfnt' module */
sfnt = FT_Get_Module( driver->root.root.library, "sfnt" );
+
return sfnt ? sfnt->clazz->get_interface( sfnt, interface ) : 0;
}
@@ -297,14 +299,14 @@
ft_module_font_driver | ft_module_driver_scalable,
sizeof( T2_DriverRec ),
"cff",
- 0x10000,
- 0x20000,
+ 0x10000L,
+ 0x20000L,
0, /* module-specific interface */
- (FT_Module_Constructor) T2_Init_Driver,
- (FT_Module_Destructor) T2_Done_Driver,
- (FT_Module_Requester) t2_get_interface,
+ (FT_Module_Constructor)T2_Init_Driver,
+ (FT_Module_Destructor) T2_Done_Driver,
+ (FT_Module_Requester) t2_get_interface,
},
/* now the specific driver fields */
@@ -312,22 +314,22 @@
sizeof( FT_SizeRec ),
sizeof( T2_GlyphSlotRec ),
- (FTDriver_initFace) T2_Init_Face,
- (FTDriver_doneFace) T2_Done_Face,
- (FTDriver_initSize) 0,
- (FTDriver_doneSize) 0,
- (FTDriver_initGlyphSlot) 0,
- (FTDriver_doneGlyphSlot) 0,
+ (FTDriver_initFace) T2_Init_Face,
+ (FTDriver_doneFace) T2_Done_Face,
+ (FTDriver_initSize) 0,
+ (FTDriver_doneSize) 0,
+ (FTDriver_initGlyphSlot)0,
+ (FTDriver_doneGlyphSlot)0,
- (FTDriver_setCharSizes) 0,
- (FTDriver_setPixelSizes) 0,
+ (FTDriver_setCharSizes) 0,
+ (FTDriver_setPixelSizes)0,
- (FTDriver_loadGlyph) Load_Glyph,
- (FTDriver_getCharIndex) Get_Char_Index,
+ (FTDriver_loadGlyph) Load_Glyph,
+ (FTDriver_getCharIndex) Get_Char_Index,
- (FTDriver_getKerning) Get_Kerning,
- (FTDriver_attachFile) 0,
- (FTDriver_getAdvances) 0
+ (FTDriver_getKerning) Get_Kerning,
+ (FTDriver_attachFile) 0,
+ (FTDriver_getAdvances) 0
};
diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c
index b877eae28..050332605 100644
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -232,6 +232,7 @@
if ( glyph )
{
FT_GlyphLoader* loader = glyph->root.loader;
+
builder->loader = loader;
builder->base = &loader->base.outline;
@@ -273,6 +274,7 @@
{
T2_GlyphSlot glyph = builder->glyph;
+
if ( glyph )
glyph->root.outline = *builder->base;
}
@@ -360,8 +362,7 @@
FT_Error check_points( T2_Builder* builder,
FT_Int count )
{
- return FT_GlyphLoader_Check_Points( builder->loader,
- count, 0 );
+ return FT_GlyphLoader_Check_Points( builder->loader, count, 0 );
}
@@ -374,11 +375,13 @@
{
FT_Outline* outline = builder->current;
+
if ( builder->load_points )
{
FT_Vector* point = outline->points + outline->n_points;
FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points;
+
point->x = x >> 16;
point->y = y >> 16;
*control = flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic;
@@ -397,6 +400,7 @@
{
FT_Error error;
+
error = check_points( builder, 1 );
if ( !error )
add_point( builder, x, y, 1 );
@@ -412,6 +416,7 @@
FT_Outline* outline = builder->current;
FT_Error error;
+
if ( !builder->load_points )
{
outline->n_contours++;
@@ -419,13 +424,14 @@
}
error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 );
- if (!error)
+ if ( !error )
{
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
outline->n_contours++;
}
+
return error;
}
@@ -441,6 +447,7 @@
{
FT_Error error;
+
builder->path_begun = 1;
error = add_contour( builder );
if ( error )
@@ -457,6 +464,7 @@
{
FT_Outline* outline = builder->current;
+
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
@@ -484,7 +492,7 @@
/* charstring_len :: The length in bytes of the charstring stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error T2_Parse_CharStrings( T2_Decoder* decoder,
diff --git a/src/cff/t2objs.c b/src/cff/t2objs.c
index 14a880da3..36b9c13ee 100644
--- a/src/cff/t2objs.c
+++ b/src/cff/t2objs.c
@@ -68,7 +68,7 @@
/* face :: The newly built face object. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_DEF
FT_Error T2_Init_Face( FT_Stream stream,
@@ -80,9 +80,10 @@
FT_Error error;
SFNT_Interface* sfnt;
- sfnt = (SFNT_Interface*)
- FT_Get_Module_Interface( face->root.driver->root.library,"sfnt" );
- if ( !sfnt ) goto Bad_Format;
+ sfnt = (SFNT_Interface*)FT_Get_Module_Interface(
+ face->root.driver->root.library, "sfnt" );
+ if ( !sfnt )
+ goto Bad_Format;
/* create input stream from resource */
if ( FILE_Seek( 0 ) )
@@ -188,7 +189,7 @@
/* driver :: A handle to the target driver object. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error T2_Init_Driver( T2_Driver driver )
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 68c1de627..d0048df78 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -158,12 +158,13 @@
if ( glyph )
{
FT_GlyphLoader* loader = glyph->root.loader;
+
builder->loader = loader;
builder->base = &loader->base.outline;
builder->current = &loader->current.outline;
- FT_GlyphLoader_Rewind(loader);
+ FT_GlyphLoader_Rewind( loader );
}
if ( size )
@@ -245,6 +246,7 @@
{
FT_Outline* outline = builder->current;
+
if ( builder->load_points )
{
FT_Vector* point = outline->points + outline->n_points;
@@ -285,6 +287,7 @@
FT_Outline* outline = builder->current;
FT_Error error;
+
if ( !builder->load_points )
{
outline->n_contours++;
@@ -292,7 +295,7 @@
}
error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 );
- if (!error)
+ if ( !error )
{
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
@@ -314,6 +317,7 @@
{
FT_Error error;
+
builder->path_begun = 1;
error = add_contour( builder );
if ( error )
@@ -330,6 +334,7 @@
{
FT_Outline* outline = builder->current;
+
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
@@ -410,7 +415,7 @@
/* achar :: The accent character's StandardEncoding charcode. */
/* */
/* */
- /* Type 1 error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
static
FT_Error t1operator_seac( CID_Decoder* decoder,
@@ -426,6 +431,7 @@
FT_Outline* base = decoder->builder.base;
FT_Vector left_bearing, advance;
+
bchar_index = bchar;
achar_index = achar;
@@ -435,19 +441,19 @@
return T1_Err_Syntax_Error;
}
-
/* if we are trying to load a composite glyph, do not load the */
/* accent character and return the array of subglyphs. */
if ( decoder->builder.no_recurse )
{
-
FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
FT_GlyphLoader* loader = glyph->loader;
FT_SubGlyph* subg;
+
/* reallocate subglyph array if necessary */
error = FT_GlyphLoader_Check_Subglyphs( loader, 2 );
- if (error) goto Exit;
+ if ( error )
+ goto Exit;
subg = loader->current.subglyphs;
@@ -474,11 +480,12 @@
/* First load `bchar' in builder */
/* now load the unscaled outline */
- if (decoder->builder.loader)
- FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */
+ if ( decoder->builder.loader )
+ FT_GlyphLoader_Prepare( decoder->builder.loader );
error = cid_load_glyph( decoder, bchar_index ); /* load one glyph */
- if ( error ) goto Exit;
+ if ( error )
+ goto Exit;
n_base_points = cur->n_points;
@@ -508,6 +515,7 @@
if ( decoder->builder.load_points )
{
FT_Outline dummy;
+
dummy.n_points = base->n_points - n_base_points;
dummy.points = base->points + n_base_points;
@@ -541,7 +549,7 @@
/* charstring_len :: The length in bytes of the charstring stream. */
/* */
/* */
- /* Type1 error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error CID_Parse_CharStrings( CID_Decoder* decoder,
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 37f752c6c..d7edb8597 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -110,7 +110,7 @@
/* face :: The newly built face object. */
/* */
/* */
- /* Type1 error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error CID_Init_Face( FT_Stream stream,
@@ -133,8 +133,8 @@
psnames = (PSNames_Interface*)face->psnames;
if ( !psnames )
{
- psnames = (PSNames_Interface*)
- FT_Get_Module_Interface( FT_FACE_LIBRARY(face), "psnames" );
+ psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ FT_FACE_LIBRARY( face ), "psnames" );
face->psnames = psnames;
}
@@ -337,14 +337,14 @@
/* driver :: A handle to the target driver object. */
/* */
/* */
- /* Type1 error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error CID_Init_Driver( T1_Driver driver )
{
UNUSED( driver );
- return FT_Err_Ok;
+ return T1_Err_Ok;
}
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index 31acb29e6..93085e78b 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -67,7 +67,7 @@
/* reallocations. */
/* */
/* */
- /* Type1 error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error T1_New_Table( T1_Table* table,
@@ -157,7 +157,7 @@
/* length :: The length in bytes of the source object. */
/* */
/* */
- /* Type1 error code. 0 means success. An error is returned if */
+ /* FreeType error code. 0 means success. An error is returned if */
/* reallocation fails. */
/* */
LOCAL_FUNC
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 292bc37d2..a045db190 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -38,8 +38,8 @@
static
- FT_Module_Interface CID_Get_Interface( FT_Driver driver,
- const FT_String* interface )
+ FT_Module_Interface CID_Get_Interface( FT_Driver driver,
+ const FT_String* interface )
{
UNUSED( driver );
UNUSED( interface );
@@ -48,7 +48,7 @@
}
-#ifdef xxxT1_CONFIG_OPTION_NO_AFM
+#ifndef T1_CONFIG_OPTION_NO_AFM
static
@@ -71,20 +71,20 @@
}
-#endif /* xxxT1_CONFIG_OPTION_NO_AFM */
-
+#endif /* !T1_CONFIG_OPTION_NO_AFM */
/*************************************************************************/
/* */
/* */
- /* cid_get_char_index */
+ /* Cid_Get_Char_Index */
/* */
/* */
/* Uses a charmap to return a given character code's glyph index. */
/* */
/* */
/* charmap :: A handle to the source charmap object. */
+ /* */
/* charcode :: The character code. */
/* */
/* */
@@ -98,6 +98,7 @@
FT_UInt result = 0;
PSNames_Interface* psnames;
+
face = (T1_Face)charmap->face;
psnames = (PSNames_Interface*)face->psnames;
if ( psnames )
@@ -173,7 +174,6 @@
}
-
const FT_Driver_Class t1cid_driver_class =
{
/* firs of all, the FT_Module_Class fields */
@@ -181,14 +181,14 @@
ft_module_font_driver | ft_module_driver_scalable,
sizeof( FT_DriverRec ),
"t1cid", /* module name */
- 0x10000, /* version 1.0 of driver */
- 0x20000, /* requires FreeType 2.0 */
+ 0x10000L, /* version 1.0 of driver */
+ 0x20000L, /* requires FreeType 2.0 */
0,
- (FT_Module_Constructor) CID_Init_Driver,
- (FT_Module_Destructor) CID_Done_Driver,
- (FT_Module_Requester) CID_Get_Interface
+ (FT_Module_Constructor)CID_Init_Driver,
+ (FT_Module_Destructor) CID_Done_Driver,
+ (FT_Module_Requester) CID_Get_Interface
},
/* then the other font drivers fields */
@@ -196,32 +196,30 @@
sizeof( T1_SizeRec ),
sizeof( T1_GlyphSlotRec ),
- (FTDriver_initFace) CID_Init_Face,
- (FTDriver_doneFace) CID_Done_Face,
+ (FTDriver_initFace) CID_Init_Face,
+ (FTDriver_doneFace) CID_Done_Face,
- (FTDriver_initSize) 0,
- (FTDriver_doneSize) 0,
- (FTDriver_initGlyphSlot) 0,
- (FTDriver_doneGlyphSlot) 0,
+ (FTDriver_initSize) 0,
+ (FTDriver_doneSize) 0,
+ (FTDriver_initGlyphSlot)0,
+ (FTDriver_doneGlyphSlot)0,
- (FTDriver_setCharSizes) 0,
- (FTDriver_setPixelSizes) 0,
+ (FTDriver_setCharSizes) 0,
+ (FTDriver_setPixelSizes)0,
- (FTDriver_loadGlyph) CID_Load_Glyph,
- (FTDriver_getCharIndex) CID_Get_Char_Index,
+ (FTDriver_loadGlyph) CID_Load_Glyph,
+ (FTDriver_getCharIndex) CID_Get_Char_Index,
-#ifndef xxxxT1_CONFIG_OPTION_NO_AFM
- (FTDriver_getKerning) 0,
- (FTDriver_attachFile) 0,
+#ifdef T1_CONFIG_OPTION_NO_AFM
+ (FTDriver_getKerning) 0,
+ (FTDriver_attachFile) 0,
#else
- (FTDriver_getKerning) cid_Get_Kerning,
- (FTDriver_attachFile) CID_Read_AFM,
+ (FTDriver_getKerning) cid_Get_Kerning,
+ (FTDriver_attachFile) CID_Read_AFM,
#endif
(FTDriver_getAdvances) 0
};
-
-
/* END */
diff --git a/src/psnames/psdriver.h b/src/psnames/psdriver.h
index 5fa89d5b5..ab8884591 100644
--- a/src/psnames/psdriver.h
+++ b/src/psnames/psdriver.h
@@ -1,10 +1,10 @@
/***************************************************************************/
/* */
-/* psmodule.h */
+/* psdriver.h */
/* */
-/* High-level PSNames module interface (specification). */
+/* High-level PSNames driver interface (specification). */
/* */
-/* Copyright 1996-1999 by */
+/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,9 +21,9 @@
#include
- FT_EXPORT_VAR(const FT_Module_Class) psnames_module_class;
+ FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class;
-#endif /* PSMODULE_H */
+#endif /* PSDRIVER_H */
/* END */
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index e00f9ac9e..ebbae1afc 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -1,44 +1,72 @@
+/***************************************************************************/
+/* */
+/* psmodule.c */
+/* */
+/* PSNames module implementation (body). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#include
#include
#include
+
#include
+#include /* for strcmp(), strncpy() */
+
#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES
-/* see the python script "freetype2/docs/glnames.py" which is used */
-/* to generate the following tables... */
+
+ /* see the python script `freetype2/docs/glnames.py' which is used */
+ /* to generate the following tables... */
#include
+
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- /* return the Unicode value corresponding to a given glyph. Note that */
- /* we do deal with glyph variants by detecting a non-initial dot */
- /* in the name, as in "A.swash" or "e.final", etc.. */
- /* */
+
+
+ /* return the Unicode value corresponding to a given glyph. Note that */
+ /* we do deal with glyph variants by detecting a non-initial dot in */
+ /* the name, as in `A.swash' or `e.final', etc. */
+ /* */
static
- FT_ULong PS_Unicode_Value( const char* glyph_name )
+ FT_ULong PS_Unicode_Value( const char* glyph_name )
{
FT_Int n;
char first = glyph_name[0];
char temp[64];
- /* if the name begins with "uni", then the glyph name may be a */
- /* hard-coded unicode character code.. */
+
+ /* if the name begins with `uni', then the glyph name may be a */
+ /* hard-coded unicode character code. */
if ( glyph_name[0] == 'u' &&
glyph_name[1] == 'n' &&
glyph_name[2] == 'i' )
{
/* determine wether the following characters are hexadecimal */
- FT_Int count;
- FT_ULong value = 0;
- const char* p = glyph_name + 4;
+ FT_Int count;
+ FT_ULong value = 0;
+ const char* p = glyph_name + 4;
+
- for ( count = 4;count > 0; count--, p++ )
+ for ( count = 4; count > 0; count--, p++ )
{
char c = *p;
unsigned char d;
- d = (unsigned char)c-'0';
- if (d >= 10)
+
+ d = (unsigned char)c - '0';
+ if ( d >= 10 )
{
d = (unsigned char)c - 'A';
if ( d >= 6 )
@@ -46,25 +74,27 @@
else
d += 10;
}
- /* exit if one non-uppercase-hexadecimal character was found */
- if (d >= 16)
+ /* exit if a non-uppercase-hexadecimal character was found */
+ if ( d >= 16 )
break;
- value = (value << 4) + d;
- if (count == 0)
+ value = ( value << 4 ) + d;
+ if ( count == 0 )
return value;
}
}
/* look for a non-initial dot in the glyph name in order to */
- /* sort-out variants like "A.swash", "e.final", etc.. */
+ /* sort-out variants like `A.swash', `e.final', etc. */
{
const char* p;
int len;
+
p = glyph_name;
- while ( *p && *p != '.' ) p++;
- len = p-glyph_name;
+ while ( *p && *p != '.' )
+ p++;
+ len = p - glyph_name;
if ( *p && len < 64 )
{
@@ -79,35 +109,40 @@
{
const char* name = t1_standard_glyphs[n];
+
if ( first == name[0] && strcmp( glyph_name, name ) == 0 )
return names_to_unicode[n];
}
+
/* not found, there is probably no Unicode value for this glyph name */
return 0;
}
- /* qsort callback to sort the unicode map */
+ /* qsort callback to sort the unicode map */
static
- int compare_uni_maps( const void* a, const void* b )
+ int compare_uni_maps( const void* a,
+ const void* b )
{
PS_UniMap* map1 = (PS_UniMap*)a;
PS_UniMap* map2 = (PS_UniMap*)b;
+
return ( map1->unicode < map2->unicode ? -1 :
map1->unicode > map2->unicode ? 1 : 0 );
}
- /* Builds a table that maps Unicode values to glyph indices */
+ /* Builds a table that maps Unicode values to glyph indices */
static
FT_Error PS_Build_Unicode_Table( FT_Memory memory,
FT_UInt num_glyphs,
const char** glyph_names,
- PS_Unicodes *table )
+ PS_Unicodes* table )
{
FT_Error error;
+
/* we first allocate the table */
table->num_maps = 0;
table->maps = 0;
@@ -119,14 +154,17 @@
PS_UniMap* map;
FT_ULong uni_char;
+
map = table->maps;
for ( n = 0; n < num_glyphs; n++ )
{
const char* gname = glyph_names[n];
- if (gname)
+
+
+ if ( gname )
{
- uni_char = PS_Unicode_Value(gname);
- if (uni_char && uni_char != 0xFFFF)
+ uni_char = PS_Unicode_Value( gname );
+ if ( uni_char && uni_char != 0xFFFF )
{
map->unicode = uni_char;
map->glyph_index = n;
@@ -138,102 +176,108 @@
/* now, compress the table a bit */
count = map - table->maps;
if ( count > 0 && REALLOC( table->maps,
- num_glyphs*sizeof(PS_UniMap),
- count*sizeof(PS_UniMap) ) )
- {
+ num_glyphs * sizeof ( PS_UniMap ),
+ count * sizeof ( PS_UniMap ) ) )
count = 0;
- }
- if (count == 0)
+ if ( count == 0 )
{
FREE( table->maps );
- if (!error)
- error = FT_Err_Invalid_Argument; /* no unicode chars here !! */
+ if ( !error )
+ error = FT_Err_Invalid_Argument; /* no unicode chars here! */
}
else
/* sort the table in increasing order of unicode values */
- qsort( table->maps, count, sizeof(PS_UniMap), compare_uni_maps );
+ qsort( table->maps, count, sizeof ( PS_UniMap ), compare_uni_maps );
table->num_maps = count;
}
+
return error;
}
+
static
FT_UInt PS_Lookup_Unicode( PS_Unicodes* table,
FT_ULong unicode )
{
PS_UniMap *min, *max, *mid;
+
+
/* perform a binary search on the table */
min = table->maps;
max = min + table->num_maps - 1;
- while (min <= max)
+ while ( min <= max )
{
- mid = min + (max-min)/2;
+ mid = min + ( max - min ) / 2;
if ( mid->unicode == unicode )
return mid->glyph_index;
- if (min == max)
+ if ( min == max )
break;
- if ( mid->unicode < unicode ) min = mid+1;
- else max = mid-1;
+ if ( mid->unicode < unicode )
+ min = mid + 1;
+ else
+ max = mid - 1;
}
return 0xFFFF;
}
-#endif
+#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
static
const char* PS_Macintosh_Name( FT_UInt name_index )
{
- if (name_index >= 258)
+ if ( name_index >= 258 )
name_index = 0;
- return standard_glyph_names[ mac_standard_names[name_index] ];
+ return standard_glyph_names[mac_standard_names[name_index]];
}
-
static
const char* PS_Standard_Strings( FT_UInt sid )
{
- return (sid < NUM_STD_GLYPHS ? t1_standard_glyphs[sid] : 0);
+ return ( sid < NUM_STD_GLYPHS ? t1_standard_glyphs[sid] : 0 );
}
-
- static const PSNames_Interface psnames_interface =
+ static const PSNames_Interface psnames_interface =
{
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- (PS_Unicode_Value_Func) PS_Unicode_Value,
- (PS_Build_Unicodes_Func) PS_Build_Unicode_Table,
- (PS_Lookup_Unicode_Func) PS_Lookup_Unicode,
+
+ (PS_Unicode_Value_Func) PS_Unicode_Value,
+ (PS_Build_Unicodes_Func) PS_Build_Unicode_Table,
+ (PS_Lookup_Unicode_Func) PS_Lookup_Unicode,
+
#else
+
0,
0,
0,
-#endif
- (PS_Macintosh_Name_Func) PS_Macintosh_Name,
- (PS_Adobe_Std_Strings_Func) PS_Standard_Strings,
+#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
+
+ (PS_Macintosh_Name_Func) PS_Macintosh_Name,
+ (PS_Adobe_Std_Strings_Func)PS_Standard_Strings,
t1_standard_encoding,
t1_expert_encoding
};
-#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */
+#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */
const FT_Module_Class psnames_module_class =
{
0, /* this is not a font driver, nor a renderer */
- sizeof(FT_ModuleRec),
+ sizeof( FT_ModuleRec ),
"psnames", /* driver name */
100, /* driver version */
@@ -245,8 +289,10 @@
(void*)&psnames_interface, /* module specific interface */
#endif
- (FT_Module_Constructor) 0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
+ (FT_Module_Constructor)0,
+ (FT_Module_Destructor) 0,
+ (FT_Module_Requester) 0
};
+
+/* END */
diff --git a/src/psnames/psmodule.h b/src/psnames/psmodule.h
index 5fa89d5b5..ff7ef0650 100644
--- a/src/psnames/psmodule.h
+++ b/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
/* */
/* High-level PSNames module interface (specification). */
/* */
-/* Copyright 1996-1999 by */
+/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,9 +21,9 @@
#include
- FT_EXPORT_VAR(const FT_Module_Class) psnames_module_class;
+ FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class;
-#endif /* PSMODULE_H */
+#endif /* PSDRIVER_H */
/* END */
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 61b726a08..ed9810ff9 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -25,6 +25,7 @@
#include
#include
+
static
void* get_sfnt_table( TT_Face face,
FT_Sfnt_Tag tag )
@@ -145,16 +146,15 @@
sizeof( FT_ModuleRec ),
"sfnt", /* driver name */
- 0x10000, /* driver version 1.0 */
- 0x20000, /* driver requires FreeType 2.0 or higher */
+ 0x10000L, /* driver version 1.0 */
+ 0x20000L, /* driver requires FreeType 2.0 or higher */
(const void*)&sfnt_interface, /* module specific interface */
- (FT_Module_Constructor) 0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) SFNT_Get_Interface
+ (FT_Module_Constructor)0,
+ (FT_Module_Destructor) 0,
+ (FT_Module_Requester) SFNT_Get_Interface
};
-
/* END */
diff --git a/src/sfnt/sfdriver.h b/src/sfnt/sfdriver.h
index cfd1a2a3a..92c9c8129 100644
--- a/src/sfnt/sfdriver.h
+++ b/src/sfnt/sfdriver.h
@@ -21,7 +21,7 @@
#include
- FT_EXPORT_VAR(const FT_Module_Class) sfnt_module_class;
+ FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class;
#endif /* SFDRIVER_H */
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index d10ca084c..75f8106a5 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -59,7 +59,7 @@
/* table :: A pointer to a cmap object. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* */
/* The function assumes that the stream is already in use (i.e., */
@@ -281,7 +281,7 @@
/* cmap :: A handle to a cmap object. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_CharMap_Free( TT_Face face,
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index c954ec461..f8fb0a73f 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -96,7 +96,7 @@
/* length :: The length of the table if found, undefined otherwise. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Goto_Table( TT_Face face,
@@ -141,7 +141,7 @@
/* sfnt :: The SFNT header. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* */
/* The stream cursor must be at the font file's origin. */
@@ -275,7 +275,7 @@
/* sfnt :: The SFNT directory header. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* */
/* The stream cursor must be at the font file's origin. */
@@ -373,7 +373,7 @@
/* buffer :: The address of target buffer. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Any( TT_Face face,
@@ -436,7 +436,7 @@
/* stream :: The input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Header( TT_Face face,
@@ -507,7 +507,7 @@
/* stream :: The input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_MaxProfile( TT_Face face,
@@ -597,7 +597,7 @@
/* vertical :: A boolean flag. If set, load vertical metrics. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
static
FT_Error TT_Load_Metrics( TT_Face face,
@@ -733,7 +733,7 @@
/* vertical :: A boolean flag. If set, load vertical metrics. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Metrics_Header( TT_Face face,
@@ -829,7 +829,7 @@
/* stream :: The input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Names( TT_Face face,
@@ -1020,7 +1020,7 @@
/* stream :: A handle to the input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_CMap( TT_Face face,
@@ -1129,7 +1129,7 @@
/* stream :: A handle to the input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_OS2( TT_Face face,
@@ -1263,7 +1263,7 @@
/* stream :: A handle to the input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_PostScript( TT_Face face,
@@ -1318,7 +1318,7 @@
/* stream :: A handle to the input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_PCLT( TT_Face face,
@@ -1389,7 +1389,7 @@
/* stream :: The input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Gasp( TT_Face face,
@@ -1461,7 +1461,7 @@
/* stream :: The input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Kern( TT_Face face,
@@ -1566,7 +1566,7 @@
/* stream :: A handle to the input stream. */
/* */
/* */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error TT_Load_Hdmx( TT_Face face,
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index 513078295..8fad70562 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -427,7 +427,7 @@
/* You must not modify the returned string! */
/* */
/*