applying formatting again

This commit is contained in:
Werner Lemberg 2000-06-25 06:47:11 +00:00
parent 994d7747fb
commit a929ba9b20
36 changed files with 3094 additions and 2682 deletions

View File

@ -51,7 +51,7 @@ make_module_list: clean_module_list
# #
ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),) ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
OPEN_MODULE := @echo # OPEN_MODULE := @echo #
CLOSE_MODULE := >> $(subst /,\,$(FT_MODULE_LIST)) CLOSE_MODULE := >> $(subst $(SEP),$(HOSTSEP),$(FT_MODULE_LIST))
else else
OPEN_MODULE := @echo " OPEN_MODULE := @echo "
CLOSE_MODULE := " >> $(FT_MODULE_LIST) CLOSE_MODULE := " >> $(FT_MODULE_LIST)

View File

@ -1,8 +1,10 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # 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. # Free Software Foundation, Inc.
#
version='2000-06-13'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # 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. # the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>. # Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib. # Please send patches to <config-patches@gnu.org>.
# Please send patches to <autoconf-patches@gnu.org>.
# #
# This script attempts to guess a canonical system name similar 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 # config.sub. If it succeeds, it prints the system name on stdout, and
@ -37,6 +38,46 @@
# (but try to keep the structure clean). # (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 # Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != 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. # Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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:*:*) alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 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. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main .globl main
.align 4
.ent main .ent main
main: main:
.frame \$30,0,\$26,0 .frame \$30,16,\$26,0
.prologue 0 ldgp \$29,0(\$27)
.long 0x47e03d80 # implver $0 .prologue 1
lda \$2,259 .long 0x47e03d80 # implver \$0
.long 0x47e20c21 # amask $2,$1 lda \$2,-1
srl \$1,8,\$2 .long 0x47e20c21 # amask \$2,\$1
sll \$2,2,\$2 lda \$16,\$Lformat
sll \$0,3,\$0 mov \$0,\$17
addl \$1,\$0,\$0 not \$1,\$18
addl \$2,\$0,\$0 jsr \$26,printf
ret \$31,(\$26),1 ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main .end main
EOF EOF
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then if test "$?" = 0 ; then
./$dummy case `./$dummy` in
case "$?" in 0-0)
7)
UNAME_MACHINE="alpha" UNAME_MACHINE="alpha"
;; ;;
15) 1-0)
UNAME_MACHINE="alphaev5" UNAME_MACHINE="alphaev5"
;; ;;
14) 1-1)
UNAME_MACHINE="alphaev56" UNAME_MACHINE="alphaev56"
;; ;;
10) 1-101)
UNAME_MACHINE="alphapca56" UNAME_MACHINE="alphapca56"
;; ;;
16) 2-303)
UNAME_MACHINE="alphaev6" UNAME_MACHINE="alphaev6"
;; ;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac esac
fi fi
rm -f $dummy.s $dummy rm -f $dummy.s $dummy
@ -129,9 +217,6 @@ EOF
Amiga*:UNIX_System_V:4.0:*) Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4 echo m68k-cbm-sysv4
exit 0;; exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*) amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@ -162,9 +247,6 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;; exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*) SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp echo hppa1.1-hitachi-hiuxmpp
exit 0;; exit 0;;
@ -221,9 +303,6 @@ EOF
aushp:SunOS:*:*) aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE} echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*) atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@ -253,15 +332,9 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE} echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*) sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*) mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@ -274,9 +347,6 @@ EOF
powerpc:machten:*:*) powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE} echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
macppc:NetBSD:*:*)
echo powerpc-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*) RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3 echo mips-dec-mach_bsd4.3
exit 0 ;; exit 0 ;;
@ -292,6 +362,7 @@ EOF
mips:*:*:UMIPS | mips:*:*:RISCos) mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus #ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
#else #else
int main (argc, argv) int argc; char *argv[]; { int main (argc, argv) int argc; char *argv[]; {
@ -331,7 +402,7 @@ EOF
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ] [ ${TARGET_BINARY_INTERFACE}x = x ]
@ -408,7 +479,7 @@ EOF
ibmrt:4.4BSD:*|romp-ibm:BSD:*) ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4 echo romp-ibm-bsd4.4
exit 0 ;; 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 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3 exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*) *:BOSX:*:*)
@ -429,6 +500,8 @@ EOF
9000/[34]?? ) HP_ARCH=m68k ;; 9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9]) 9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -553,10 +626,13 @@ EOF
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;; exit 0 ;;
CRAY*TS:*:*:*) CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit 0 ;;
CRAY*T3E:*:*:*) 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 ;; exit 0 ;;
CRAY-2:*:*:*) CRAY-2:*:*:*)
echo cray2-cray-unicos echo cray2-cray-unicos
@ -569,13 +645,10 @@ EOF
F301:UNIX_System_V:*:*) F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;; exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*) hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; 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} echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
sparc*:BSD/OS:*:*) sparc*:BSD/OS:*:*)
@ -585,17 +658,8 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:FreeBSD:*:*) *: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/[-(].*//'` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;; exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0 ;;
*:OpenBSD:*:*) *:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;; exit 0 ;;
@ -623,6 +687,9 @@ EOF
*:GNU:*:*) *:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;; exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
*:Linux:*:*) *:Linux:*:*)
# The BFD linker knows what the default object file format is, so # The BFD linker knows what the default object file format is, so
@ -644,6 +711,10 @@ EOF
echo "${UNAME_MACHINE}-pc-linux-gnuaout" echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 exit 0
;; ;;
elf_i?86)
echo "${UNAME_MACHINE}-pc-linux"
exit 0
;;
i?86coff) i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff" echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 exit 0
@ -657,7 +728,7 @@ EOF
exit 0 exit 0
;; ;;
elf32arm*) elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnu" echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0 exit 0
;; ;;
armelf_linux*) armelf_linux*)
@ -668,7 +739,7 @@ EOF
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0 exit 0
;; ;;
elf32ppc) elf32ppc | elf32ppclinux)
# Determine Lib Version # Determine Lib Version
cat >$dummy.c <<EOF cat >$dummy.c <<EOF
#include <features.h> #include <features.h>
@ -700,46 +771,60 @@ EOF
echo powerpc-unknown-linux-gnu${LIBC} echo powerpc-unknown-linux-gnu${LIBC}
exit 0 exit 0
;; ;;
shelf_linux)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
esac esac
if test "${UNAME_MACHINE}" = "alpha" ; then if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >$dummy.s cat <<EOF >$dummy.s
.globl main .data
.ent main \$Lformat:
main: .byte 37,100,45,37,120,10,0 # "%d-%x\n"
.frame \$30,0,\$26,0
.prologue 0 .text
.long 0x47e03d80 # implver $0 .globl main
lda \$2,259 .align 4
.long 0x47e20c21 # amask $2,$1 .ent main
srl \$1,8,\$2 main:
sll \$2,2,\$2 .frame \$30,16,\$26,0
sll \$0,3,\$0 ldgp \$29,0(\$27)
addl \$1,\$0,\$0 .prologue 1
addl \$2,\$0,\$0 .long 0x47e03d80 # implver \$0
ret \$31,(\$26),1 lda \$2,-1
.end main .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 EOF
LIBC="" LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then if test "$?" = 0 ; then
./$dummy case `./$dummy` in
case "$?" in 0-0)
7)
UNAME_MACHINE="alpha" UNAME_MACHINE="alpha"
;; ;;
15) 1-0)
UNAME_MACHINE="alphaev5" UNAME_MACHINE="alphaev5"
;; ;;
14) 1-1)
UNAME_MACHINE="alphaev56" UNAME_MACHINE="alphaev56"
;; ;;
10) 1-101)
UNAME_MACHINE="alphapca56" UNAME_MACHINE="alphapca56"
;; ;;
16) 2-303)
UNAME_MACHINE="alphaev6" UNAME_MACHINE="alphaev6"
;; ;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac esac
objdump --private-headers $dummy | \ objdump --private-headers $dummy | \
@ -753,6 +838,7 @@ EOF
elif test "${UNAME_MACHINE}" = "mips" ; then elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF cat >$dummy.c <<EOF
#ifdef __cplusplus #ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
#else #else
int main (argc, argv) int argc; char *argv[]; { int main (argc, argv) int argc; char *argv[]; {
@ -768,6 +854,8 @@ EOF
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy rm -f $dummy.c $dummy
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
else else
# Either a pre-BFD a.out linker (linux-gnuoldld) # Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help. # or one that does not give us useful --help.
@ -789,6 +877,7 @@ EOF
cat >$dummy.c <<EOF cat >$dummy.c <<EOF
#include <features.h> #include <features.h>
#ifdef __cplusplus #ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
#else #else
int main (argc, argv) int argc; char *argv[]; { int main (argc, argv) int argc; char *argv[]; {
@ -860,7 +949,11 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32 echo ${UNAME_MACHINE}-pc-sysv32
fi fi
exit 0 ;; exit 0 ;;
i?86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*) pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386. # the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp echo i386-pc-msdosdjgpp
@ -974,8 +1067,26 @@ EOF
*:Rhapsody:*:*) *:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;; 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*) *: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 ;; exit 0 ;;
esac esac
@ -1116,6 +1227,47 @@ then
esac esac
fi fi
#echo '(Unable to guess system type)' 1>&2 cat >&2 <<EOF
$0: unable to guess system type
The $version version of this script cannot recognize your system type.
Please download the most up to date version of the config scripts:
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> 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 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:

163
config/unix/config.sub vendored
View File

@ -1,6 +1,10 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script, version 1.1. # 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. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME 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. # 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 # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1. # 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 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification. # It is wrong to echo any other type of specification.
if [ x$1 = x ] me=`echo "$0" | sed -e 's,.*/,,'`
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
# First pass through any local machine types. usage="\
case $1 in Usage: $0 [OPTION] CPU-MFR-OPSYS
*local*) $0 [OPTION] ALIAS
echo $1
exit 0 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 esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # 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. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
linux-gnu*) nto-qnx* | linux-gnu*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
@ -94,7 +131,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple) -apple | -axis)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
@ -169,15 +206,19 @@ case $basic_machine in
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \ | 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ | hppa64 \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ | 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 \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \ | mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30) | thumb | d10v | fr30 | avr)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) 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' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
i[34567]86) i[234567]86)
basic_machine=$basic_machine-pc basic_machine=$basic_machine-pc
;; ;;
# Object if more than one company name word. # Object if more than one company name word.
@ -196,13 +237,16 @@ case $basic_machine in
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here. # 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]* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \ | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ | 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-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \ | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
@ -210,9 +254,10 @@ case $basic_machine in
| mips64el-* | mips64orion-* | mips64orionel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \ | mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \ | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | 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 # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
@ -310,6 +355,9 @@ case $basic_machine in
crds | unos) crds | unos)
basic_machine=m68k-crds basic_machine=m68k-crds
;; ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*) da30 | da30-*)
basic_machine=m68k-da30 basic_machine=m68k-da30
;; ;;
@ -464,9 +512,6 @@ case $basic_machine in
basic_machine=i386-unknown basic_machine=i386-unknown
os=-mingw32 os=-mingw32
;; ;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d) iris | iris4d)
basic_machine=mips-sgi basic_machine=mips-sgi
case $os in case $os in
@ -513,6 +558,10 @@ case $basic_machine in
mips3*) mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;; ;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor) monitor)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
@ -585,6 +634,9 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*) op50n-* | op60c-*)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
@ -617,7 +669,7 @@ case $basic_machine in
pentium | p5 | k5 | k6 | nexen) pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86) pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2)
@ -626,7 +678,7 @@ case $basic_machine in
pentium-* | p5-* | k5-* | k6-* | nexen-*) pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-*)
@ -729,6 +781,10 @@ case $basic_machine in
sun386 | sun386i | roadrunner) sun386 | sun386i | roadrunner)
basic_machine=i386-sun basic_machine=i386-sun
;; ;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry) symmetry)
basic_machine=i386-sequent basic_machine=i386-sequent
os=-dynix os=-dynix
@ -737,6 +793,10 @@ case $basic_machine in
basic_machine=t3e-cray basic_machine=t3e-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
@ -838,6 +898,9 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4)
base_machine=sh-unknown
;;
sparc | sparcv9) sparc | sparcv9)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
@ -918,12 +981,25 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -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. # 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* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;; ;;
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
@ -940,6 +1016,9 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-wince*)
os=-wince
;;
-osfrose*) -osfrose*)
os=-osfrose os=-osfrose
;; ;;
@ -964,6 +1043,9 @@ case $os in
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk)
os=-nsk
;;
# Preserve the version number of sinix5. # Preserve the version number of sinix5.
-sinix5.*) -sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'` os=`echo $os | sed -e 's|sinix|sysv|'`
@ -977,9 +1059,6 @@ case $os in
-oss*) -oss*)
os=-sysv3 os=-sysv3
;; ;;
-qnx)
os=-qnx4
;;
-svr4) -svr4)
os=-sysv4 os=-sysv4
;; ;;
@ -1230,3 +1309,11 @@ case $basic_machine in
esac esac
echo $basic_machine$os 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:

View File

@ -119,7 +119,8 @@ ifdef BUILD_FREETYPE
# librarian library_file {list of object files} # librarian library_file {list of object files}
# #
$(FT_LIBRARY): $(OBJECTS_LIST) $(FT_LIBRARY): $(OBJECTS_LIST)
lcclib /out:$(subst /,\\,$@) $(subst /,\\,$(OBJECTS_LIST)) lcclib /out:$(subst $(SEP),$(HOSTSEP),$@) \
$(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST))
endif endif

View File

@ -94,7 +94,7 @@
<li> <li>
<p>Load each modules that FreeType knows about in the library. <p>Load each modules that FreeType knows about in the library.
This means that by default, your new <tt>library</tt> object is able This means that by default, your new <tt>library</tt> object is able
to handle TrueType, Type 1, CID-keyed & OpenType/CFF fonts to handle TrueType, Type&nbsp;1, CID-keyed & OpenType/CFF fonts
gracefully.</p> gracefully.</p>
</li> </li>
</ul> </ul>
@ -240,7 +240,8 @@
FreeType&nbsp;2 reference manual in order to learn how to use it.</p> FreeType&nbsp;2 reference manual in order to learn how to use it.</p>
<p>Note that providing a custom stream might also be used to access a <p>Note that providing a custom stream might also be used to access a
TrueType font embedded in a Postscript Type42 wrapper..</p> TrueType font embedded in a Postscript Type&nbsp;42 wrapper.</p>
<hr> <hr>
<h3> <h3>
@ -487,27 +488,26 @@
</li> </li>
<li> <li>
<p>If there is a glyph image in another format (e.g. a vectorial <p>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 outline), load it in the glyph slot. Then, scale it to the
current size, unless the <tt>FT_LOAD_NO_SCALE</tt> flag is current size, unless the <tt>FT_LOAD_NO_SCALE</tt> flag is
set.</p> set.</p>
</li> </li>
<li> <li>
<p>If the glyph image was loaded and scaled, try to grid-fit it (which <p>If the glyph image was loaded and scaled, try to grid-fit it
dramatically improves its quality) unless the flag (which dramatically improves its quality) unless the flag
<tt>FT_LOAD_NO_HINTING</tt> is set.</p> <tt>FT_LOAD_NO_HINTING</tt> is set.</p>
</li> </li>
<li> <li>
<p>If the glyph image is scalable, transform it through the current <p>If the glyph image is scalable, transform it through the
transform (that can be set with <tt>FT_Set_Transform</tt>).</p> current transform (which can be set with
<tt>FT_Set_Transform()</tt>).</p>
</li> </li>
<li> <li>
<p>Finally, if the <tt>FT_LOAD_RENDER</tt> flag is set, convert the <p>Finally, if the <tt>FT_LOAD_RENDER</tt> flag is set, convert
glyph image into a bitmap. By default, this means a 1-bit the glyph image into a bitmap. By default, this means a 1-bit
monochrome bitmap, unless <tt>FT_LOAD_ANTI_ALIAS</tt> is set, monochrome bitmap, unless <tt>FT_LOAD_ANTI_ALIAS</tt> is set,
where an 8-bit 256-gray-levels anti-aliased bitmap is generated. in which case an 8-bit 256-gray-levels anti-aliased bitmap is
</p> generated.</p>
</li> </li>
</ul> </ul>

View File

@ -143,6 +143,7 @@
FT_Int n = registry->num_extensions; FT_Int n = registry->num_extensions;
FT_Extension_Class* cur = registry->classes + n; FT_Extension_Class* cur = registry->classes + n;
if ( n >= FT_MAX_EXTENSIONS ) if ( n >= FT_MAX_EXTENSIONS )
return FT_Err_Too_Many_Extensions; return FT_Err_Too_Many_Extensions;

View File

@ -210,8 +210,8 @@
/* transform the outline -- note that the original metrics are NOT */ /* transform the outline -- note that the original metrics are NOT */
/* transformed by this, only the outline points themselves... */ /* transformed by this, only the outline points themselves... */
FT_Outline_Translate( &face->glyph->outline, FT_Outline_Translate( &face->glyph->outline,
origin_x, origin_x,
origin_y ); origin_y );
/* compute the size in pixels of the outline */ /* compute the size in pixels of the outline */
FT_Outline_Get_CBox( &face->glyph->outline, &cbox ); FT_Outline_Get_CBox( &face->glyph->outline, &cbox );

View File

@ -48,7 +48,7 @@
func = (FT_Get_MM_Func)driver->root.clazz->get_interface( func = (FT_Get_MM_Func)driver->root.clazz->get_interface(
FT_MODULE(driver), "get_mm" ); FT_MODULE( driver ), "get_mm" );
if ( func ) if ( func )
error = func( face, master ); error = func( face, master );
} }
@ -77,7 +77,7 @@
func = (FT_Set_MM_Design_Func)driver->root.clazz->get_interface( 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 ) if ( func )
error = func( face, num_coords, coords ); error = func( face, num_coords, coords );
} }
@ -106,7 +106,7 @@
func = (FT_Set_MM_Blend_Func)driver->root.clazz->get_interface( 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 ) if ( func )
error = func( face, num_coords, coords ); error = func( face, num_coords, coords );
} }

File diff suppressed because it is too large Load Diff

View File

@ -573,16 +573,17 @@
/* */ /* */
/* <Description> */ /* <Description> */
/* Renders an outline within a bitmap using the current scan-convert. */ /* Renders an outline within a bitmap using the current scan-convert. */
/* This functions uses a FT_Raster_Params as argument, allowing */ /* This functions uses an FT_Raster_Params structure as an argument, */
/* advanced features like direct composition/translucency, etc. */ /* allowing advanced features like direct composition, translucency, */
/* etc. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a FreeType library object. */ /* library :: A handle to a FreeType library object. */
/* */ /* */
/* outline :: A pointer to the source outline descriptor. */ /* outline :: A pointer to the source outline descriptor. */
/* */ /* */
/* params :: A pointer to a FT_Raster_Params used to describe */ /* params :: A pointer to a FT_Raster_Params structure used to */
/* the rendering operation. */ /* describe the rendering operation. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
@ -592,7 +593,7 @@
/* scan-line converter will be serialized. */ /* scan-line converter will be serialized. */
/* */ /* */
/* <Note> */ /* <Note> */
/* 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. */ /* to use this function. */
/* */ /* */
/* The field `params.source' will be set to `outline' before the scan */ /* The field `params.source' will be set to `outline' before the scan */
@ -606,6 +607,7 @@
FT_Error error; FT_Error error;
FT_Renderer renderer; FT_Renderer renderer;
if ( !library ) if ( !library )
{ {
error = FT_Err_Invalid_Library_Handle; error = FT_Err_Invalid_Library_Handle;
@ -620,7 +622,7 @@
/* retrieve the current outline renderer */ /* retrieve the current outline renderer */
renderer = library->cur_renderer; renderer = library->cur_renderer;
if (!renderer) if ( !renderer )
{ {
/* XXXX: should use another error code */ /* XXXX: should use another error code */
error = FT_Err_Invalid_Argument; error = FT_Err_Invalid_Argument;
@ -671,7 +673,8 @@
{ {
FT_Raster_Params params; FT_Raster_Params params;
if (!bitmap)
if ( !bitmap )
return FT_Err_Invalid_Argument; return FT_Err_Invalid_Argument;
/* other checks are delayed to FT_Outline_Render */ /* other checks are delayed to FT_Outline_Render */
@ -686,8 +689,6 @@
} }
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -713,6 +714,7 @@
{ {
FT_Pos xz, yz; FT_Pos xz, yz;
xz = FT_MulFix( vector->x, matrix->xx ) + xz = FT_MulFix( vector->x, matrix->xx ) +
FT_MulFix( vector->y, matrix->xy ); FT_MulFix( vector->y, matrix->xy );
@ -724,8 +726,6 @@
} }
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -753,6 +753,7 @@
FT_Vector* vec = outline->points; FT_Vector* vec = outline->points;
FT_Vector* limit = vec + outline->n_points; FT_Vector* limit = vec + outline->n_points;
for ( ; vec < limit; vec++ ) for ( ; vec < limit; vec++ )
FT_Vector_Transform( vec, matrix ); FT_Vector_Transform( vec, matrix );
} }

View File

@ -78,7 +78,7 @@
/* formats. */ /* formats. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only horizontal layouts (left-to-right & right-to-left) are */ /* Only horizontal layouts (left-to-right & right-to-left) are */
@ -169,7 +169,7 @@
/* whether to hint the outline, etc). */ /* whether to hint the outline, etc). */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Load_Glyph( T2_GlyphSlot slot, FT_Error Load_Glyph( T2_GlyphSlot slot,
@ -282,8 +282,10 @@
{ {
FT_Module sfnt; 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" ); sfnt = FT_Get_Module( driver->root.root.library, "sfnt" );
return sfnt ? sfnt->clazz->get_interface( sfnt, interface ) : 0; return sfnt ? sfnt->clazz->get_interface( sfnt, interface ) : 0;
} }
@ -297,14 +299,14 @@
ft_module_font_driver | ft_module_driver_scalable, ft_module_font_driver | ft_module_driver_scalable,
sizeof( T2_DriverRec ), sizeof( T2_DriverRec ),
"cff", "cff",
0x10000, 0x10000L,
0x20000, 0x20000L,
0, /* module-specific interface */ 0, /* module-specific interface */
(FT_Module_Constructor) T2_Init_Driver, (FT_Module_Constructor)T2_Init_Driver,
(FT_Module_Destructor) T2_Done_Driver, (FT_Module_Destructor) T2_Done_Driver,
(FT_Module_Requester) t2_get_interface, (FT_Module_Requester) t2_get_interface,
}, },
/* now the specific driver fields */ /* now the specific driver fields */
@ -312,22 +314,22 @@
sizeof( FT_SizeRec ), sizeof( FT_SizeRec ),
sizeof( T2_GlyphSlotRec ), sizeof( T2_GlyphSlotRec ),
(FTDriver_initFace) T2_Init_Face, (FTDriver_initFace) T2_Init_Face,
(FTDriver_doneFace) T2_Done_Face, (FTDriver_doneFace) T2_Done_Face,
(FTDriver_initSize) 0, (FTDriver_initSize) 0,
(FTDriver_doneSize) 0, (FTDriver_doneSize) 0,
(FTDriver_initGlyphSlot) 0, (FTDriver_initGlyphSlot)0,
(FTDriver_doneGlyphSlot) 0, (FTDriver_doneGlyphSlot)0,
(FTDriver_setCharSizes) 0, (FTDriver_setCharSizes) 0,
(FTDriver_setPixelSizes) 0, (FTDriver_setPixelSizes)0,
(FTDriver_loadGlyph) Load_Glyph, (FTDriver_loadGlyph) Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index, (FTDriver_getCharIndex) Get_Char_Index,
(FTDriver_getKerning) Get_Kerning, (FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) 0, (FTDriver_attachFile) 0,
(FTDriver_getAdvances) 0 (FTDriver_getAdvances) 0
}; };

View File

@ -233,6 +233,7 @@
{ {
FT_GlyphLoader* loader = glyph->root.loader; FT_GlyphLoader* loader = glyph->root.loader;
builder->loader = loader; builder->loader = loader;
builder->base = &loader->base.outline; builder->base = &loader->base.outline;
builder->current = &loader->current.outline; builder->current = &loader->current.outline;
@ -273,6 +274,7 @@
{ {
T2_GlyphSlot glyph = builder->glyph; T2_GlyphSlot glyph = builder->glyph;
if ( glyph ) if ( glyph )
glyph->root.outline = *builder->base; glyph->root.outline = *builder->base;
} }
@ -360,8 +362,7 @@
FT_Error check_points( T2_Builder* builder, FT_Error check_points( T2_Builder* builder,
FT_Int count ) FT_Int count )
{ {
return FT_GlyphLoader_Check_Points( builder->loader, return FT_GlyphLoader_Check_Points( builder->loader, count, 0 );
count, 0 );
} }
@ -374,11 +375,13 @@
{ {
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
if ( builder->load_points ) if ( builder->load_points )
{ {
FT_Vector* point = outline->points + outline->n_points; FT_Vector* point = outline->points + outline->n_points;
FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points;
point->x = x >> 16; point->x = x >> 16;
point->y = y >> 16; point->y = y >> 16;
*control = flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic; *control = flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic;
@ -397,6 +400,7 @@
{ {
FT_Error error; FT_Error error;
error = check_points( builder, 1 ); error = check_points( builder, 1 );
if ( !error ) if ( !error )
add_point( builder, x, y, 1 ); add_point( builder, x, y, 1 );
@ -412,6 +416,7 @@
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
FT_Error error; FT_Error error;
if ( !builder->load_points ) if ( !builder->load_points )
{ {
outline->n_contours++; outline->n_contours++;
@ -419,13 +424,14 @@
} }
error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 ); error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 );
if (!error) if ( !error )
{ {
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->contours[outline->n_contours - 1] = outline->n_points - 1;
outline->n_contours++; outline->n_contours++;
} }
return error; return error;
} }
@ -441,6 +447,7 @@
{ {
FT_Error error; FT_Error error;
builder->path_begun = 1; builder->path_begun = 1;
error = add_contour( builder ); error = add_contour( builder );
if ( error ) if ( error )
@ -457,6 +464,7 @@
{ {
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->contours[outline->n_contours - 1] = outline->n_points - 1;
} }
@ -484,7 +492,7 @@
/* charstring_len :: The length in bytes of the charstring stream. */ /* charstring_len :: The length in bytes of the charstring stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error T2_Parse_CharStrings( T2_Decoder* decoder, FT_Error T2_Parse_CharStrings( T2_Decoder* decoder,

View File

@ -68,7 +68,7 @@
/* face :: The newly built face object. */ /* face :: The newly built face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_DEF LOCAL_DEF
FT_Error T2_Init_Face( FT_Stream stream, FT_Error T2_Init_Face( FT_Stream stream,
@ -80,9 +80,10 @@
FT_Error error; FT_Error error;
SFNT_Interface* sfnt; SFNT_Interface* sfnt;
sfnt = (SFNT_Interface*) sfnt = (SFNT_Interface*)FT_Get_Module_Interface(
FT_Get_Module_Interface( face->root.driver->root.library,"sfnt" ); face->root.driver->root.library, "sfnt" );
if ( !sfnt ) goto Bad_Format; if ( !sfnt )
goto Bad_Format;
/* create input stream from resource */ /* create input stream from resource */
if ( FILE_Seek( 0 ) ) if ( FILE_Seek( 0 ) )
@ -188,7 +189,7 @@
/* driver :: A handle to the target driver object. */ /* driver :: A handle to the target driver object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error T2_Init_Driver( T2_Driver driver ) FT_Error T2_Init_Driver( T2_Driver driver )

View File

@ -159,11 +159,12 @@
{ {
FT_GlyphLoader* loader = glyph->root.loader; FT_GlyphLoader* loader = glyph->root.loader;
builder->loader = loader; builder->loader = loader;
builder->base = &loader->base.outline; builder->base = &loader->base.outline;
builder->current = &loader->current.outline; builder->current = &loader->current.outline;
FT_GlyphLoader_Rewind(loader); FT_GlyphLoader_Rewind( loader );
} }
if ( size ) if ( size )
@ -245,6 +246,7 @@
{ {
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
if ( builder->load_points ) if ( builder->load_points )
{ {
FT_Vector* point = outline->points + outline->n_points; FT_Vector* point = outline->points + outline->n_points;
@ -285,6 +287,7 @@
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
FT_Error error; FT_Error error;
if ( !builder->load_points ) if ( !builder->load_points )
{ {
outline->n_contours++; outline->n_contours++;
@ -292,7 +295,7 @@
} }
error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 ); error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 );
if (!error) if ( !error )
{ {
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->contours[outline->n_contours - 1] = outline->n_points - 1;
@ -314,6 +317,7 @@
{ {
FT_Error error; FT_Error error;
builder->path_begun = 1; builder->path_begun = 1;
error = add_contour( builder ); error = add_contour( builder );
if ( error ) if ( error )
@ -330,6 +334,7 @@
{ {
FT_Outline* outline = builder->current; FT_Outline* outline = builder->current;
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->contours[outline->n_contours - 1] = outline->n_points - 1;
} }
@ -410,7 +415,7 @@
/* achar :: The accent character's StandardEncoding charcode. */ /* achar :: The accent character's StandardEncoding charcode. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type 1 error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error t1operator_seac( CID_Decoder* decoder, FT_Error t1operator_seac( CID_Decoder* decoder,
@ -426,6 +431,7 @@
FT_Outline* base = decoder->builder.base; FT_Outline* base = decoder->builder.base;
FT_Vector left_bearing, advance; FT_Vector left_bearing, advance;
bchar_index = bchar; bchar_index = bchar;
achar_index = achar; achar_index = achar;
@ -435,19 +441,19 @@
return T1_Err_Syntax_Error; return T1_Err_Syntax_Error;
} }
/* if we are trying to load a composite glyph, do not load the */ /* if we are trying to load a composite glyph, do not load the */
/* accent character and return the array of subglyphs. */ /* accent character and return the array of subglyphs. */
if ( decoder->builder.no_recurse ) if ( decoder->builder.no_recurse )
{ {
FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph; FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
FT_GlyphLoader* loader = glyph->loader; FT_GlyphLoader* loader = glyph->loader;
FT_SubGlyph* subg; FT_SubGlyph* subg;
/* reallocate subglyph array if necessary */ /* reallocate subglyph array if necessary */
error = FT_GlyphLoader_Check_Subglyphs( loader, 2 ); error = FT_GlyphLoader_Check_Subglyphs( loader, 2 );
if (error) goto Exit; if ( error )
goto Exit;
subg = loader->current.subglyphs; subg = loader->current.subglyphs;
@ -474,11 +480,12 @@
/* First load `bchar' in builder */ /* First load `bchar' in builder */
/* now load the unscaled outline */ /* now load the unscaled outline */
if (decoder->builder.loader) if ( decoder->builder.loader )
FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ FT_GlyphLoader_Prepare( decoder->builder.loader );
error = cid_load_glyph( decoder, bchar_index ); /* load one glyph */ error = cid_load_glyph( decoder, bchar_index ); /* load one glyph */
if ( error ) goto Exit; if ( error )
goto Exit;
n_base_points = cur->n_points; n_base_points = cur->n_points;
@ -509,6 +516,7 @@
{ {
FT_Outline dummy; FT_Outline dummy;
dummy.n_points = base->n_points - n_base_points; dummy.n_points = base->n_points - n_base_points;
dummy.points = base->points + n_base_points; dummy.points = base->points + n_base_points;
FT_Outline_Translate( &dummy, adx - asb, ady ); FT_Outline_Translate( &dummy, adx - asb, ady );
@ -541,7 +549,7 @@
/* charstring_len :: The length in bytes of the charstring stream. */ /* charstring_len :: The length in bytes of the charstring stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type1 error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error CID_Parse_CharStrings( CID_Decoder* decoder, FT_Error CID_Parse_CharStrings( CID_Decoder* decoder,

View File

@ -110,7 +110,7 @@
/* face :: The newly built face object. */ /* face :: The newly built face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type1 error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error CID_Init_Face( FT_Stream stream, FT_Error CID_Init_Face( FT_Stream stream,
@ -133,8 +133,8 @@
psnames = (PSNames_Interface*)face->psnames; psnames = (PSNames_Interface*)face->psnames;
if ( !psnames ) if ( !psnames )
{ {
psnames = (PSNames_Interface*) psnames = (PSNames_Interface*)FT_Get_Module_Interface(
FT_Get_Module_Interface( FT_FACE_LIBRARY(face), "psnames" ); FT_FACE_LIBRARY( face ), "psnames" );
face->psnames = psnames; face->psnames = psnames;
} }
@ -337,14 +337,14 @@
/* driver :: A handle to the target driver object. */ /* driver :: A handle to the target driver object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type1 error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error CID_Init_Driver( T1_Driver driver ) FT_Error CID_Init_Driver( T1_Driver driver )
{ {
UNUSED( driver ); UNUSED( driver );
return FT_Err_Ok; return T1_Err_Ok;
} }

View File

@ -67,7 +67,7 @@
/* reallocations. */ /* reallocations. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type1 error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error T1_New_Table( T1_Table* table, FT_Error T1_New_Table( T1_Table* table,
@ -157,7 +157,7 @@
/* length :: The length in bytes of the source object. */ /* length :: The length in bytes of the source object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Type1 error code. 0 means success. An error is returned if */ /* FreeType error code. 0 means success. An error is returned if */
/* reallocation fails. */ /* reallocation fails. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC

View File

@ -38,8 +38,8 @@
static static
FT_Module_Interface CID_Get_Interface( FT_Driver driver, FT_Module_Interface CID_Get_Interface( FT_Driver driver,
const FT_String* interface ) const FT_String* interface )
{ {
UNUSED( driver ); UNUSED( driver );
UNUSED( interface ); UNUSED( interface );
@ -48,7 +48,7 @@
} }
#ifdef xxxT1_CONFIG_OPTION_NO_AFM #ifndef T1_CONFIG_OPTION_NO_AFM
static static
@ -71,20 +71,20 @@
} }
#endif /* xxxT1_CONFIG_OPTION_NO_AFM */ #endif /* !T1_CONFIG_OPTION_NO_AFM */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* cid_get_char_index */ /* Cid_Get_Char_Index */
/* */ /* */
/* <Description> */ /* <Description> */
/* Uses a charmap to return a given character code's glyph index. */ /* Uses a charmap to return a given character code's glyph index. */
/* */ /* */
/* <Input> */ /* <Input> */
/* charmap :: A handle to the source charmap object. */ /* charmap :: A handle to the source charmap object. */
/* */
/* charcode :: The character code. */ /* charcode :: The character code. */
/* */ /* */
/* <Return> */ /* <Return> */
@ -98,6 +98,7 @@
FT_UInt result = 0; FT_UInt result = 0;
PSNames_Interface* psnames; PSNames_Interface* psnames;
face = (T1_Face)charmap->face; face = (T1_Face)charmap->face;
psnames = (PSNames_Interface*)face->psnames; psnames = (PSNames_Interface*)face->psnames;
if ( psnames ) if ( psnames )
@ -173,7 +174,6 @@
} }
const FT_Driver_Class t1cid_driver_class = const FT_Driver_Class t1cid_driver_class =
{ {
/* firs of all, the FT_Module_Class fields */ /* firs of all, the FT_Module_Class fields */
@ -181,14 +181,14 @@
ft_module_font_driver | ft_module_driver_scalable, ft_module_font_driver | ft_module_driver_scalable,
sizeof( FT_DriverRec ), sizeof( FT_DriverRec ),
"t1cid", /* module name */ "t1cid", /* module name */
0x10000, /* version 1.0 of driver */ 0x10000L, /* version 1.0 of driver */
0x20000, /* requires FreeType 2.0 */ 0x20000L, /* requires FreeType 2.0 */
0, 0,
(FT_Module_Constructor) CID_Init_Driver, (FT_Module_Constructor)CID_Init_Driver,
(FT_Module_Destructor) CID_Done_Driver, (FT_Module_Destructor) CID_Done_Driver,
(FT_Module_Requester) CID_Get_Interface (FT_Module_Requester) CID_Get_Interface
}, },
/* then the other font drivers fields */ /* then the other font drivers fields */
@ -196,32 +196,30 @@
sizeof( T1_SizeRec ), sizeof( T1_SizeRec ),
sizeof( T1_GlyphSlotRec ), sizeof( T1_GlyphSlotRec ),
(FTDriver_initFace) CID_Init_Face, (FTDriver_initFace) CID_Init_Face,
(FTDriver_doneFace) CID_Done_Face, (FTDriver_doneFace) CID_Done_Face,
(FTDriver_initSize) 0, (FTDriver_initSize) 0,
(FTDriver_doneSize) 0, (FTDriver_doneSize) 0,
(FTDriver_initGlyphSlot) 0, (FTDriver_initGlyphSlot)0,
(FTDriver_doneGlyphSlot) 0, (FTDriver_doneGlyphSlot)0,
(FTDriver_setCharSizes) 0, (FTDriver_setCharSizes) 0,
(FTDriver_setPixelSizes) 0, (FTDriver_setPixelSizes)0,
(FTDriver_loadGlyph) CID_Load_Glyph, (FTDriver_loadGlyph) CID_Load_Glyph,
(FTDriver_getCharIndex) CID_Get_Char_Index, (FTDriver_getCharIndex) CID_Get_Char_Index,
#ifndef xxxxT1_CONFIG_OPTION_NO_AFM #ifdef T1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0, (FTDriver_getKerning) 0,
(FTDriver_attachFile) 0, (FTDriver_attachFile) 0,
#else #else
(FTDriver_getKerning) cid_Get_Kerning, (FTDriver_getKerning) cid_Get_Kerning,
(FTDriver_attachFile) CID_Read_AFM, (FTDriver_attachFile) CID_Read_AFM,
#endif #endif
(FTDriver_getAdvances) 0 (FTDriver_getAdvances) 0
}; };
/* END */ /* END */

View File

@ -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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -21,9 +21,9 @@
#include <freetype/ftmodule.h> #include <freetype/ftmodule.h>
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 */ /* END */

View File

@ -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 <freetype/internal/psnames.h> #include <freetype/internal/psnames.h>
#include <freetype/internal/ftobjs.h> #include <freetype/internal/ftobjs.h>
#include <psmodule.h> #include <psmodule.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> /* for strcmp(), strncpy() */
#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES #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 <pstables.h> #include <pstables.h>
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST #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 static
FT_ULong PS_Unicode_Value( const char* glyph_name ) FT_ULong PS_Unicode_Value( const char* glyph_name )
{ {
FT_Int n; FT_Int n;
char first = glyph_name[0]; char first = glyph_name[0];
char temp[64]; 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' && if ( glyph_name[0] == 'u' &&
glyph_name[1] == 'n' && glyph_name[1] == 'n' &&
glyph_name[2] == 'i' ) glyph_name[2] == 'i' )
{ {
/* determine wether the following characters are hexadecimal */ /* determine wether the following characters are hexadecimal */
FT_Int count; FT_Int count;
FT_ULong value = 0; FT_ULong value = 0;
const char* p = glyph_name + 4; const char* p = glyph_name + 4;
for ( count = 4;count > 0; count--, p++ )
for ( count = 4; count > 0; count--, p++ )
{ {
char c = *p; char c = *p;
unsigned char d; unsigned char d;
d = (unsigned char)c-'0';
if (d >= 10) d = (unsigned char)c - '0';
if ( d >= 10 )
{ {
d = (unsigned char)c - 'A'; d = (unsigned char)c - 'A';
if ( d >= 6 ) if ( d >= 6 )
@ -46,25 +74,27 @@
else else
d += 10; d += 10;
} }
/* exit if one non-uppercase-hexadecimal character was found */ /* exit if a non-uppercase-hexadecimal character was found */
if (d >= 16) if ( d >= 16 )
break; break;
value = (value << 4) + d; value = ( value << 4 ) + d;
if (count == 0) if ( count == 0 )
return value; return value;
} }
} }
/* look for a non-initial dot in the glyph name in order to */ /* 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; const char* p;
int len; int len;
p = glyph_name; p = glyph_name;
while ( *p && *p != '.' ) p++; while ( *p && *p != '.' )
len = p-glyph_name; p++;
len = p - glyph_name;
if ( *p && len < 64 ) if ( *p && len < 64 )
{ {
@ -79,35 +109,40 @@
{ {
const char* name = t1_standard_glyphs[n]; const char* name = t1_standard_glyphs[n];
if ( first == name[0] && strcmp( glyph_name, name ) == 0 ) if ( first == name[0] && strcmp( glyph_name, name ) == 0 )
return names_to_unicode[n]; return names_to_unicode[n];
} }
/* not found, there is probably no Unicode value for this glyph name */ /* not found, there is probably no Unicode value for this glyph name */
return 0; return 0;
} }
/* qsort callback to sort the unicode map */ /* qsort callback to sort the unicode map */
static 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* map1 = (PS_UniMap*)a;
PS_UniMap* map2 = (PS_UniMap*)b; PS_UniMap* map2 = (PS_UniMap*)b;
return ( map1->unicode < map2->unicode ? -1 : return ( map1->unicode < map2->unicode ? -1 :
map1->unicode > map2->unicode ? 1 : 0 ); 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 static
FT_Error PS_Build_Unicode_Table( FT_Memory memory, FT_Error PS_Build_Unicode_Table( FT_Memory memory,
FT_UInt num_glyphs, FT_UInt num_glyphs,
const char** glyph_names, const char** glyph_names,
PS_Unicodes *table ) PS_Unicodes* table )
{ {
FT_Error error; FT_Error error;
/* we first allocate the table */ /* we first allocate the table */
table->num_maps = 0; table->num_maps = 0;
table->maps = 0; table->maps = 0;
@ -119,14 +154,17 @@
PS_UniMap* map; PS_UniMap* map;
FT_ULong uni_char; FT_ULong uni_char;
map = table->maps; map = table->maps;
for ( n = 0; n < num_glyphs; n++ ) for ( n = 0; n < num_glyphs; n++ )
{ {
const char* gname = glyph_names[n]; const char* gname = glyph_names[n];
if (gname)
if ( gname )
{ {
uni_char = PS_Unicode_Value(gname); uni_char = PS_Unicode_Value( gname );
if (uni_char && uni_char != 0xFFFF) if ( uni_char && uni_char != 0xFFFF )
{ {
map->unicode = uni_char; map->unicode = uni_char;
map->glyph_index = n; map->glyph_index = n;
@ -138,102 +176,108 @@
/* now, compress the table a bit */ /* now, compress the table a bit */
count = map - table->maps; count = map - table->maps;
if ( count > 0 && REALLOC( table->maps, if ( count > 0 && REALLOC( table->maps,
num_glyphs*sizeof(PS_UniMap), num_glyphs * sizeof ( PS_UniMap ),
count*sizeof(PS_UniMap) ) ) count * sizeof ( PS_UniMap ) ) )
{
count = 0; count = 0;
}
if (count == 0) if ( count == 0 )
{ {
FREE( table->maps ); FREE( table->maps );
if (!error) if ( !error )
error = FT_Err_Invalid_Argument; /* no unicode chars here !! */ error = FT_Err_Invalid_Argument; /* no unicode chars here! */
} }
else else
/* sort the table in increasing order of unicode values */ /* 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; table->num_maps = count;
} }
return error; return error;
} }
static static
FT_UInt PS_Lookup_Unicode( PS_Unicodes* table, FT_UInt PS_Lookup_Unicode( PS_Unicodes* table,
FT_ULong unicode ) FT_ULong unicode )
{ {
PS_UniMap *min, *max, *mid; PS_UniMap *min, *max, *mid;
/* perform a binary search on the table */ /* perform a binary search on the table */
min = table->maps; min = table->maps;
max = min + table->num_maps - 1; 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 ) if ( mid->unicode == unicode )
return mid->glyph_index; return mid->glyph_index;
if (min == max) if ( min == max )
break; break;
if ( mid->unicode < unicode ) min = mid+1; if ( mid->unicode < unicode )
else max = mid-1; min = mid + 1;
else
max = mid - 1;
} }
return 0xFFFF; return 0xFFFF;
} }
#endif
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
static static
const char* PS_Macintosh_Name( FT_UInt name_index ) const char* PS_Macintosh_Name( FT_UInt name_index )
{ {
if (name_index >= 258) if ( name_index >= 258 )
name_index = 0; name_index = 0;
return standard_glyph_names[ mac_standard_names[name_index] ]; return standard_glyph_names[mac_standard_names[name_index]];
} }
static static
const char* PS_Standard_Strings( FT_UInt sid ) 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 #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,
#else
0,
0,
0,
#endif
(PS_Macintosh_Name_Func) PS_Macintosh_Name, (PS_Unicode_Value_Func) PS_Unicode_Value,
(PS_Adobe_Std_Strings_Func) PS_Standard_Strings, (PS_Build_Unicodes_Func) PS_Build_Unicode_Table,
(PS_Lookup_Unicode_Func) PS_Lookup_Unicode,
#else
0,
0,
0,
#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_standard_encoding,
t1_expert_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 = const FT_Module_Class psnames_module_class =
{ {
0, /* this is not a font driver, nor a renderer */ 0, /* this is not a font driver, nor a renderer */
sizeof(FT_ModuleRec), sizeof( FT_ModuleRec ),
"psnames", /* driver name */ "psnames", /* driver name */
100, /* driver version */ 100, /* driver version */
@ -245,8 +289,10 @@
(void*)&psnames_interface, /* module specific interface */ (void*)&psnames_interface, /* module specific interface */
#endif #endif
(FT_Module_Constructor) 0, (FT_Module_Constructor)0,
(FT_Module_Destructor) 0, (FT_Module_Destructor) 0,
(FT_Module_Requester) 0 (FT_Module_Requester) 0
}; };
/* END */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* High-level PSNames module interface (specification). */ /* High-level PSNames module interface (specification). */
/* */ /* */
/* Copyright 1996-1999 by */ /* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -21,9 +21,9 @@
#include <freetype/ftmodule.h> #include <freetype/ftmodule.h>
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 */ /* END */

View File

@ -25,6 +25,7 @@
#include <ttcmap.h> #include <ttcmap.h>
#include <sfobjs.h> #include <sfobjs.h>
static static
void* get_sfnt_table( TT_Face face, void* get_sfnt_table( TT_Face face,
FT_Sfnt_Tag tag ) FT_Sfnt_Tag tag )
@ -145,16 +146,15 @@
sizeof( FT_ModuleRec ), sizeof( FT_ModuleRec ),
"sfnt", /* driver name */ "sfnt", /* driver name */
0x10000, /* driver version 1.0 */ 0x10000L, /* driver version 1.0 */
0x20000, /* driver requires FreeType 2.0 or higher */ 0x20000L, /* driver requires FreeType 2.0 or higher */
(const void*)&sfnt_interface, /* module specific interface */ (const void*)&sfnt_interface, /* module specific interface */
(FT_Module_Constructor) 0, (FT_Module_Constructor)0,
(FT_Module_Destructor) 0, (FT_Module_Destructor) 0,
(FT_Module_Requester) SFNT_Get_Interface (FT_Module_Requester) SFNT_Get_Interface
}; };
/* END */ /* END */

View File

@ -21,7 +21,7 @@
#include <freetype/ftmodule.h> #include <freetype/ftmodule.h>
FT_EXPORT_VAR(const FT_Module_Class) sfnt_module_class; FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class;
#endif /* SFDRIVER_H */ #endif /* SFDRIVER_H */

View File

@ -59,7 +59,7 @@
/* table :: A pointer to a cmap object. */ /* table :: A pointer to a cmap object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The function assumes that the stream is already in use (i.e., */ /* The function assumes that the stream is already in use (i.e., */
@ -281,7 +281,7 @@
/* cmap :: A handle to a cmap object. */ /* cmap :: A handle to a cmap object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_CharMap_Free( TT_Face face, FT_Error TT_CharMap_Free( TT_Face face,

View File

@ -96,7 +96,7 @@
/* length :: The length of the table if found, undefined otherwise. */ /* length :: The length of the table if found, undefined otherwise. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Goto_Table( TT_Face face, FT_Error TT_Goto_Table( TT_Face face,
@ -141,7 +141,7 @@
/* sfnt :: The SFNT header. */ /* sfnt :: The SFNT header. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The stream cursor must be at the font file's origin. */ /* The stream cursor must be at the font file's origin. */
@ -275,7 +275,7 @@
/* sfnt :: The SFNT directory header. */ /* sfnt :: The SFNT directory header. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The stream cursor must be at the font file's origin. */ /* The stream cursor must be at the font file's origin. */
@ -373,7 +373,7 @@
/* buffer :: The address of target buffer. */ /* buffer :: The address of target buffer. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Any( TT_Face face, FT_Error TT_Load_Any( TT_Face face,
@ -436,7 +436,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Header( TT_Face face, FT_Error TT_Load_Header( TT_Face face,
@ -507,7 +507,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_MaxProfile( TT_Face face, FT_Error TT_Load_MaxProfile( TT_Face face,
@ -597,7 +597,7 @@
/* vertical :: A boolean flag. If set, load vertical metrics. */ /* vertical :: A boolean flag. If set, load vertical metrics. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error TT_Load_Metrics( TT_Face face, FT_Error TT_Load_Metrics( TT_Face face,
@ -733,7 +733,7 @@
/* vertical :: A boolean flag. If set, load vertical metrics. */ /* vertical :: A boolean flag. If set, load vertical metrics. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Metrics_Header( TT_Face face, FT_Error TT_Load_Metrics_Header( TT_Face face,
@ -829,7 +829,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Names( TT_Face face, FT_Error TT_Load_Names( TT_Face face,
@ -1020,7 +1020,7 @@
/* stream :: A handle to the input stream. */ /* stream :: A handle to the input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_CMap( TT_Face face, FT_Error TT_Load_CMap( TT_Face face,
@ -1129,7 +1129,7 @@
/* stream :: A handle to the input stream. */ /* stream :: A handle to the input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_OS2( TT_Face face, FT_Error TT_Load_OS2( TT_Face face,
@ -1263,7 +1263,7 @@
/* stream :: A handle to the input stream. */ /* stream :: A handle to the input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_PostScript( TT_Face face, FT_Error TT_Load_PostScript( TT_Face face,
@ -1318,7 +1318,7 @@
/* stream :: A handle to the input stream. */ /* stream :: A handle to the input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_PCLT( TT_Face face, FT_Error TT_Load_PCLT( TT_Face face,
@ -1389,7 +1389,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Gasp( TT_Face face, FT_Error TT_Load_Gasp( TT_Face face,
@ -1461,7 +1461,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Kern( TT_Face face, FT_Error TT_Load_Kern( TT_Face face,
@ -1566,7 +1566,7 @@
/* stream :: A handle to the input stream. */ /* stream :: A handle to the input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Hdmx( TT_Face face, FT_Error TT_Load_Hdmx( TT_Face face,

View File

@ -427,7 +427,7 @@
/* You must not modify the returned string! */ /* You must not modify the returned string! */
/* */ /* */
/* <Output> */ /* <Output> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Get_PS_Name( TT_Face face, FT_Error TT_Get_PS_Name( TT_Face face,

View File

@ -211,7 +211,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Load_SBit_Const_Metrics( TT_SBit_Range* range, FT_Error Load_SBit_Const_Metrics( TT_SBit_Range* range,
@ -243,7 +243,7 @@
/* load_offsets :: A flag whether to load the glyph offset table. */ /* load_offsets :: A flag whether to load the glyph offset table. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Load_SBit_Range_Codes( TT_SBit_Range* range, FT_Error Load_SBit_Range_Codes( TT_SBit_Range* range,
@ -306,7 +306,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Load_SBit_Range( TT_SBit_Range* range, FT_Error Load_SBit_Range( TT_SBit_Range* range,
@ -381,7 +381,7 @@
/* stream :: The input stream. */ /* stream :: The input stream. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_SBit_Strikes( TT_Face face, FT_Error TT_Load_SBit_Strikes( TT_Face face,
@ -631,7 +631,7 @@
/* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means the glyph index was found. */ /* FreeType error code. 0 means the glyph index was found. */
/* */ /* */
static static
FT_Error Find_SBit_Range( FT_UInt glyph_index, FT_Error Find_SBit_Range( FT_UInt glyph_index,
@ -735,7 +735,7 @@
/* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. Returns */ /* FreeType error code. 0 means success. Returns */
/* TT_Err_Invalid_Argument if no sbit exists for the requested glyph. */ /* TT_Err_Invalid_Argument if no sbit exists for the requested glyph. */
/* */ /* */
static static
@ -800,7 +800,7 @@
/* big_metrics :: A big SBit metrics structure for the glyph. */ /* big_metrics :: A big SBit metrics structure for the glyph. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The stream cursor must be positioned at the glyph's offset within */ /* The stream cursor must be positioned at the glyph's offset within */
@ -1349,7 +1349,7 @@
/* metrics :: A big sbit metrics structure for the glyph image. */ /* metrics :: A big sbit metrics structure for the glyph image. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. Returns an error if no */ /* FreeType error code. 0 means success. Returns an error if no */
/* glyph sbit exists for the index. */ /* glyph sbit exists for the index. */
/* */ /* */
/* <Note> */ /* <Note> */

View File

@ -75,7 +75,7 @@
/* formats. */ /* formats. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only horizontal layouts (left-to-right & right-to-left) are */ /* Only horizontal layouts (left-to-right & right-to-left) are */
@ -178,7 +178,7 @@
/* size :: A handle to the target size object. */ /* size :: A handle to the target size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Set_Char_Sizes( TT_Size size, FT_Error Set_Char_Sizes( TT_Size size,
@ -238,7 +238,7 @@
/* size :: A handle to the target size object. */ /* size :: A handle to the target size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Set_Pixel_Sizes( TT_Size size, FT_Error Set_Pixel_Sizes( TT_Size size,
@ -280,7 +280,7 @@
/* whether to hint the outline, etc). */ /* whether to hint the outline, etc). */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Load_Glyph( TT_GlyphSlot slot, FT_Error Load_Glyph( TT_GlyphSlot slot,
@ -398,18 +398,20 @@
static static
FT_Module_Interface tt_get_interface( TT_Driver driver, FT_Module_Interface tt_get_interface( TT_Driver driver,
const char* interface ) const char* interface )
{ {
FT_Module sfntd = FT_Get_Module( driver->root.root.library, "sfnt" ); FT_Module sfntd = FT_Get_Module( driver->root.root.library,
"sfnt" );
SFNT_Interface* sfnt; SFNT_Interface* sfnt;
/* only return the default interface from the SFNT module */ /* only return the default interface from the SFNT module */
if ( sfntd ) if ( sfntd )
{ {
sfnt = (SFNT_Interface*)(sfntd->clazz->module_interface); sfnt = (SFNT_Interface*)( sfntd->clazz->module_interface );
if ( sfnt ) if ( sfnt )
return sfnt->get_interface( FT_MODULE(driver), interface ); return sfnt->get_interface( FT_MODULE( driver ), interface );
} }
return 0; return 0;
@ -425,14 +427,14 @@
sizeof ( TT_DriverRec ), sizeof ( TT_DriverRec ),
"truetype", /* driver name */ "truetype", /* driver name */
0x10000, /* driver version == 1.0 */ 0x10000L, /* driver version == 1.0 */
0x20000, /* driver requires FreeType 2.0 or above */ 0x20000L, /* driver requires FreeType 2.0 or above */
(void*)0, /* driver specific interface */ (void*)0, /* driver specific interface */
(FT_Module_Constructor) TT_Init_Driver, (FT_Module_Constructor)TT_Init_Driver,
(FT_Module_Destructor) TT_Done_Driver, (FT_Module_Destructor) TT_Done_Driver,
(FT_Module_Requester) tt_get_interface, (FT_Module_Requester) tt_get_interface,
}, },
sizeof ( TT_FaceRec ), sizeof ( TT_FaceRec ),
@ -440,23 +442,21 @@
sizeof ( FT_GlyphSlotRec ), sizeof ( FT_GlyphSlotRec ),
(FTDriver_initFace) TT_Init_Face, (FTDriver_initFace) TT_Init_Face,
(FTDriver_doneFace) TT_Done_Face, (FTDriver_doneFace) TT_Done_Face,
(FTDriver_initSize) TT_Init_Size, (FTDriver_initSize) TT_Init_Size,
(FTDriver_doneSize) TT_Done_Size, (FTDriver_doneSize) TT_Done_Size,
(FTDriver_initGlyphSlot) 0, (FTDriver_initGlyphSlot)0,
(FTDriver_doneGlyphSlot) 0, (FTDriver_doneGlyphSlot)0,
(FTDriver_setCharSizes) Set_Char_Sizes,
(FTDriver_setPixelSizes) Set_Pixel_Sizes,
(FTDriver_loadGlyph) Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index,
(FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) 0,
(FTDriver_getAdvances) 0
(FTDriver_setCharSizes) Set_Char_Sizes,
(FTDriver_setPixelSizes)Set_Pixel_Sizes,
(FTDriver_loadGlyph) Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index,
(FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) 0,
(FTDriver_getAdvances) 0
}; };

View File

@ -196,8 +196,9 @@
/* */ /* */
/* The following functions are used by default with TrueType fonts. */ /* The following functions are used by default with TrueType fonts. */
/* However, they can be replaced by alternatives if we need to support */ /* However, they can be replaced by alternatives if we need to support */
/* TrueType-compressed formats (like MicroType) in the future.. */ /* TrueType-compressed formats (like MicroType) in the future. */
/* */ /* */
/*************************************************************************/
static static
FT_Error TT_Access_Glyph_Frame( TT_Loader* loader, FT_Error TT_Access_Glyph_Frame( TT_Loader* loader,
@ -208,7 +209,8 @@
FT_Error error; FT_Error error;
FT_Stream stream = loader->stream; FT_Stream stream = loader->stream;
/* the following line sets the 'error' variable through macros !! */
/* the following line sets the `error' variable through macros! */
(void)( FILE_Seek( offset ) || ACCESS_Frame( byte_count ) ); (void)( FILE_Seek( offset ) || ACCESS_Frame( byte_count ) );
FT_TRACE5(( "Glyph %ld\n", glyph_index )); FT_TRACE5(( "Glyph %ld\n", glyph_index ));
@ -216,21 +218,22 @@
} }
static static
void TT_Forget_Glyph_Frame( TT_Loader* loader ) void TT_Forget_Glyph_Frame( TT_Loader* loader )
{ {
FT_Stream stream = loader->stream; FT_Stream stream = loader->stream;
FORGET_Frame(); FORGET_Frame();
} }
static static
FT_Error TT_Load_Glyph_Header( TT_Loader* loader ) FT_Error TT_Load_Glyph_Header( TT_Loader* loader )
{ {
FT_Stream stream = loader->stream; FT_Stream stream = loader->stream;
loader->n_contours = GET_Short(); loader->n_contours = GET_Short();
loader->bbox.xMin = GET_Short(); loader->bbox.xMin = GET_Short();
@ -248,7 +251,6 @@
} }
static static
FT_Error TT_Load_Simple_Glyph( TT_Loader* load ) FT_Error TT_Load_Simple_Glyph( TT_Loader* load )
{ {
@ -268,15 +270,17 @@
short* cur = gloader->current.outline.contours; short* cur = gloader->current.outline.contours;
short* limit = cur + n_contours; short* limit = cur + n_contours;
for ( ; cur < limit; cur++ ) for ( ; cur < limit; cur++ )
cur[0] = GET_UShort(); cur[0] = GET_UShort();
n_points = 0; n_points = 0;
if (n_contours > 0) if ( n_contours > 0 )
n_points = cur[-1]+1; n_points = cur[-1] + 1;
error = FT_GlyphLoader_Check_Points( gloader, n_points+2, 0 ); error = FT_GlyphLoader_Check_Points( gloader, n_points + 2, 0 );
if (error) goto Fail; if ( error )
goto Fail;
outline = &gloader->current.outline; outline = &gloader->current.outline;
} }
@ -305,7 +309,8 @@
} }
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
if ( ( load->load_flags &
if ( ( load->load_flags &
( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) == 0 && ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) == 0 &&
load->instructions ) load->instructions )
{ {
@ -314,6 +319,7 @@
MEM_Copy( load->instructions, stream->cursor, n_ins ); MEM_Copy( load->instructions, stream->cursor, n_ins );
} }
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
stream->cursor += n_ins; stream->cursor += n_ins;
@ -325,6 +331,7 @@
FT_Byte* limit = flag + n_points; FT_Byte* limit = flag + n_points;
FT_Byte c, count; FT_Byte c, count;
for ( ; flag < limit; flag++ ) for ( ; flag < limit; flag++ )
{ {
*flag = c = GET_Byte(); *flag = c = GET_Byte();
@ -413,14 +420,18 @@
FT_SubGlyph* subglyph; FT_SubGlyph* subglyph;
FT_UInt num_subglyphs; FT_UInt num_subglyphs;
num_subglyphs = 0; num_subglyphs = 0;
do do
{ {
FT_Fixed xx, xy, yy, yx; FT_Fixed xx, xy, yy, yx;
/* check that we can load a new subglyph */ /* check that we can load a new subglyph */
error = FT_GlyphLoader_Check_Subglyphs( gloader, num_subglyphs+1 ); error = FT_GlyphLoader_Check_Subglyphs( gloader, num_subglyphs+1 );
if (error) goto Fail; if ( error )
goto Fail;
subglyph = gloader->current.subglyphs + num_subglyphs; subglyph = gloader->current.subglyphs + num_subglyphs;
@ -508,11 +519,11 @@
/* <Description> */ /* <Description> */
/* Once a simple glyph has been loaded, it needs to be processed. */ /* Once a simple glyph has been loaded, it needs to be processed. */
/* Usually, this means scaling and hinting through bytecode */ /* Usually, this means scaling and hinting through bytecode */
/* interpretation.. */ /* interpretation. */
/* */ /* */
static static
FT_Error TT_Process_Simple_Glyph( TT_Loader* load, FT_Error TT_Process_Simple_Glyph( TT_Loader* load,
FT_Bool debug ) FT_Bool debug )
{ {
FT_GlyphLoader* gloader = load->gloader; FT_GlyphLoader* gloader = load->gloader;
FT_Outline* outline = &gloader->current.outline; FT_Outline* outline = &gloader->current.outline;
@ -521,6 +532,7 @@
TT_GlyphZone* zone = &load->zone; TT_GlyphZone* zone = &load->zone;
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
n_ins = load->glyph->control_len; n_ins = load->glyph->control_len;
/* add shadow points */ /* add shadow points */
@ -532,6 +544,7 @@
FT_Vector* pp1; FT_Vector* pp1;
FT_Vector* pp2; FT_Vector* pp2;
/* pp1 = xMin - lsb */ /* pp1 = xMin - lsb */
pp1 = outline->points + n_points; pp1 = outline->points + n_points;
pp1->x = load->bbox.xMin - load->left_bearing; pp1->x = load->bbox.xMin - load->left_bearing;
@ -555,7 +568,7 @@
tt_prepare_zone( zone, &gloader->current, 0, 0 ); tt_prepare_zone( zone, &gloader->current, 0, 0 );
/* eventually scale the glyph */ /* eventually scale the glyph */
if (!(load->load_flags & FT_LOAD_NO_SCALE)) if ( !( load->load_flags & FT_LOAD_NO_SCALE ) )
{ {
FT_Vector* vec = zone->cur; FT_Vector* vec = zone->cur;
FT_Vector* limit = vec + n_points; FT_Vector* limit = vec + n_points;
@ -573,10 +586,11 @@
cur_to_org( n_points, zone ); cur_to_org( n_points, zone );
/* eventually hint the glyph */ /* eventually hint the glyph */
if ( IS_HINTED(load->load_flags) ) if ( IS_HINTED( load->load_flags ) )
{ {
FT_Pos x = zone->org[n_points-2].x; FT_Pos x = zone->org[n_points-2].x;
x = ( ( x + 32 ) & -64 ) - x; x = ( ( x + 32 ) & -64 ) - x;
translate_array( n_points, zone->org, x, 0 ); translate_array( n_points, zone->org, x, 0 );
@ -585,16 +599,18 @@
zone->cur[n_points - 1].x = ( zone->cur[n_points - 1].x + 32 ) & -64; zone->cur[n_points - 1].x = ( zone->cur[n_points - 1].x + 32 ) & -64;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/* now consider hinting */ /* now consider hinting */
if ( n_ins > 0 ) if ( n_ins > 0 )
{ {
error = TT_Set_CodeRange( load->exec, tt_coderange_glyph, error = TT_Set_CodeRange( load->exec, tt_coderange_glyph,
load->exec->glyphIns, n_ins ); load->exec->glyphIns, n_ins );
if ( error ) goto Exit; if ( error )
goto Exit;
load->exec->is_composite = FALSE; load->exec->is_composite = FALSE;
load->exec->pedantic_hinting = (FT_Bool)(load->load_flags & load->exec->pedantic_hinting = (FT_Bool)( load->load_flags &
FT_LOAD_PEDANTIC); FT_LOAD_PEDANTIC );
load->exec->pts = *zone; load->exec->pts = *zone;
load->exec->pts.n_points += 2; load->exec->pts.n_points += 2;
@ -604,7 +620,9 @@
error = FT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */ error = FT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */
} }
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
} }
/* save glyph phantom points */ /* save glyph phantom points */
@ -619,10 +637,6 @@
} }
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -718,13 +732,15 @@
/* access glyph frame */ /* access glyph frame */
error = face->access_glyph_frame( loader, glyph_index, offset, count ); error = face->access_glyph_frame( loader, glyph_index, offset, count );
if (error) goto Exit; if ( error )
goto Exit;
opened_frame = 1; opened_frame = 1;
/* read first glyph header */ /* read first glyph header */
error = face->read_glyph_header( loader ); error = face->read_glyph_header( loader );
if (error) goto Fail; if ( error )
goto Fail;
contours_count = loader->n_contours; contours_count = loader->n_contours;
@ -751,10 +767,12 @@
{ {
/* check that we can add the contours to the glyph */ /* check that we can add the contours to the glyph */
error = FT_GlyphLoader_Check_Points( gloader, 0, contours_count ); error = FT_GlyphLoader_Check_Points( gloader, 0, contours_count );
if (error) goto Fail; if ( error )
goto Fail;
error = face->read_simple_glyph( loader ); error = face->read_simple_glyph( loader );
if (error) goto Fail; if ( error )
goto Fail;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
{ {
@ -783,13 +801,14 @@
TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph;
FT_UInt start_point, start_contour; FT_UInt start_point, start_contour;
/* for each subglyph, read composite header */ /* for each subglyph, read composite header */
start_point = gloader->base.outline.n_points; start_point = gloader->base.outline.n_points;
start_contour = gloader->base.outline.n_contours; start_contour = gloader->base.outline.n_contours;
error = face->read_composite_glyph( loader ); error = face->read_composite_glyph( loader );
if (error) goto Fail; if ( error )
goto Fail;
face->forget_glyph_frame( loader ); face->forget_glyph_frame( loader );
opened_frame = 0; opened_frame = 0;
@ -832,10 +851,10 @@
FT_Vector pp1, pp2; FT_Vector pp1, pp2;
FT_Pos x, y; FT_Pos x, y;
/* each time we call load_truetype_glyph in this loop, the */ /* Each time we call load_truetype_glyph in this loop, the */
/* value of 'gloader.base.subglyphs' can change due to table */ /* value of `gloader.base.subglyphs' can change due to table */
/* reallocations. We thus need to recompute the subglyph */ /* reallocations. We thus need to recompute the subglyph */
/* pointer on each iteration.. */ /* pointer on each iteration. */
subglyph = gloader->base.subglyphs + num_base_subgs + n; subglyph = gloader->base.subglyphs + num_base_subgs + n;
pp1 = loader->pp1; pp1 = loader->pp1;
@ -870,8 +889,10 @@
WE_HAVE_AN_XY_SCALE | WE_HAVE_AN_XY_SCALE |
WE_HAVE_A_2X2 ) ) WE_HAVE_A_2X2 ) )
{ {
FT_Vector* cur = gloader->base.outline.points + num_base_points; FT_Vector* cur = gloader->base.outline.points +
FT_Vector* org = gloader->base.extra_points + num_base_points; num_base_points;
FT_Vector* org = gloader->base.extra_points +
num_base_points;
FT_Vector* limit = cur + num_new_points; FT_Vector* limit = cur + num_new_points;
for ( ; cur < limit; cur++, org++ ) for ( ; cur < limit; cur++, org++ )
@ -890,6 +911,7 @@
FT_Vector* p1; FT_Vector* p1;
FT_Vector* p2; FT_Vector* p2;
if ( start_point + k >= num_base_points || if ( start_point + k >= num_base_points ||
l >= (FT_UInt)num_new_points ) l >= (FT_UInt)num_new_points )
{ {
@ -950,12 +972,12 @@
/* read size of instructions */ /* read size of instructions */
if ( FILE_Seek( loader->ins_pos ) || if ( FILE_Seek( loader->ins_pos ) ||
READ_UShort(n_ins) ) READ_UShort( n_ins ) )
goto Fail; goto Fail;
FT_TRACE5(( " Instructions size = %d\n", n_ins )); FT_TRACE5(( " Instructions size = %d\n", n_ins ));
/* in some fonts ?? */ /* in some fonts ?? */
if (n_ins == 0xFFFF) if ( n_ins == 0xFFFF )
n_ins = 0; n_ins = 0;
/* check it */ /* check it */
@ -981,7 +1003,8 @@
goto Fail; goto Fail;
/* prepare the execution context */ /* prepare the execution context */
tt_prepare_zone( &exec->pts, &gloader->base, start_point, start_contour ); tt_prepare_zone( &exec->pts, &gloader->base,
start_point, start_contour );
pts = &exec->pts; pts = &exec->pts;
pts->n_points = num_points + 2; pts->n_points = num_points + 2;
@ -1039,7 +1062,7 @@
/***********************************************************************/ /***********************************************************************/
Fail: Fail:
if (opened_frame) if ( opened_frame )
face->forget_glyph_frame( loader ); face->forget_glyph_frame( loader );
Exit: Exit:
@ -1090,11 +1113,12 @@
else else
bbox = loader->bbox; bbox = loader->bbox;
/* get the device-independent horizontal advance. It is scaled later */ /* get the device-independent horizontal advance. It is scaled later */
/* by the base layer.. */ /* by the base layer. */
{ {
FT_Pos advance = loader->advance; FT_Pos advance = loader->advance;
/* the flag FT_LOAD_NO_ADVANCE_CHECK was introduced to */ /* the flag FT_LOAD_NO_ADVANCE_CHECK was introduced to */
/* correctly support DynaLab fonts, which have an incorrect */ /* correctly support DynaLab fonts, which have an incorrect */
/* `advance_Width_Max' field! It is used, to my knowledge, */ /* `advance_Width_Max' field! It is used, to my knowledge, */
@ -1105,7 +1129,7 @@
advance = face->horizontal.advance_Width_Max; advance = face->horizontal.advance_Width_Max;
/* we need to return the advance in font units in linearHoriAdvance, */ /* we need to return the advance in font units in linearHoriAdvance, */
/* it will be scaled later by the base layer.. */ /* it will be scaled later by the base layer. */
glyph->linearHoriAdvance = advance; glyph->linearHoriAdvance = advance;
} }
@ -1188,13 +1212,13 @@
advance = advance_height; advance = advance_height;
} }
/* set the advance height in design units. It is scaled later by the */ /* set the advance height in design units. It is scaled later by */
/* base layer.. */ /* the base layer. */
glyph->linearVertAdvance = advance_height; glyph->linearVertAdvance = advance_height;
/* XXX: for now, we have no better algorithm for the lsb, but it */ /* XXX: for now, we have no better algorithm for the lsb, but it */
/* should work fine. */ /* should work fine. */
/* */ /* */
left = ( bbox.xMin - bbox.xMax ) / 2; left = ( bbox.xMin - bbox.xMax ) / 2;
/* grid-fit them if necessary */ /* grid-fit them if necessary */
@ -1252,7 +1276,7 @@
/* whether to hint the outline, etc). */ /* whether to hint the outline, etc). */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Load_Glyph( TT_Size size, FT_Error TT_Load_Glyph( TT_Size size,
@ -1353,6 +1377,7 @@
{ {
FT_GlyphLoader* gloader = FT_FACE_DRIVER(face)->glyph_loader; FT_GlyphLoader* gloader = FT_FACE_DRIVER(face)->glyph_loader;
loader.gloader = gloader; loader.gloader = gloader;
FT_GlyphLoader_Rewind( gloader ); FT_GlyphLoader_Rewind( gloader );

View File

@ -257,7 +257,7 @@
/* exec :: The target execution context. */ /* exec :: The target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Goto_CodeRange( TT_ExecContext exec, FT_Error TT_Goto_CodeRange( TT_ExecContext exec,
@ -307,7 +307,7 @@
/* exec :: The target execution context. */ /* exec :: The target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Set_CodeRange( TT_ExecContext exec, FT_Error TT_Set_CodeRange( TT_ExecContext exec,
@ -339,7 +339,7 @@
/* exec :: The target execution context. */ /* exec :: The target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Does not set the Error variable. */ /* Does not set the Error variable. */
@ -378,7 +378,7 @@
/* memory :: A handle to the parent memory object. */ /* memory :: A handle to the parent memory object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only the glyph loader and debugger should call this function. */ /* Only the glyph loader and debugger should call this function. */
@ -433,7 +433,7 @@
/* exec :: A handle to the target execution context. */ /* exec :: A handle to the target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Init_Context( TT_ExecContext exec, FT_Error Init_Context( TT_ExecContext exec,
@ -504,7 +504,7 @@
/* buff :: The address of the buffer base pointer. */ /* buff :: The address of the buffer base pointer. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static static
FT_Error Update_Max( FT_Memory memory, FT_Error Update_Max( FT_Memory memory,
@ -546,7 +546,7 @@
/* exec :: A handle to the target execution context. */ /* exec :: A handle to the target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only the glyph loader and debugger should call this function. */ /* Only the glyph loader and debugger should call this function. */
@ -649,7 +649,7 @@
/* size :: A handle to the target size object. */ /* size :: A handle to the target size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only the glyph loader and debugger should call this function. */ /* Only the glyph loader and debugger should call this function. */
@ -834,7 +834,7 @@
/* exec :: A handle to the target execution context. */ /* exec :: A handle to the target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only the glyph loader and debugger should call this function. */ /* Only the glyph loader and debugger should call this function. */
@ -6781,7 +6781,7 @@
/* exec :: A handle to the target execution context. */ /* exec :: A handle to the target execution context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Only the object manager and debugger should call this function. */ /* Only the object manager and debugger should call this function. */

View File

@ -143,7 +143,7 @@
/* face :: The newly built face object. */ /* face :: The newly built face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_DEF LOCAL_DEF
FT_Error TT_Init_Face( FT_Stream stream, FT_Error TT_Init_Face( FT_Stream stream,
@ -158,7 +158,8 @@
library = face->root.driver->root.library; library = face->root.driver->root.library;
sfnt = (SFNT_Interface*)FT_Get_Module_Interface( library, "sfnt" ); sfnt = (SFNT_Interface*)FT_Get_Module_Interface( library, "sfnt" );
if (!sfnt) goto Bad_Format; if ( !sfnt )
goto Bad_Format;
/* create input stream from resource */ /* create input stream from resource */
if ( FILE_Seek( 0 ) ) if ( FILE_Seek( 0 ) )
@ -190,7 +191,7 @@
TT_Load_CVT ( face, stream ) || TT_Load_CVT ( face, stream ) ||
TT_Load_Programs ( face, stream ); TT_Load_Programs ( face, stream );
/* initialise standard glyph loading routines */ /* initialize standard glyph loading routines */
TT_Init_Glyph_Loading( face ); TT_Init_Glyph_Loading( face );
Exit: Exit:
@ -221,8 +222,8 @@
SFNT_Interface* sfnt = face->sfnt; SFNT_Interface* sfnt = face->sfnt;
/* for "extended TrueType formats" (i.e. compressed versions) */ /* for `extended TrueType formats' (i.e. compressed versions) */
if (face->extra.finalizer) if ( face->extra.finalizer )
face->extra.finalizer( face->extra.data ); face->extra.finalizer( face->extra.data );
if ( sfnt ) if ( sfnt )
@ -263,7 +264,7 @@
/* size :: A handle to the size object. */ /* size :: A handle to the size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_DEF LOCAL_DEF
FT_Error TT_Init_Size( TT_Size size ) FT_Error TT_Init_Size( TT_Size size )
@ -341,6 +342,7 @@
{ {
FT_Library library = face->root.driver->root.library; FT_Library library = face->root.driver->root.library;
face->interpreter = (TT_Interpreter) face->interpreter = (TT_Interpreter)
library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE];
if ( !face->interpreter ) if ( !face->interpreter )
@ -652,20 +654,21 @@
/* driver :: A handle to the target driver object. */ /* driver :: A handle to the target driver object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* TrueType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC LOCAL_FUNC
FT_Error TT_Init_Driver( TT_Driver driver ) FT_Error TT_Init_Driver( TT_Driver driver )
{ {
FT_Error error; FT_Error error;
/* set 'extra' in glyph loader */
error = FT_GlyphLoader_Create_Extra( FT_DRIVER(driver)->glyph_loader ); /* set `extra' in glyph loader */
error = FT_GlyphLoader_Create_Extra( FT_DRIVER( driver )->glyph_loader );
/* init extension registry if needed */ /* init extension registry if needed */
#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE #ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
if (!error) if ( !error )
return TT_Init_Extensions( driver ); return TT_Init_Extensions( driver );
#endif #endif

View File

@ -1,47 +1,59 @@
/*************************************************************************** /***************************************************************************/
* /* */
* t1afm.h - support for reading Type 1 AFM files /* t1afm.h */
* /* */
* /* AFM support for Type 1 fonts (specification). */
***************************************************************************/ /* */
/* 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. */
/* */
/***************************************************************************/
#ifndef T1AFM_H #ifndef T1AFM_H
#define T1AFM_H #define T1AFM_H
#include <freetype/internal/ftobjs.h> #include <freetype/internal/ftobjs.h>
/* In this version, we only read the kerning table from the */
/* AFM file. We may add support for ligatures a bit later.. */
typedef struct T1_Kern_Pair_ typedef struct T1_Kern_Pair_
{ {
FT_UInt glyph1; FT_UInt glyph1;
FT_UInt glyph2; FT_UInt glyph2;
FT_Vector kerning; FT_Vector kerning;
} T1_Kern_Pair; } T1_Kern_Pair;
typedef struct T1_AFM_
{
FT_Int num_pairs;
T1_Kern_Pair* kern_pairs;
} T1_AFM;
typedef struct T1_AFM_ LOCAL_DEF
{ FT_Error T1_Read_AFM( FT_Face face,
FT_Int num_pairs; FT_Stream stream );
T1_Kern_Pair* kern_pairs;
} T1_AFM; LOCAL_DEF
void T1_Done_AFM( FT_Memory memory,
T1_AFM* afm );
LOCAL_DEF
void T1_Get_Kerning( T1_AFM* afm,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
LOCAL_DEF
FT_Error T1_Read_AFM( FT_Face face,
FT_Stream stream );
LOCAL_DEF
void T1_Done_AFM( FT_Memory memory,
T1_AFM* afm );
LOCAL_DEF
void T1_Get_Kerning( T1_AFM* afm,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
#endif /* T1AFM_H */ #endif /* T1AFM_H */
/* END */

View File

@ -1,19 +1,20 @@
/******************************************************************* /***************************************************************************/
* /* */
* t1driver.c /* t1driver.c */
* /* */
* High-level Type1 driver interface for FreeType 2.0 /* Type 1 driver interface (body). */
* /* */
* Copyright 1996-1998 by /* Copyright 1996-2000 by */
* David Turner, Robert Wilhelm, and Werner Lemberg. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
* /* */
* This file is part of the FreeType project, and may only be used, /* This file is part of the FreeType project, and may only be used, */
* modified, and distributed under the terms of the FreeType project /* modified, and distributed under the terms of the FreeType project */
* license, LICENSE.TXT. By continuing to use, modify, or distribute /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
* this file you indicate that you have read the license and /* this file you indicate that you have read the license and */
* understand and accept it fully. /* understand and accept it fully. */
* /* */
******************************************************************/ /***************************************************************************/
#include <t1driver.h> #include <t1driver.h>
#include <t1gload.h> #include <t1gload.h>
@ -23,11 +24,22 @@
#include <freetype/internal/ftstream.h> #include <freetype/internal/ftstream.h>
#include <freetype/internal/psnames.h> #include <freetype/internal/psnames.h>
#include <string.h> /* for strcmp() */
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT #undef FT_COMPONENT
#define FT_COMPONENT trace_t1driver #define FT_COMPONENT trace_t1driver
#ifndef T1_CONFIG_OPTION_NO_AFM #ifndef T1_CONFIG_OPTION_NO_AFM
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -68,85 +80,96 @@
{ {
T1_AFM* afm; T1_AFM* afm;
kerning->x = 0; kerning->x = 0;
kerning->y = 0; kerning->y = 0;
afm = (T1_AFM*)face->afm_data; afm = (T1_AFM*)face->afm_data;
if (afm) if ( afm )
T1_Get_Kerning( afm, left_glyph, right_glyph, kerning ); T1_Get_Kerning( afm, left_glyph, right_glyph, kerning );
return T1_Err_Ok; return T1_Err_Ok;
} }
#endif
/******************************************************************/
/* */ #endif /* T1_CONFIG_OPTION_NO_AFM */
/* <Function> Set_Char_Sizes */
/* */
/* <Description> */ /*************************************************************************/
/* A driver method used to reset a size's character sizes */ /* */
/* (horizontal and vertical) expressed in fractional points. */ /* <Function> */
/* */ /* Set_Char_Sizes */
/* <Input> */ /* */
/* size :: handle to target size object */ /* <Description> */
/* char_width :: character width expressed in 26.6 points */ /* A driver method used to reset a size's character sizes (horizontal */
/* char_height :: character height expressed in 26.6 points */ /* and vertical) expressed in fractional points. */
/* */ /* */
/* <Return> */ /* <Input> */
/* FreeType error code. 0 means success */ /* char_width :: The character width expressed in 26.6 */
/* */ /* fractional points. */
/* */
/* char_height :: The character height expressed in 26.6 */
/* fractional points. */
/* */
/* horz_resolution :: The horizontal resolution of the output device. */
/* */
/* vert_resolution :: The vertical resolution of the output device. */
/* */
/* <InOut> */
/* size :: A handle to the target size object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
static static
FT_Error Set_Char_Sizes( T1_Size size, FT_Error Set_Char_Sizes( T1_Size size,
FT_F26Dot6 char_width, FT_F26Dot6 char_width,
FT_F26Dot6 char_height, FT_F26Dot6 char_height,
FT_UInt horz_resolution, FT_UInt horz_resolution,
FT_UInt vert_resolution ) FT_UInt vert_resolution )
{ {
UNUSED(char_width); UNUSED( char_width );
UNUSED(char_height); UNUSED( char_height );
UNUSED(horz_resolution); UNUSED( horz_resolution );
UNUSED(vert_resolution); UNUSED( vert_resolution );
size->valid = FALSE; size->valid = FALSE;
return T1_Reset_Size( size ); return T1_Reset_Size( size );
} }
/******************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> Set_Pixel_Sizes */ /* <Function> */
/* */ /* Set_Pixel_Sizes */
/* <Description> */ /* */
/* A driver method used to reset a size's character sizes */ /* <Description> */
/* (horizontal and vertical) expressed in integer pixels. */ /* A driver method used to reset a size's character sizes (horizontal */
/* */ /* and vertical) expressed in integer pixels. */
/* <Input> */ /* */
/* size :: handle to target size object */ /* <Input> */
/* */ /* pixel_width :: The character width expressed in integer pixels. */
/* pixel_width :: character width expressed in 26.6 points */ /* */
/* */ /* pixel_height :: The character height expressed in integer pixels. */
/* pixel_height :: character height expressed in 26.6 points */ /* */
/* */ /* <InOut> */
/* char_size :: the corresponding character size in points */ /* size :: A handle to the target size object. */
/* This value is only sent to the TrueType */ /* */
/* bytecode interpreter, even though 99% of */ /* <Return> */
/* glyph programs will simply ignore it. A */ /* FreeType error code. 0 means success. */
/* safe value there is the maximum of the */ /* */
/* pixel width and height (multiplied by */
/* 64 to make it a 26.6 fixed float !) */
/* <Return> */
/* FreeType error code. 0 means success */
/* */
static static
FT_Error Set_Pixel_Sizes( T1_Size size, FT_Error Set_Pixel_Sizes( T1_Size size,
FT_Int pixel_width, FT_Int pixel_width,
FT_Int pixel_height ) FT_Int pixel_height )
{ {
UNUSED(pixel_width); UNUSED( pixel_width );
UNUSED(pixel_height); UNUSED( pixel_height );
size->valid = FALSE; size->valid = FALSE;
return T1_Reset_Size(size);
return T1_Reset_Size( size );
} }
/*************************************************************************/ /*************************************************************************/
@ -174,97 +197,96 @@
face = (T1_Face)charmap->face; face = (T1_Face)charmap->face;
psnames = (PSNames_Interface*)face->psnames; psnames = (PSNames_Interface*)face->psnames;
if (psnames) if ( psnames )
switch (charmap->encoding) switch ( charmap->encoding )
{ {
/********************************************************************/ /*******************************************************************/
/* */ /* */
/* Unicode encoding support */ /* Unicode encoding support */
/* */ /* */
case ft_encoding_unicode: case ft_encoding_unicode:
{ /* use the `psnames' module to synthetize the Unicode charmap */
/* use the "psnames" module to synthetize the Unicode charmap */ result = psnames->lookup_unicode( &face->unicode_map,
result = psnames->lookup_unicode( &face->unicode_map, (FT_ULong)charcode );
(FT_ULong)charcode );
/* the function returns 0xFFFF when the Unicode charcode has */ /* the function returns 0xFFFF when the Unicode charcode has */
/* no corresponding glyph.. */ /* no corresponding glyph. */
if (result == 0xFFFF) if ( result == 0xFFFF )
result = 0; result = 0;
goto Exit; goto Exit;
}
/********************************************************************/ /*******************************************************************/
/* */ /* */
/* Custom Type 1 encoding */ /* Custom Type 1 encoding */
/* */ /* */
case ft_encoding_adobe_custom: case ft_encoding_adobe_custom:
{
T1_Encoding* encoding = &face->type1.encoding;
if ( charcode >= encoding->code_first &&
charcode <= encoding->code_last )
result = encoding->char_index[charcode];
goto Exit;
}
/*******************************************************************/
/* */
/* Adobe Standard & Expert encoding support */
/* */
default:
if ( charcode < 256 )
{
FT_UInt code;
FT_Int n;
const char* glyph_name;
code = psnames->adobe_std_encoding[charcode];
if ( charmap->encoding == ft_encoding_adobe_expert )
code = psnames->adobe_expert_encoding[charcode];
glyph_name = psnames->adobe_std_strings( code );
if ( !glyph_name )
break;
for ( n = 0; n < face->type1.num_glyphs; n++ )
{ {
T1_Encoding* encoding = &face->type1.encoding; const char* gname = face->type1.glyph_names[n];
if (charcode >= encoding->code_first &&
charcode <= encoding->code_last)
if ( gname && gname[0] == glyph_name[0] &&
strcmp( gname, glyph_name ) == 0 )
{ {
result = encoding->char_index[charcode]; result = n;
break;
} }
goto Exit;
} }
}
/********************************************************************/
/* */
/* Adobe Standard & Expert encoding support */
/* */
default:
if (charcode < 256)
{
FT_UInt code;
FT_Int n;
const char* glyph_name;
code = psnames->adobe_std_encoding[charcode];
if (charmap->encoding == ft_encoding_adobe_expert)
code = psnames->adobe_expert_encoding[charcode];
glyph_name = psnames->adobe_std_strings(code);
if (!glyph_name) break;
for ( n = 0; n < face->type1.num_glyphs; n++ )
{
const char* gname = face->type1.glyph_names[n];
if ( gname && gname[0] == glyph_name[0] &&
strcmp( gname, glyph_name ) == 0 )
{
result = n;
break;
}
}
}
} }
Exit: Exit:
return result; return result;
} }
const FT_Driver_Class t1_driver_class =
const FT_Driver_Class t1_driver_class =
{ {
{ {
ft_module_font_driver | ft_module_driver_scalable, ft_module_font_driver | ft_module_driver_scalable,
sizeof( FT_DriverRec ), sizeof( FT_DriverRec ),
"type1", /* driver name */ "type1", /* driver name */
0x10000, /* driver version 1.0 */ 0x10000L, /* driver version 1.0 */
0x20000, /* driver requires FreeType 2.0 or above */ 0x20000L, /* driver requires FreeType 2.0 or above */
0, /* module specific interface */ 0, /* module specific interface */
(FT_Module_Constructor) 0, (FT_Module_Constructor)0,
(FT_Module_Destructor) 0, (FT_Module_Destructor) 0,
#ifdef T1_CONFIG_OPTION_NO_AFM #ifdef T1_CONFIG_OPTION_NO_AFM
(FT_Module_Requester) Get_Interface (FT_Module_Requester) Get_Interface
#else #else
(FT_Module_Requester) 0 (FT_Module_Requester) 0
#endif #endif
}, },
@ -272,51 +294,31 @@
sizeof( T1_SizeRec ), sizeof( T1_SizeRec ),
sizeof( T1_GlyphSlotRec ), sizeof( T1_GlyphSlotRec ),
(FTDriver_initFace) T1_Init_Face, (FTDriver_initFace) T1_Init_Face,
(FTDriver_doneFace) T1_Done_Face, (FTDriver_doneFace) T1_Done_Face,
(FTDriver_initSize) T1_Init_Size, (FTDriver_initSize) T1_Init_Size,
(FTDriver_doneSize) T1_Done_Size, (FTDriver_doneSize) T1_Done_Size,
(FTDriver_initGlyphSlot) T1_Init_GlyphSlot, (FTDriver_initGlyphSlot)T1_Init_GlyphSlot,
(FTDriver_doneGlyphSlot) T1_Done_GlyphSlot, (FTDriver_doneGlyphSlot)T1_Done_GlyphSlot,
(FTDriver_setCharSizes) Set_Char_Sizes, (FTDriver_setCharSizes) Set_Char_Sizes,
(FTDriver_setPixelSizes) Set_Pixel_Sizes, (FTDriver_setPixelSizes)Set_Pixel_Sizes,
(FTDriver_loadGlyph) T1_Load_Glyph, (FTDriver_loadGlyph) T1_Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index, (FTDriver_getCharIndex) Get_Char_Index,
#ifdef T1_CONFIG_OPTION_NO_AFM #ifdef T1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0, (FTDriver_getKerning) 0,
(FTDriver_getAdvances) 0 (FTDriver_getAdvances) 0
#else #else
(FTDriver_getKerning) Get_Kerning, (FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) T1_Read_AFM (FTDriver_attachFile) T1_Read_AFM
#endif #endif
}; };
/******************************************************************/
/* */
/* <Function> Get_FreeType_Driver_Interface */
/* */
/* <Description> */
/* This function is used when compiling the TrueType driver */
/* as a shared library (.DLL or .so). It will be used by the */
/* high-level library of FreeType to retrieve the address of */
/* the driver's generic interface. */
/* */
/* It shouldn't be implemented in a static build, as each */
/* driver must have the same function as an exported entry */
/* point. */
/* */
/* <Return> */
/* address of TrueType's driver generic interface. The */
/* forma-specific interface can then be retrieved through */
/* the method interface->get_format_interface.. */
/* */
#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS #ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS
EXPORT_FUNC(const FT_Driver_Class*) getDriverClass( void ) EXPORT_FUNC( const FT_Driver_Class* ) getDriverClass( void )
{ {
return &t1_driver_class; return &t1_driver_class;
} }
@ -324,3 +326,4 @@
#endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */ #endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */
/* END */

View File

@ -1,26 +1,30 @@
/******************************************************************* /***************************************************************************/
* /* */
* t1driver.h /* t1driver.h */
* /* */
* High-level Type1 driver interface for FreeType 2.0 /* High-level Type 1 driver interface (specification). */
* /* */
* Copyright 1996-1998 by /* Copyright 1996-2000 by */
* David Turner, Robert Wilhelm, and Werner Lemberg. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
* /* */
* This file is part of the FreeType project, and may only be used, /* This file is part of the FreeType project, and may only be used, */
* modified, and distributed under the terms of the FreeType project /* modified, and distributed under the terms of the FreeType project */
* license, LICENSE.TXT. By continuing to use, modify, or distribute /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
* this file you indicate that you have read the license and /* this file you indicate that you have read the license and */
* understand and accept it fully. /* understand and accept it fully. */
* /* */
******************************************************************/ /***************************************************************************/
#ifndef T1DRIVER_H #ifndef T1DRIVER_H
#define T1DRIVER_H #define T1DRIVER_H
#include <freetype/internal/ftdriver.h> #include <freetype/internal/ftdriver.h>
FT_EXPORT_VAR(const FT_Driver_Class) t1_driver_class; FT_EXPORT_VAR( const FT_Driver_Class ) t1_driver_class;
#endif /* T1DRIVER_H */ #endif /* T1DRIVER_H */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,20 @@
/******************************************************************* /***************************************************************************/
* /* */
* t1gload.h 1.0 /* t1gload.h */
* /* */
* Type1 Glyph Loader. /* Type 1 Glyph Loader (specification). */
* /* */
* Copyright 1996-1998 by /* Copyright 1996-2000 by */
* David Turner, Robert Wilhelm, and Werner Lemberg. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
* /* */
* This file is part of the FreeType project, and may only be used /* This file is part of the FreeType project, and may only be used, */
* modified and distributed under the terms of the FreeType project /* modified, and distributed under the terms of the FreeType project */
* license, LICENSE.TXT. By continuing to use, modify, or distribute /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
* this file you indicate that you have read the license and /* this file you indicate that you have read the license and */
* understand and accept it fully. /* understand and accept it fully. */
* /* */
* /***************************************************************************/
* The Type 1 glyph loader uses three distinct objects to build
* scaled and hinted outlines from a charstrings program. These are :
*
* - a glyph builder, T1_Builder, used to store the built outline
*
* - a glyph hinter, T1_Hinter, used to record and apply the stem
* hints
*
* - a charstrings interpreter, T1_Decoder, used to parse the
* Type 1 charstrings stream, manage a stack and call the builder
* and/or hinter depending on the opcodes.
*
* Ideally, a Type 2 glyph loader would only need to have its own
* T2_Decoder object (assuming the hinter is able to manage all
* kinds of hints).
*
******************************************************************/
#ifndef T1GLOAD_H #ifndef T1GLOAD_H
#define T1GLOAD_H #define T1GLOAD_H
@ -42,25 +26,15 @@
#endif #endif
/*************************************************************************/
/* */
/* <Structure> T1_Builder_Funcs */
/* */
/* <Description> */
/* a structure used to store the address of various functions */
/* used by a glyph builder to implement the outline's "path */
/* construction". */
/* */
/* */
typedef struct T1_Builder_ T1_Builder; typedef struct T1_Builder_ T1_Builder;
typedef FT_Error (*T1_Builder_EndChar)( T1_Builder* loader ); typedef FT_Error (*T1_Builder_EndChar)( T1_Builder* loader );
typedef FT_Error (*T1_Builder_Sbw) ( T1_Builder* loader, typedef FT_Error (*T1_Builder_Sbw)( T1_Builder* loader,
FT_Pos sbx, FT_Pos sbx,
FT_Pos sby, FT_Pos sby,
FT_Pos wx, FT_Pos wx,
FT_Pos wy ); FT_Pos wy );
typedef FT_Error (*T1_Builder_ClosePath)( T1_Builder* loader ); typedef FT_Error (*T1_Builder_ClosePath)( T1_Builder* loader );
@ -80,7 +54,17 @@
FT_Pos dx3, FT_Pos dx3,
FT_Pos dy3 ); FT_Pos dy3 );
typedef struct T1_Builder_Funcs_
/*************************************************************************/
/* */
/* <Structure> */
/* T1_Builder_Funcs */
/* */
/* <Description> */
/* A structure to store the address of various functions used by a */
/* glyph builder to implement the outline's `path construction'. */
/* */
typedef struct T1_Builder_Funcs_
{ {
T1_Builder_EndChar end_char; T1_Builder_EndChar end_char;
T1_Builder_Sbw set_bearing_point; T1_Builder_Sbw set_bearing_point;
@ -93,50 +77,60 @@
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Structure> T1_Builder */ /* <Structure> */
/* */ /* T1_Builder */
/* <Description> */ /* */
/* a structure used during glyph loading to store its outline. */ /* <Description> */
/* */ /* A structure used during glyph loading to store its outline. */
/* <Fields> */ /* */
/* system :: current system object */ /* <Fields> */
/* face :: current face object */ /* memory :: The current memory object. */
/* size :: current size object */ /* */
/* glyph :: current glyph slot */ /* face :: The current face object. */
/* */ /* */
/* current :: current glyph outline */ /* size :: The current size object. */
/* base :: base glyph outline */ /* */
/* */ /* glyph :: The current glyph slot. */
/* max_points :: maximum points in builder outline */ /* */
/* max_contours :: maximum contours in builder outline */ /* loader :: The current glyph loader. */
/* */ /* */
/* last :: last point position */ /* current :: The current glyph outline. */
/* */ /* */
/* scale_x :: horizontal scale ( FUnits to sub-pixels ) */ /* base :: The base glyph outline. */
/* scale_y :: vertical scale ( FUnits to sub-pixels ) */ /* */
/* pos_x :: horizontal translation (composite glyphs) */ /* last :: The last point position. */
/* pos_y :: vertical translation (composite glyph) */ /* */
/* */ /* scale_x :: The horizontal scale (FUnits to sub-pixels). */
/* left_bearing :: left side bearing point */ /* */
/* advance :: horizontal advance vector */ /* scale_y :: The vertical scale (FUnits to sub-pixels). */
/* */ /* */
/* path_begun :: flag, indicates that a new path has begun */ /* pos_x :: The horizontal translation (for composite glyphs). */
/* load_points :: flag, if not set, no points are loaded */ /* */
/* */ /* pos_y :: The vertical translation (for composite glyphs). */
/* pass :: pass number for multi-pass hinters */ /* */
/* */ /* left_bearing :: The left side bearing point. */
/* funcs :: table of builder functions used to perform */ /* */
/* the outline's path construction */ /* advance :: The horizontal advance vector. */
/* */ /* */
/* hint_point :: index of next point to hint.. */ /* no_recurse :: */
/* */ /* */
/* */ /* bbox :: The glyph's bounding box. */
/* */ /* */
/* */ /* path_begun :: A flag which indicates that a new path has begun. */
/* */
struct T1_Builder_ /* load_points :: A flag which indicates, if not set, that no points */
/* are loaded. */
/* */
/* pass :: The pass number for multi-pass hinters. */
/* */
/* hint_point :: The index of the next point to hint. */
/* */
/* funcs :: A table of builder functions used to perform the */
/* outline's path construction. */
/* */
struct T1_Builder_
{ {
FT_Memory memory; FT_Memory memory;
T1_Face face; T1_Face face;
@ -171,15 +165,6 @@
}; };
/*************************************************************************/
/* */
/* <Structure> T1_Hinter_Funcs */
/* */
/* <Description> */
/* a structure used to store the address of various functions */
/* used by a Type 1 hinter to perform outline hinting. */
/* */
typedef FT_Error (*T1_Hinter_ChangeHints)( T1_Builder* builder ); typedef FT_Error (*T1_Hinter_ChangeHints)( T1_Builder* builder );
typedef FT_Error (*T1_Hinter_DotSection)( T1_Builder* builder ); typedef FT_Error (*T1_Hinter_DotSection)( T1_Builder* builder );
@ -189,7 +174,6 @@
FT_Pos width, FT_Pos width,
FT_Bool vertical ); FT_Bool vertical );
typedef FT_Error (*T1_Hinter_Stem3)( T1_Builder* builder, typedef FT_Error (*T1_Hinter_Stem3)( T1_Builder* builder,
FT_Pos pos0, FT_Pos pos0,
FT_Pos width0, FT_Pos width0,
@ -199,18 +183,28 @@
FT_Pos width2, FT_Pos width2,
FT_Bool vertical ); FT_Bool vertical );
typedef struct T1_Hinter_Func_
/*************************************************************************/
/* */
/* <Structure> */
/* T1_Hinter_Funcs */
/* */
/* <Description> */
/* A structure to store the address of various functions used by a */
/* Type 1 hinter to perform outline hinting. */
/* */
typedef struct T1_Hinter_Func_
{ {
T1_Hinter_ChangeHints change_hints; T1_Hinter_ChangeHints change_hints;
T1_Hinter_DotSection dot_section; T1_Hinter_DotSection dot_section;
T1_Hinter_Stem stem; T1_Hinter_Stem stem;
T1_Hinter_Stem3 stem3; T1_Hinter_Stem3 stem3;
} T1_Hinter_Funcs; } T1_Hinter_Funcs;
typedef enum T1_Operator_ typedef enum T1_Operator_
{ {
op_none = 0, op_none = 0,
op_endchar, op_endchar,
@ -244,10 +238,8 @@
} T1_Operator; } T1_Operator;
/* execution context charstring zone */ /* execution context charstring zone */
typedef struct T1_Decoder_Zone_ typedef struct T1_Decoder_Zone_
{ {
FT_Byte* base; FT_Byte* base;
FT_Byte* limit; FT_Byte* limit;
@ -256,171 +248,58 @@
} T1_Decoder_Zone; } T1_Decoder_Zone;
typedef struct T1_Decoder_ typedef struct T1_Decoder_
{ {
T1_Builder builder; T1_Builder builder;
T1_Hinter_Funcs hinter; T1_Hinter_Funcs hinter;
FT_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; FT_Int stack[T1_MAX_CHARSTRINGS_OPERANDS];
FT_Int* top; FT_Int* top;
T1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ]; T1_Decoder_Zone zones[T1_MAX_SUBRS_CALLS + 1];
T1_Decoder_Zone* zone; T1_Decoder_Zone* zone;
FT_Int flex_state; FT_Int flex_state;
FT_Int num_flex_vectors; FT_Int num_flex_vectors;
FT_Vector flex_vectors[7]; FT_Vector flex_vectors[7];
} T1_Decoder; } T1_Decoder;
/*********************************************************************
*
* <Function>
* T1_Init_Builder
*
* <Description>
* Initialise a given glyph builder.
*
* <Input>
* builder :: glyph builder to initialise
* face :: current face object
* size :: current size object
* glyph :: current glyph object
* funcs :: glyph builder functions (or "methods").
*
* <Note>
* This function is exported for now because it is used by the
* "t1dump" utility. Later, it will be accessed through a
* format-specific extension
*
*********************************************************************/
LOCAL_DEF LOCAL_DEF
void T1_Init_Builder( T1_Builder* builder, void T1_Init_Builder( T1_Builder* builder,
T1_Face face, T1_Face face,
T1_Size size, T1_Size size,
T1_GlyphSlot glyph, T1_GlyphSlot glyph,
const T1_Builder_Funcs* funcs ); const T1_Builder_Funcs* funcs );
/*********************************************************************
*
* <Function>
* T1_Done_Builder
*
* <Description>
* Finalise a given glyph builder. Its content can still be
* used after the call, but the function saves important information
* within the corresponding glyph slot.
*
* <Input>
* builder :: glyph builder to initialise
*
* <Note>
* This function is exported for now because it is used by the
* "t1dump" utility. Later, it will be accessed through a
* format-specific extension
*
*********************************************************************/
LOCAL_DEF LOCAL_DEF
void T1_Done_Builder( T1_Builder* builder ); void T1_Done_Builder( T1_Builder* builder );
/*********************************************************************
*
* <Function>
* T1_Init_Decoder
*
* <Description>
* Initialise a given Type 1 decoder for parsing
*
* <Input>
* decoder :: Type 1 decoder to initialise
* funcs :: hinter functions interface
*
* <Note>
* This function is exported for now because it is used by the
* "t1dump" utility. Later, it will be accessed through a
* format-specific extension
*
*********************************************************************/
LOCAL_DEF LOCAL_DEF
void T1_Init_Decoder( T1_Decoder* decoder, void T1_Init_Decoder( T1_Decoder* decoder,
const T1_Hinter_Funcs* funcs ); const T1_Hinter_Funcs* funcs );
/* Compute the maximum advance width of a font through quick parsing */
LOCAL_DEF LOCAL_DEF
FT_Error T1_Compute_Max_Advance( T1_Face face, FT_Error T1_Compute_Max_Advance( T1_Face face,
FT_Int *max_advance ); FT_Int* max_advance );
/* This function is exported, because it is used by the T1Dump utility */
LOCAL_DEF LOCAL_DEF
FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, FT_Error T1_Parse_CharStrings( T1_Decoder* decoder,
FT_Byte* charstring_base, FT_Byte* charstring_base,
FT_Int charstring_len, FT_Int charstring_len,
FT_Int num_subrs, FT_Int num_subrs,
FT_Byte** subrs_base, FT_Byte** subrs_base,
FT_Int* subrs_len ); FT_Int* subrs_len );
/*************************************************************************/
/* */
/* <Function> T1_Add_Points */
/* */
/* <Description> */
/* Checks that there is enough room in the current load glyph outline */
/* to accept "num_points" additional outline points. If not, this */
/* function grows the load outline's arrays accordingly.. */
/* */
/* <Input> */
/* builder :: pointer to glyph builder object */
/* num_points :: number of points that will be added later */
/* */
/* <Return> */
/* Type1 error code. 0 means success */
/* */
/* <Note> */
/* This function does NOT update the points count in the glyph loader */
/* This must be done by the caller itself, after this function is */
/* invoked.. */
/* */
LOCAL_DEF LOCAL_DEF
FT_Error T1_Add_Points( T1_Builder* builder, FT_Error T1_Add_Points( T1_Builder* builder,
FT_Int num_points ); FT_Int num_points );
/*************************************************************************/
/* */
/* <Function> T1_Add_Contours */
/* */
/* <Description> */
/* Checks that there is enough room in the current load glyph outline */
/* to accept "num_contours" additional contours. If not, this func */
/* the load outline's arrays accordingly.. */
/* */
/* <Input> */
/* builder :: pointer to glyph builder object */
/* num_contours :: number of contours that will be added later */
/* */
/* <Return> */
/* Type1 error code. 0 means success */
/* */
/* <Note> */
/* This function does NOT update the contours count in the load glyph */
/* This must be done by the caller itself, after this function is */
/* invoked.. */
/* */
LOCAL_DEF LOCAL_DEF
FT_Error T1_Add_Contours( T1_Builder* builder, FT_Error T1_Add_Contours( T1_Builder* builder,
FT_Int num_contours ); FT_Int num_contours );
LOCAL_DEF LOCAL_DEF
FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, FT_Error T1_Load_Glyph( T1_GlyphSlot glyph,
T1_Size size, T1_Size size,
@ -432,4 +311,8 @@
} }
#endif #endif
#endif /* T1GLOAD_H */ #endif /* T1GLOAD_H */
/* END */

File diff suppressed because it is too large Load Diff