From e35cac66c652480b0d682647e92c2e7ef5cf7081 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 11 Jun 2000 03:46:57 +0000 Subject: [PATCH] A complete revision of FreeType 2's GNU makefiles (of the library): Tons of unnecessary stuff have been removed; only the essential rules have been retained. The source files now depend on all header files in include/freetype, include/freetype/config, and include/freetype/internal. This is not optimal, I know, and I'll try to improve this, but it is better than before (namely no dependencies on `internal'). FTDEBUG_SRC has been added (similar to FTSYS_SRC) -- I don't know exactly whether this is really useful, but it doesn't harm. There is now more documentation in the makefiles itself. io-frames.html: Use of , , and for better tagging. Reactivating of FT_DEBUG_LEVEL_xxx macros. Added a lot of #include directives to make `multi' builds possible -- note that currently the modules cid, t1, and t1z have clashing structures and functions which means that you can only use one of these three modules for a multi build. Added some missing function declarations to (local) header files. Renamed some T1_Open_Face() to CID_Open_Face() in the cid module -- a lot of other functions should be renamed also... Replaced many FT_xxx stuff with T1_xxx in t1z driver -- this isn't finished yet... Fixed FT_Free() to allow a NULL pointer without an assertion (this has always been a valid assumption in FreeType, at least in FT 1.x). A lot of other, minor fixes (mostly documentation). --- Makefile | 4 +- config/ansi/ansi.mk | 6 +- config/detect.mk | 16 +-- config/dos/detect.mk | 11 +- config/dos/dos-gcc.mk | 2 +- config/freetype.mk | 127 +++++++++++++++-------- config/modules.mk | 9 +- config/os2/detect.mk | 9 +- config/os2/os2-dev.mk | 161 +++++++++++++---------------- config/os2/os2-gcc.mk | 158 ++++++++++++---------------- config/unix/detect.mk | 10 +- config/unix/unix-dev.mk | 147 +++++++++++++------------- config/unix/unix-gcc.mk | 8 +- config/unix/unix.mk | 144 +++++++++++++------------- config/win32/detect.mk | 12 ++- config/win32/w32-dev.mk | 154 ++++++++++++++------------- config/win32/w32-gcc.mk | 151 +++++++++++++-------------- config/win32/w32-lcc.mk | 140 ++++++++++++------------- config/win32/w32-vcc.mk | 141 +++++++++++++------------ docs/design/io-frames.html | 110 ++++++++++---------- include/freetype/config/ftoption.h | 4 +- include/freetype/internal/sfnt.h | 1 + src/base/ftextend.c | 1 + src/base/ftobjs.c | 4 +- src/base/rules.mk | 61 +++++------ src/cff/rules.mk | 64 +++--------- src/cff/t2gload.c | 1 + src/cff/t2load.c | 2 +- src/cff/t2load.h | 8 ++ src/cid/cidgload.c | 2 + src/cid/cidload.c | 2 +- src/cid/cidload.h | 2 +- src/cid/cidobjs.c | 2 +- src/cid/rules.mk | 67 +++++------- src/psnames/rules.mk | 97 ++++++++--------- src/sfnt/rules.mk | 110 +++++++++----------- src/sfnt/sfobjs.c | 1 + src/sfnt/ttcmap.c | 19 ++-- src/truetype/rules.mk | 68 +++--------- src/type1z/t1afm.c | 4 +- src/type1z/t1afm.h | 25 +++-- src/type1z/t1driver.c | 3 +- src/type1z/t1load.c | 62 +++++------ src/type1z/t1load.h | 26 +++-- src/type1z/t1objs.c | 2 +- src/type1z/t1parse.c | 12 +-- src/type1z/t1parse.h | 6 ++ 47 files changed, 1027 insertions(+), 1149 deletions(-) diff --git a/Makefile b/Makefile index f5aa8a6bf..118d37049 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # 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 +# 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 @@ -91,7 +91,7 @@ else # A configuration sub-Makefile is present -- simply run it. # - all: build_freetype + all: single modules: make_module_list diff --git a/config/ansi/ansi.mk b/config/ansi/ansi.mk index 8e7bf38d3..c0cfcaf43 100644 --- a/config/ansi/ansi.mk +++ b/config/ansi/ansi.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -36,7 +36,7 @@ PLATFORM := ansi OBJ_DIR := obj -# The directory where all library files are placed +# The directory where all library files are placed. # # By default, this is the same as $(OBJ_DIR), however, this can be changed # to suit particular needs. @@ -121,7 +121,7 @@ ifdef BUILD_FREETYPE # It is part of the system-specific sub-Makefile because not all # librarians accept a simple syntax like: # - # librarian library_file {list of object files} + # librarian library_file {list of object files} # $(FT_LIBRARY): $(OBJECTS_LIST) -$(DELETE) $@ diff --git a/config/detect.mk b/config/detect.mk index 74914e4eb..355fcb300 100644 --- a/config/detect.mk +++ b/config/detect.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -40,17 +40,17 @@ # If TOP is not defined, default it to `.' # ifndef TOP -TOP := . + TOP := . endif -# Set auto-detection default to `ansi'. +# Set auto-detection default to `ansi' resp. UNIX-like operating systems. # Note that we delay the evaluation of $(BUILD_CONFIG_), $(BUILD), and # $(CONFIG_RULES). # -PLATFORM := ansi -DELETE := $(RM) -COPY := cp -SEP := / +PLATFORM := ansi +DELETE := $(RM) +COPY := cp +SEP := / BUILD_CONFIG_ = $(TOP)$(SEP)config$(SEP) BUILD = $(BUILD_CONFIG_)$(PLATFORM) @@ -84,7 +84,7 @@ ifndef CONFIG_FILE endif # The following targets are equivalent, with the exception that they use -# slightly different syntaxes for the `echo' command. +# a slightly different syntax for the `echo' command. # # std_setup: defined for most (i.e. Unix-like) platforms # dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2 diff --git a/config/dos/detect.mk b/config/dos/detect.mk index e491e9e68..f8c17069f 100644 --- a/config/dos/detect.mk +++ b/config/dos/detect.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -25,8 +25,7 @@ ifeq ($(PLATFORM),ansi) is_dos := $(findstring Dos,$(shell ver)) # We try to recognize a Dos session under OS/2. The `ver' command - # returns `Operating System/2 ...' there, so `is_dos' should be empty - # there. + # returns `Operating System/2 ...' there, so `is_dos' should be empty. # # To recognize a Dos session under OS/2, we check COMSPEC for the # substring `MDOS\COMMAND' @@ -49,6 +48,8 @@ ifeq ($(PLATFORM),ansi) CC := gcc endif + # additionally, we provide hooks for various other compilers + # ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C CONFIG_FILE := dos-tcc.mk SEP := $(BACKSLASH) @@ -63,14 +64,14 @@ ifeq ($(PLATFORM),ansi) .PHONY: watcom endif - ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16 bits + ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit CONFIG_FILE := dos-bcc.mk SEP := $(BACKSLASH) CC := bcc .PHONY: borlandc16 endif - ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32 bits + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit CONFIG_FILE := dos-bcc.mk SEP := $(BACKSLASH) CC := bcc32 diff --git a/config/dos/dos-gcc.mk b/config/dos/dos-gcc.mk index c7b4ce13d..79bd1823b 100644 --- a/config/dos/dos-gcc.mk +++ b/config/dos/dos-gcc.mk @@ -6,7 +6,7 @@ # 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 +# 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 diff --git a/config/freetype.mk b/config/freetype.mk index 72d96be95..dc3043a06 100644 --- a/config/freetype.mk +++ b/config/freetype.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -17,27 +17,72 @@ # OTHER MAKEFILES. -# The targets `objects' and `library' are defined at the end of this -# Makefile when all rules have been included. +# The following variables (set by other Makefile components, in the +# environment, or on the command line) are used: # -.PHONY: build_freetype objects library +# BUILD The architecture dependent directory, +# e.g. `$(TOP)/config/unix'. +# +# OBJ_DIR The directory in which object files are created. +# +# LIB_DIR The directory in which the library is created. +# +# INCLUDES A list of directories to be included additionally. +# Usually empty. +# +# CFLAGS Compilation flags. This overrides the default settings +# in the platform-specific configuration files. +# +# FTSYS_SRC If set, its value is used as the name of a replacement +# file for `src/base/ftsystem.c'. +# +# FTDEBUG_SRC If set, its value is used as the name of a replacement +# file for `src/base/ftdebug.c'. [For a normal build, this +# file does nothing.] +# +# FT_MODULE_LIST The file which contains the list of modules for the +# current build. Usually, this is automatically created by +# `modules.mk'. +# +# BASE_OBJ_S +# BASE_OBJ_M A list of base objects (for single object and multiple +# object builds, respectively). Set up in +# `src/base/rules.mk'. +# +# BASE_EXT_OBJ A list of base extension objects. Set up in +# `src/base/rules.mk'. +# +# DRV_OBJ_S +# DRV_OBJ_M A list of driver objects (for single object and multiple +# object builds, respectively). Set up cumulatively in +# `src//rules.mk'. +# +# TOP, SEP, +# LIBRARY, CC, +# A, I, O, T Check `config.mk' for details. -# default target -- build objects and library + +# The targets `objects' and `library' are defined at the end of this +# Makefile after all other rules have been included. # -build_freetype: objects library +.PHONY: single objects library + +# default target -- build single objects and library +# +single: objects library # `multi' target -- build multiple objects and library # multi: objects library -# The FreeType source directory. +# The FreeType source directory, usually `./src'. # SRC := $(TOP)$(SEP)src -# The directory where the base layer components are placed. By default, -# this is `freetype/src/base'. +# The directory where the base layer components are placed, usually +# `./src/base'. # BASE_DIR := $(SRC)$(SEP)base @@ -45,7 +90,7 @@ BASE_DIR := $(SRC)$(SEP)base # A few short-cuts in order to avoid typing $(SEP) all the time for the # directory separator. # -# For example: SRC_ equals to `./src/' where `.' is $(TOP). +# For example: $(SRC_) equals to `./src/' where `.' is $(TOP). # # SRC_ := $(SRC)$(SEP) @@ -57,7 +102,7 @@ INTERNAL_ := $(PUBLIC_)internal$(SEP) CONFIG_ := $(PUBLIC_)config$(SEP) -# The name of the final library file. +# The final name of the library file. # FT_LIBRARY := $(LIB_)$(LIBRARY).$A @@ -76,7 +121,7 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%) # C flags used for the compilation of an object file. This must include at -# least the paths for the `base' and `config/' directories, +# least the paths for the `base' and `config/' directories; # debug/optimization/warning flags + ansi compliance if needed. # FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS) @@ -84,72 +129,71 @@ FT_CC = $(CC) $(FT_CFLAGS) FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS) -# include the `modules' rules file +# Include the `modules' rules file. # include $(TOP)/config/modules.mk -# Free the lists of driver objects. +# Initialize the list of objects. # -COMPONENTS_LIST := -DRIVERS_LIST := -OBJECTS_LIST := +OBJECTS_LIST := + # Define $(PUBLIC_H) as the list of all public header files located in -# `$(TOP)/include'. +# `$(TOP)/include/freetype'. $(BASE_H) and $(CONFIG_H) are defined +# similarly. # -PUBLIC_H := $(wildcard $(PUBLIC_)*.h) -BASE_H := $(wildcard $(INTERNAL_)*.h) +# This is used to simplify the dependency rules -- if one of these files +# changes, the whole library is recompiled. +# +PUBLIC_H := $(wildcard $(PUBLIC_)*.h) +BASE_H := $(wildcard $(INTERNAL_)*.h) +CONFIG_H := $(wildcard $(CONFIG_)*.h) -# System-specific component -- this must be defined in this Makefile for -# easy updates. The default ANSI ftsystem.c is located in -# `freetype/config/ftsystem.c'. However, some system-specific configuration -# might define $(FTSYS_SRC) to fetch it in other places, like -# `freetype/config//ftsystem.c'. -# -# $(BASE_H) is defined in `src/base/rules.mk' and contains the list of all -# base layer header files. +FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H) + + +# ftsystem component # ifndef FTSYS_SRC FTSYS_SRC = $(BASE_)ftsystem.c endif + FTSYS_OBJ = $(OBJ_)ftsystem.$O OBJECTS_LIST += $(FTSYS_OBJ) -$(FTSYS_OBJ): $(FTSYS_SRC) $(BASE_H) +$(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H) $(FT_COMPILE) $T$@ $< # ftdebug component # -# FTDebug contains code used to print traces and errors. It is normally -# empty for a release build (see ftoption.h). -# -FTDEBUG_SRC = $(BASE_)ftdebug.c +ifndef FTDEBUG_SRC + FTDEBUG_SRC = $(BASE_)ftdebug.c +endif + FTDEBUG_OBJ = $(OBJ_)ftdebug.$O OBJECTS_LIST += $(FTDEBUG_OBJ) -$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(BASE_H) +$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H) $(FT_COMPILE) $T$@ $< - - # Include all rule files from FreeType components. # include $(wildcard $(SRC)/*/rules.mk) -# FTInit file +# ftinit component # # The C source `ftinit.c' contains the FreeType initialization routines. # It is able to automatically register one or more drivers when the API # function FT_Init_FreeType() is called. # # The set of initial drivers is determined by the driver Makefiles -# includes above. Each driver Makefile updates the FTINIT_xxxx lists +# includes above. Each driver Makefile updates the FTINIT_xxx lists # which contain additional include paths and macros used to compile the # single `ftinit.c' source. # @@ -158,7 +202,7 @@ FTINIT_OBJ := $(OBJ_)ftinit.$O OBJECTS_LIST += $(FTINIT_OBJ) -$(FTINIT_OBJ): $(FTINIT_SRC) $(PUBLIC_H) $(FT_MODULE_LIST) +$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) $(FT_MODULE_LIST) $(FT_COMPILE) $T$@ $< @@ -221,11 +265,10 @@ remove_config_mk: # The `config.mk' file must define `clean_freetype' and # `distclean_freetype'. Implementations may use to relay these to either -# the `std' or `dos' versions, or simply provide their own implementation. +# the `std' or `dos' versions from above, or simply provide their own +# implementation. # clean: clean_freetype distclean: distclean_freetype remove_config_mk # EOF - - diff --git a/config/modules.mk b/config/modules.mk index f6743572d..97f691de4 100644 --- a/config/modules.mk +++ b/config/modules.mk @@ -5,7 +5,7 @@ # 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 +# 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 @@ -17,12 +17,12 @@ # This file is in charge of handling the generation of the modules list -# file, normally located in `config/ftmodule.h'. +# file. .PHONY: make_module_list clean_module_list remake_module_list # MODULE_LIST, as its name suggests, indicates where the modules list -# resides. For now, it is in `config/ftmodule.h'. +# resides. For now, it is in `include/freetype/config/ftmodule.h'. # ifndef FT_MODULE_LIST FT_MODULE_LIST := $(TOP)$(SEP)include$(SEP)freetype$(SEP)config$(SEP)ftmodule.h @@ -30,6 +30,9 @@ endif # To build the modules list, we invoke the `make_module_list' target. # +# This rule is commented out by default since FreeType comes already with +# a ftmodule.h file. +# #$(FT_MODULE_LIST): make_module_list # Before the modules list file can be generated, we must remove the file in diff --git a/config/os2/detect.mk b/config/os2/detect.mk index 24d8ec880..ed0f12493 100644 --- a/config/os2/detect.mk +++ b/config/os2/detect.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -14,6 +14,7 @@ ifeq ($(PLATFORM),ansi) + ifdef OS2_SHELL PLATFORM := os2 @@ -23,6 +24,8 @@ ifeq ($(PLATFORM),ansi) CONFIG_FILE := os2-gcc.mk # gcc-emx by default SEP := / + # additionally, we provide hooks for various other compilers + # ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ CONFIG_FILE := os2-icc.mk SEP := $(BACKSLASH) @@ -37,14 +40,14 @@ ifeq ($(PLATFORM),ansi) .PHONY: watcom endif - ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32 bits + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit CONFIG_FILE := os2-bcc.mk SEP := $(BACKSLASH) CC := bcc32 .PHONY: borlandc endif - ifneq ($(findstring devel,$(MAKECMDGOALS)),) + ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target CONFIG_FILE := os2-dev.mk CC := gcc SEP := / diff --git a/config/os2/os2-dev.mk b/config/os2/os2-dev.mk index 2abb3d763..7cab22b1c 100644 --- a/config/os2/os2-dev.mk +++ b/config/os2/os2-dev.mk @@ -1,24 +1,22 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for OS/2 + gcc -#* THIS VERSION TURNS OFF OPTIMIZATIONS FOR DEBUGGING !! -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 configuration rules for OS/2 + gcc +# +# Development version without optimizations. +# + + +# 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 TOP -TOP := . + TOP := . endif DELETE := del @@ -28,129 +26,110 @@ BUILD := $(TOP)/config/os2 PLATFORM := os2 CC := gcc -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g -O0 -Wall + CFLAGS := -c -g -O0 -Wall endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# Librarian to use to build the static library -# -FT_LIBRARIAN := $(AR) -r - - -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ - $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) - - -# Cleaning rules -# -DIR_OBJ := $(subst $(SEP),\,$(OBJ_DIR)) - -clean_freetype_objects: - -del $(DIR_OBJ)\*.$O - -clean_freetype_lib: - -del $(subst $(SEP),\,$(FT_LIBRARY)) - -clean: clean_freetype_objects + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $@ + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif - +# EOF diff --git a/config/os2/os2-gcc.mk b/config/os2/os2-gcc.mk index 5ce1ce2ee..e94728b1c 100644 --- a/config/os2/os2-gcc.mk +++ b/config/os2/os2-gcc.mk @@ -1,23 +1,20 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for OS/2 + gcc -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 configuration rules for OS/2 + gcc +# + + +# 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 TOP -TOP := . + TOP := . endif DELETE := del @@ -27,129 +24,110 @@ BUILD := $(TOP)/config/os2 PLATFORM := os2 CC := gcc -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g -O6 -Wall + CFLAGS := -c -g -O6 -Wall endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# Librarian to use to build the static library -# -FT_LIBRARIAN := $(AR) -r - - -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ - $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) - - -# Cleaning rules -# -DIR_OBJ := $(subst $(SEP),\,$(OBJ_DIR)) - -clean_freetype_objects: - -del $(DIR_OBJ)\*.$O - -clean_freetype_lib: - -del $(subst $(SEP),\,$(FT_LIBRARY)) - -clean: clean_freetype_objects + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif - +# EOF diff --git a/config/unix/detect.mk b/config/unix/detect.mk index 28a5f346a..df3fc3dc7 100644 --- a/config/unix/detect.mk +++ b/config/unix/detect.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -19,10 +19,6 @@ ifeq ($(PLATFORM),ansi) -# Some Unix systems like *BSD do not have a /etc/inittab so we commented -# the line.. (thanks to Yamano-uchi, Hidetoshi for pointing this out).. -# -# has_inittab := $(strip $(wildcard /etc/inittab)) has_init := $(strip $(wildcard /sbin/init)) ifneq ($(has_init),) @@ -30,14 +26,14 @@ ifeq ($(PLATFORM),ansi) COPY := cp DELETE := rm -f - # Test whether we're using gcc. If so, we select the `unix-gcc.mk' + # Test whether we are using gcc. If so, we select the `unix-gcc.mk' # configuration file. Otherwise, the standard `unix.mk' is used which # simply calls `cc -c' with no extra arguments. # # Feel free to add support for other platform specific compilers in this # directory (e.g. solaris.mk + changes here to detect the platform). # - ifeq ($(CC),gcc) + ifeq ($(firstword $(CC)),gcc) is_gcc := 1 else ifneq ($(findstring gcc,$(shell $(CC) -v 2>&1)),) diff --git a/config/unix/unix-dev.mk b/config/unix/unix-dev.mk index ec91e1261..591ad2675 100644 --- a/config/unix/unix-dev.mk +++ b/config/unix/unix-dev.mk @@ -1,24 +1,22 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for a standard Unix + GCC -#* NOTE: THIS VERSION TURNS OFF ALL OPTIMIZATIONS FOR DEBUGGING !! -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 configuration rules for the gcc compiler under UNIX +# +# Development version without optimizations. +# + + +# 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 TOP -TOP := . + TOP := . endif DELETE := rm -f @@ -27,105 +25,110 @@ HOSTSEP := $(SEP) BUILD := $(TOP)/config/unix PLATFORM := unix -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f $TOP/Makefile setup [options] +# make -f $TOP/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g -O0 -Wall + CFLAGS := -c -g -O0 -Wall endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_std -distclean_freetype: distclean_freetype_std + # The cleanup targets. + # + clean_freetype: clean_freetype_std + distclean_freetype: distclean_freetype_std -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ - $(AR) -r $@ $(OBJECTS_LIST) + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r + + + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like: + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $@ + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif + +# EOF diff --git a/config/unix/unix-gcc.mk b/config/unix/unix-gcc.mk index eee2eb1c9..f14b6979a 100644 --- a/config/unix/unix-gcc.mk +++ b/config/unix/unix-gcc.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -36,7 +36,7 @@ PLATFORM := unix OBJ_DIR := obj -# The directory where all library files are placed +# The directory where all library files are placed. # # By default, this is the same as $(OBJ_DIR), however, this can be changed # to suit particular needs. @@ -117,11 +117,11 @@ ifdef BUILD_FREETYPE FT_LIBRARIAN := $(AR) -r - # This final rule is used to link all object files into a single library. + # This final rule is used to link all object files into a single library. # It is part of the system-specific sub-Makefile because not all # librarians accept a simple syntax like: # - # librarian library_file {list of object files} + # librarian library_file {list of object files} # $(FT_LIBRARY): $(OBJECTS_LIST) -$(DELETE) $@ diff --git a/config/unix/unix.mk b/config/unix/unix.mk index 1d80e06ee..c85653dc3 100644 --- a/config/unix/unix.mk +++ b/config/unix/unix.mk @@ -1,23 +1,20 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for a standard Unix compiler -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 configuration rules for a standard Unix compiler +# + + +# 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 TOP -TOP := . + TOP := . endif DELETE := rm -f @@ -26,105 +23,110 @@ HOSTSEP := $(SEP) BUILD := $(TOP)/config/unix PLATFORM := unix -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f $TOP/Makefile setup [options] +# make -f $TOP/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c + CFLAGS := -c endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_std -distclean_freetype: distclean_freetype_std + # The cleanup targets. + # + clean_freetype: clean_freetype_std + distclean_freetype: distclean_freetype_std -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ - $(AR) -r $@ $(OBJECTS_LIST) + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r + + + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like: + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $@ + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif + +# EOF diff --git a/config/win32/detect.mk b/config/win32/detect.mk index cd777fbdc..c2bf8cced 100644 --- a/config/win32/detect.mk +++ b/config/win32/detect.mk @@ -6,7 +6,7 @@ # 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 +# 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 @@ -25,13 +25,13 @@ ifeq ($(PLATFORM),ansi) # We test for the COMSPEC environment variable, then run the `ver' # command-line program to see if its output contains the word `Windows'. # - # If this is true, we're running a win32 platform (or an emulation). + # If this is true, we are running a win32 platform (or an emulation). # else ifdef COMSPEC is_windows := $(findstring Windows,$(strip $(shell ver))) endif - endif #test NT + endif # test NT ifdef is_windows @@ -41,10 +41,12 @@ ifeq ($(PLATFORM),ansi) CONFIG_FILE := w32-gcc.mk # gcc Makefile by default SEP := / - ifeq ($(CC),cc) + ifeq ($(firstword $(CC)),cc) CC := gcc endif + # additionally, we provide hooks for various other compilers + # ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++ CONFIG_FILE := w32-vcc.mk SEP := $(BACKSLASH) @@ -73,7 +75,7 @@ ifeq ($(PLATFORM),ansi) lcc: setup endif - ifneq ($(findstring devel,$(MAKECMDGOALS)),) + ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target CONFIG_FILE := w32-dev.mk CC := gcc SEP := / diff --git a/config/win32/w32-dev.mk b/config/win32/w32-dev.mk index eaabc3ed1..daa6a8af8 100644 --- a/config/win32/w32-dev.mk +++ b/config/win32/w32-dev.mk @@ -1,28 +1,25 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for Win32 + GCC -#* THIS VERSION DISABLES OPTIMIZATIONS FOR DEBUGGING !! -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#* -#* NOTE : This version requires that GNU Make be invoked from the -#* Windows Shell (_not_ Cygwin BASH !!) -#* -#******************************************************************* +# +# FreeType 2 Configuration rules for Win32 + GCC +# +# Development version without optimizations. +# + + +# 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. +# +# NOTE: This version requires that GNU Make be invoked from the Windows +# Shell (_not_ Cygwin BASH)! +# ifndef TOP -TOP := . + TOP := . endif DELETE := del @@ -32,111 +29,110 @@ BUILD := $(TOP)/config/win32 PLATFORM := win32 CC := gcc -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g -O0 -Wall + CFLAGS := -c -g -O0 -Wall endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# Librarian to use to build the static library -# -FT_LIBRARIAN := $(AR) -r + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul - $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif +# EOF diff --git a/config/win32/w32-gcc.mk b/config/win32/w32-gcc.mk index 62581c7fa..c83c356a3 100644 --- a/config/win32/w32-gcc.mk +++ b/config/win32/w32-gcc.mk @@ -1,27 +1,23 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for Win32 + GCC -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#* -#* NOTE : This version requires that GNU Make be invoked from the -#* Windows Shell (_not_ Cygwin BASH !!) -#* -#******************************************************************* +# +# FreeType 2 Configuration rules for Win32 + GCC +# + + +# 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. +# +# NOTE: This version requires that GNU Make be invoked from the Windows +# Shell (_not_ Cygwin BASH)! +# ifndef TOP -TOP := . + TOP := . endif DELETE := del @@ -31,111 +27,110 @@ BUILD := $(TOP)/config/win32 PLATFORM := win32 CC := gcc -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := o -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := a -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := libfreetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. -# -L := -l - - -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - beware, there is a space after the 'o' !! +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # +L := -l + + +# Target flag. # -T := -o +T := -o # Don't remove this comment line! We need the space after `-o'. + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g -O6 -Wall + CFLAGS := -c -g -O6 -Wall endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# Librarian to use to build the static library -# -FT_LIBRARIAN := $(AR) -r + # Librarian to use to build the static library + # + FT_LIBRARIAN := $(AR) -r -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul - $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul + $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif +# EOF diff --git a/config/win32/w32-lcc.mk b/config/win32/w32-lcc.mk index 828d457c4..c5ae106a5 100644 --- a/config/win32/w32-lcc.mk +++ b/config/win32/w32-lcc.mk @@ -1,135 +1,127 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for Win32 + LCC -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 Configuration rules for Win32 + LCC +# + + +# 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 TOP -TOP := . + TOP := . endif DELETE := del SEP := / -HOSTSEP := \\ -BUILD := $(TOP)$(SEP)config$(SEP)win32 +HOSTSEP := $(strip \ ) +BUILD := $(TOP)/config/win32 PLATFORM := win32 CC := lcc -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := obj -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := lib -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := freetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := -I -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. # D := -D -# Target flag - LCC uses "-Fo" instead of "-o ", what a broken compiler -# -# -T := -Fo - -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # L := -Fl +# Target flag. +# +T := -Fo + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := -c -g2 -O + CFLAGS := -c -g2 -O endif -# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS := + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -DIR_OBJ := $(subst /,\\,$(OBJ_DIR)) - -$(FT_LIBRARY): $(OBJECTS_LIST) - lcclnk -o $(subst /,\\,$@) $(subst /,\\,$(OBJECTS_LIST)) + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + lcclnk -o $(subst $(SEP),$(HOSTSEP),$@) \ + $(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST)) endif - +# EOF diff --git a/config/win32/w32-vcc.mk b/config/win32/w32-vcc.mk index 27a7aca5b..da1ef487e 100644 --- a/config/win32/w32-vcc.mk +++ b/config/win32/w32-vcc.mk @@ -1,127 +1,126 @@ -#******************************************************************* -#* -#* FreeType 2 Configuration rules for Win32 + Visual C++ -#* -#* 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. -#* -#* Please read the file "freetype/docs/config.txt" to understand -#* what this file does.. -#* -#******************************************************************* +# +# FreeType 2 Configuration rules for Win32 + LCC +# + + +# 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 TOP + TOP := . +endif DELETE := del SEP := / HOSTSEP := $(strip \ ) -BUILD := $(TOP)$(SEP)config$(SEP)win32 +BUILD := $(TOP)/config/win32 PLATFORM := win32 CC := cl -# the directory where all object files are placed +# The directory where all object files are placed. # -# Note that this is not $(TOP)/obj !! -# This lets you build the library in your own directory -# with something like : -# -# set TOP=....../path/to/freetype2/top/dir... -# mkdir obj -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# Note that this is not $(TOP)/obj! +# This lets you build the library in your own directory with something like # +# set TOP=.../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile # OBJ_DIR := obj -# the directory where all library files are placed +# The directory where all library files are placed. # -# by default, this is the same as OBJ_DIR, however, this can be -# changed to suit particular needs.. +# By default, this is the same as $(OBJ_DIR), however, this can be changed +# to suit particular needs. # LIB_DIR := $(OBJ_DIR) -# the object file extension, this can be .o, .tco, .obj, etc.. -# depending on the platform +# The object file extension. This can be .o, .tco, .obj, etc., depending on +# the platform. # O := obj -# the library file extension, this can be .a, .lib, etc.. -# depending on the platform +# The library file extension. This can be .a, .lib, etc., depending on the +# platform. # A := lib -# The name of the final library file. -# Note that the DOS-specific Makefile uses a shorter (8.3) name +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. # LIBRARY := freetype -# path inclusion flag. -# -# Some compilers use a different flag than '-I' to specify an -# additional include path. Examples are "/i=" or "-J", etc... +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. # I := /I -# The link flag used to specify a given library file on link. -# Note that this is only used to compile the demo programs, not -# the library itself. +# C flag used to define a macro before the compilation of a given source +# object. Usually is `-D' like in `-DDEBUG'. +# +D := /D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. # L := /Fl -# C flag used to define a macro before the compilation of a given -# source object. Usually is '-D' like in "-DDEBUG" -# -D := /D - -# Target flag - LCC uses "-Fo" instead of "-o ", what a broken compiler -# +# Target flag. # T := /Fo + # C flags # -# These should concern : +# These should concern: debug output, optimization & warnings. # -# - debug output -# - optimization -# - warnings -# - ansi compliance.. +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. # ifndef CFLAGS -CFLAGS := /nologo /c /Ox /G5 /W3 /WX + CFLAGS := /nologo /c /Ox /G5 /W3 /WX endif -# ANSI_FLAGS : put there the flags used to make your compiler ANSI-compliant -# nothing (if it already is by default like LCC). +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # -ANSI_FLAGS := /Za +ANSIFLAGS := /Za + ifdef BUILD_FREETYPE -include $(TOP)/config/freetype.mk + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP)/config/freetype.mk -clean_freetype: clean_freetype_dos -distclean_freetype: distclean_freetype_dos + # The cleanup targets. + # + clean_freetype: clean_freetype_dos + distclean_freetype: distclean_freetype_dos -# This final rule is used to link all object files into a single -# library. It is part of the system-specific sub-Makefile because not -# all librarians accept a simple syntax like : -# -# librarian library_file {list of object files} -# -$(FT_LIBRARY): $(OBJECTS_LIST) - lib /nologo /out:$@ $(OBJECTS_LIST) + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(FT_LIBRARY): $(OBJECTS_LIST) + lib /nologo /out:$@ $(OBJECTS_LIST) endif - +# EOF diff --git a/docs/design/io-frames.html b/docs/design/io-frames.html index 2b249b691..a5c6de7cd 100644 --- a/docs/design/io-frames.html +++ b/docs/design/io-frames.html @@ -49,8 +49,8 @@

Simply speaking, a frame is an array of bytes in a font file that is - "preloaded" into memory in order to be rapidly parsed. Frames are useful - to ensure that every "load" is checked against end-of-file overruns, and + `preloaded' into memory in order to be rapidly parsed. Frames are useful + to ensure that every `load' is checked against end-of-file overruns, and provides nice functions to extract data in a variety of distinct formats.

@@ -83,7 +83,7 @@ FT_Forget_Frame( stream ); -

Here, the call to FT_Access_Frame() will

+

Here, the call to FT_Access_Frame() will

  • @@ -91,20 +91,20 @@ stream.

  • -

    "Preload" (for disk-based streams) 10 bytes from the current +

    `Preload' (for disk-based streams) 10 bytes from the current stream position.

  • -

    Set the frame "cursor" to the first byte in the frame.

    +

    Set the frame `cursor' to the first byte in the frame.

-

Each FT_Get_Short() or FT_Get_ULong() call will read - a big-endian integer from the stream (2 bytes for - FT_Get_Short(), 4 bytes for FT_Get_ULong) and - advance the frame cursor accordingly.

+

Each FT_Get_Short() or FT_Get_ULong() call + will read a big-endian integer from the stream (2 bytes for + FT_Get_Short(), 4 bytes for FT_Get_ULong) + and advance the frame cursor accordingly.

-

FT_Forget_Frame() "releases" the frame from memory.

+

FT_Forget_Frame() `releases' the frame from memory.

There are several advantages to using frames:

@@ -126,54 +126,55 @@

By convention in the FreeType source code, macros are able to use two - implicit variables named error and stream. This is + implicit variables named error and stream. This is useful because these two variables are extremely often used in the library, and doing this only reduces our typing requirements and make the source code much clearer.

-

Note that error must be a local variable of type - FT_Error, while stream must be a local variable or - argument of type FT_Stream.

+

Note that error must be a local variable of type + FT_Error, while stream must be a local variable or + argument of type FT_Stream.

The macro used to access a frame is ACCESS_Frame(_size_), it will + color="purple">ACCESS_Frame(_size_), it will translate to

     ( error = FT_Access_Frame( stream, _size_ ) )
-        != FT_Err_Ok
+ != FT_Err_Ok

Similarly, the macro FORGET_Frame() translates to

+ color="purple">FORGET_Frame() translates to

-    FT_Forget_Frame( stream )
+ FT_Forget_Frame( stream )
-

Extracting integers can be performed with the GET_xxx() +

Extracting integers can be performed with the GET_xxx() macros, like

- +
- - +
- Macro name - + + Macro name + Translation - - + + Description - +
- GET_Byte() + GET_Byte() - FT_Get_Byte(stream) + FT_Get_Byte(stream)

Reads an 8-bit unsigned byte.

@@ -181,11 +182,11 @@
- GET_Char() + GET_Char() - (FT_Char)
- FT_Get_Byte(stream)
+ (FT_Char)
+ FT_Get_Byte(stream)

Reads an 8-bit signed byte.

@@ -193,10 +194,10 @@
- GET_Short() + GET_Short() - FT_Get_Short(stream) + FT_Get_Short(stream) Reads a 16-bit signed big-endian integer. @@ -204,11 +205,11 @@
- GET_UShort() + GET_UShort() - (FT_UShort)
- FT_Get_Short(stream)
+ (FT_UShort)
+ FT_Get_Short(stream)
Reads a 16-bit unsigned big-endian integer. @@ -216,10 +217,10 @@
- GET_Offset() + GET_Offset() - FT_Get_Offset(stream) + FT_Get_Offset(stream) Reads a 24-bit signed big-endian integer. @@ -227,11 +228,11 @@
- GET_UOffset() + GET_UOffset() - (FT_UOffset)
- FT_Get_Offset(stream)
+ (FT_UOffset)
+ FT_Get_Offset(stream)
Reads a 24-bit unsigned big-endian integer. @@ -239,10 +240,10 @@
- GET_Long() + GET_Long() - FT_Get_Long(stream) + FT_Get_Long(stream) Reads a 32-bit signed big-endian integer. @@ -250,11 +251,11 @@
- GET_ULong() + GET_ULong() - (FT_ULong)
- FT_Get_Long(stream)
+ (FT_ULong)
+ FT_Get_Long(stream)
Reads a 32-bit unsigned big-endian integer. @@ -292,7 +293,7 @@ FORGET_Frame(); -

Which is clearer. Notice that error and stream +

Which is clearer. Notice that error and stream must be defined locally though for this code to work!


@@ -304,18 +305,18 @@

It is sometimes useful to read small integers from a font file without using a frame. Some functions have been introduced in FreeType 2 to do just that, and they are of the form FT_Read_xxxx.

+ color="blue">FT_Read_xxxx.

-

For example, FT_Read_Short(stream, - &error) reads and returns a 2-byte big-endian integer from a - stream, and places an error code in the error +

For example, FT_Read_Short(stream, + &error) reads and returns a 2-byte big-endian integer from a + stream, and places an error code in the error variable.

Thus, reading a single big-endian integer is shorter than using a frame for it.

Note that there are also macros READ_xxx() which translate to

+ color="purple">READ_xxx() which translate to

@@ -331,7 +332,8 @@
       goto Fail;
-

if error and stream are already defined locally.

+

if error and stream are already defined + locally.

diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index c7ff4c0ae..570a598fb 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -206,8 +206,8 @@ /* */ /* Don't define any of these macros to compile in `release' mode. */ /* */ -#undef FT_DEBUG_LEVEL_ERROR -#undef FT_DEBUG_LEVEL_TRACE +#define FT_DEBUG_LEVEL_ERROR +#define FT_DEBUG_LEVEL_TRACE /*************************************************************************/ diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h index 656be046b..4db1bb912 100644 --- a/include/freetype/internal/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -20,6 +20,7 @@ #define SFNT_H #include +#include #include diff --git a/src/base/ftextend.c b/src/base/ftextend.c index 252934db4..f7ca3987b 100644 --- a/src/base/ftextend.c +++ b/src/base/ftextend.c @@ -26,6 +26,7 @@ #include +#include /*************************************************************************/ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 95981465b..ad540fe8c 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -192,9 +192,7 @@ FT_TRACE7(( " Freeing block 0x%08p, ref 0x%08p\n", P, P ? *P : (void*)0 )); - FT_Assert( P != 0 ); - - if ( *P ) + if ( P && *P ) { memory->free( memory, *P ); *P = 0; diff --git a/src/base/rules.mk b/src/base/rules.mk index 404f4d137..a8846a9e5 100644 --- a/src/base/rules.mk +++ b/src/base/rules.mk @@ -13,39 +13,31 @@ # fully. -# It sets the following variables, which are used by the master Makefile +# It sets the following variables which are used by the master Makefile # after the call: # -# BASE_H: The list of base layer header files on which the rest -# of the library (i.e. drivers) rely. +# BASE_OBJ_S: The single-object base layer. +# BASE_OBJ_M: A list of all objects for a multiple-objects build. +# BASE_EXT_OBJ: A list of base layer extensions, i.e., components found +# in `freetype/src/base' which are not compiled within the +# base layer proper. # -# BASE_OBJ_S: The single-object base layer. -# BASE_OBJ_M: A list of all objects for a multiple-objects build. -# BASE_EXT_OBJ: A list of base layer extensions, i.e., components found -# in `freetype/lib/base' which are not compiled within the -# base layer proper. +# BASE_H is defined in freetype.mk to simplify the dependency rules. + BASE_COMPILE := $(FT_COMPILE) $I$(SRC_)base + # Base layer sources # -BASE_SRC := $(BASE_)ftcalc.c \ - $(BASE_)ftextend.c \ - $(BASE_)ftlist.c \ - $(BASE_)ftobjs.c \ - $(BASE_)ftstream.c \ - $(BASE_)ftoutln.c - -# Base layer headers +# ftsystem, ftinit, and ftdebug are handled by freetype.mk # -BASE_H := $(INTERNAL_)ftcalc.h \ - $(INTERNAL_)ftdebug.h \ - $(INTERNAL_)ftdriver.h \ - $(INTERNAL_)ftextend.h \ - $(INTERNAL_)ftlist.h \ - $(INTERNAL_)ftobjs.h \ - $(INTERNAL_)ftstream.h - +BASE_SRC := $(BASE_)ftcalc.c \ + $(BASE_)ftextend.c \ + $(BASE_)ftlist.c \ + $(BASE_)ftobjs.c \ + $(BASE_)ftstream.c \ + $(BASE_)ftoutln.c # Base layer `extensions' sources # @@ -58,10 +50,6 @@ BASE_EXT_SRC := $(BASE_)ftraster.c \ $(BASE_)ftmm.c \ $(BASE_)ftgrays.c -# Base layer extensions headers -# -BASE_EXT_H := $(BASE_EXT_SRC:%c=%h) - # Default extensions objects # BASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_)%.c=$(OBJ_)%.$O) @@ -78,21 +66,20 @@ BASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_)%.c=$(OBJ_)%.$O) BASE_OBJ_M := $(BASE_SRC:$(BASE_)%.c=$(OBJ_)%.$O) BASE_OBJ_S := $(OBJ_)ftbase.$O -# Base layer root source file(s) +# Base layer root source file for single build # -BASE_SRC_M := $(BASE_SRC) BASE_SRC_S := $(BASE_)ftbase.c -# Multiple objects build + extensions -# -$(OBJ_)ft%.$O: $(BASE_)ft%.c $(PUBLIC_H) $(BASE_H) - $(BASE_COMPILE) $T$@ $< - - # Base layer - single object build # -$(BASE_OBJ_S): $(PUBLIC_H) $(BASE_H) $(BASE_SRC_S) $(BASE_SRC) +$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(BASE_COMPILE) $T$@ $(BASE_SRC_S) + +# Multiple objects build + extensions +# +$(OBJ_)%.$O: $(BASE_)%.c $(FREETYPE_H) + $(BASE_COMPILE) $T$@ $< + # EOF diff --git a/src/cff/rules.mk b/src/cff/rules.mk index 39e658da3..d7cc66ae9 100644 --- a/src/cff/rules.mk +++ b/src/cff/rules.mk @@ -6,34 +6,22 @@ # 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 +# 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 the rules defined for the SFNT driver, which is heavily used -# by the TrueType one. -# -include $(SRC_)sfnt/rules.mk - - # OpenType driver directory # T2_DIR := $(SRC_)cff T2_DIR_ := $(T2_DIR)$(SEP) -# location of all extensions to the driver, if any -# -T2_EXT_DIR := $(T2_DIR_)extend -T2_EXT_DIR_ := $(T2_EXT_DIR)$(SEP) - # additional include flags used when compiling the driver # -T2_INCLUDE := $(SFNT_INCLUDE) $(T2_DIR) $(T2_EXT_DIR) - +T2_INCLUDE := $(T2_DIR) # compilation flags for the driver # @@ -41,7 +29,7 @@ T2_CFLAGS := $(T2_INCLUDE:%=$I%) T2_COMPILE := $(FT_COMPILE) $(T2_CFLAGS) -# driver sources (i.e., C files) +# T2 driver sources (i.e., C files) # T2_DRV_SRC := $(T2_DIR_)t2objs.c \ $(T2_DIR_)t2load.c \ @@ -49,58 +37,34 @@ T2_DRV_SRC := $(T2_DIR_)t2objs.c \ $(T2_DIR_)t2parse.c \ $(T2_DIR_)t2driver.c -# driver headers +# T2 driver headers # -T2_DRV_H := $(SFNT_H) \ - $(T2_DRV_SRC:%.c=%.h) +T2_DRV_H := $(T2_DRV_SRC:%.c=%.h) \ + $(T2_DIR_)t2tokens.h -# default extensions headers +# T2 driver object(s) # -T2_EXT_H := $(T2_EXT_SRC:.c=.h) - - -# driver object(s) -# -# T2_DRV_OBJ_M is used during `debug' builds -# T2_DRV_OBJ_S is used during `release' builds +# T2_DRV_OBJ_M is used during `multi' builds +# T2_DRV_OBJ_S is used during `single' builds # T2_DRV_OBJ_M := $(T2_DRV_SRC:$(T2_DIR_)%.c=$(OBJ_)%.$O) T2_DRV_OBJ_S := $(OBJ_)cff.$O - -# default extensions objects +# T2 driver source file for single build # -T2_EXT_OBJ := $(T2_EXT_SRC:$(T2_EXT_DIR_)%.c=$(OBJ_)%.$O) - - -# driver source file(s) -# -T2_DRV_SRC_M := $(T2_DRV_SRC) $(SFNT_SRC) T2_DRV_SRC_S := $(T2_DIR_)cff.c -# driver - single object +# T2 driver - single object # -# the driver is recompiled if any of the header or source files is changed -# as well as any of the shared source files found in `shared/sfnt' -# -$(T2_DRV_OBJ_S): $(BASE_H) $(T2_DRV_H) $(T2_DRV_SRC) $(T2_DRV_SRC_S) +$(T2_DRV_OBJ_S): $(T2_DRV_SRC_S) $(T2_DRV_SRC) $(FREETYPE_H) $(T2_DRV_H) $(T2_COMPILE) $T$@ $(T2_DRV_SRC_S) - -# driver - multiple objects +# T2 driver - multiple objects # -# All objects are recompiled if any of the header files is changed -# -$(OBJ_)t2%.$O: $(T2_DIR_)t2%.c $(BASE_H) $(T2_DRV_H) - $(T2_COMPILE) $T$@ $< - -$(OBJ_)t2x%.$O: $(T2_EXT_DIR_)t2x%.c $(BASE_H) $(SFNT_H) $(T2_EXT_H) - $(T2_COMPILE) $T$@ $< - -$(OBJ_)t2%.$O: $(SFNT_DIR_)t2%.c $(BASE_H) $(SFNT_H) +$(OBJ_)%.$O: $(T2_DIR_)%.c $(FREETYPE_H) $(T2_DRV_H) $(T2_COMPILE) $T$@ $< diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c index d4d841304..b502d9702 100644 --- a/src/cff/t2gload.c +++ b/src/cff/t2gload.c @@ -25,6 +25,7 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_t1gload +#include #include typedef enum T2_Operator_ diff --git a/src/cff/t2load.c b/src/cff/t2load.c index f3a0748c0..b70bff5a1 100644 --- a/src/cff/t2load.c +++ b/src/cff/t2load.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* t2load.h */ +/* t2load.c */ /* */ /* TrueType glyph data/program tables loader (body). */ /* */ diff --git a/src/cff/t2load.h b/src/cff/t2load.h index 7a7d3b27b..d8a3adcdb 100644 --- a/src/cff/t2load.h +++ b/src/cff/t2load.h @@ -46,6 +46,14 @@ void T2_Forget_Element( CFF_Index* index, FT_Byte* *pbytes ); + LOCAL_FUNC + FT_Error T2_Load_CFF_Font( FT_Stream stream, + FT_Int face_index, + CFF_Font* font ); + + LOCAL_FUNC + void T2_Done_CFF_Font( CFF_Font* font ); + #ifdef __cplusplus } diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c index 03a61d25c..8911c146b 100644 --- a/src/cid/cidgload.c +++ b/src/cid/cidgload.c @@ -15,6 +15,8 @@ * ******************************************************************/ + +#include #include #include #include diff --git a/src/cid/cidload.c b/src/cid/cidload.c index df23e5db0..40df46310 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -477,7 +477,7 @@ } LOCAL_FUNC - FT_Error T1_Open_Face( CID_Face face ) + FT_Error CID_Open_Face( CID_Face face ) { CID_Loader loader; CID_Parser* parser; diff --git a/src/cid/cidload.h b/src/cid/cidload.h index b96b7ce1f..53ae5035e 100644 --- a/src/cid/cidload.h +++ b/src/cid/cidload.h @@ -42,7 +42,7 @@ FT_UShort seed ); LOCAL_DEF - FT_Error T1_Open_Face( CID_Face face ); + FT_Error CID_Open_Face( CID_Face face ); #ifdef __cplusplus } diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c index 3d7e24d56..d22d7fc70 100644 --- a/src/cid/cidobjs.c +++ b/src/cid/cidobjs.c @@ -228,7 +228,7 @@ if ( FILE_Seek(0) ) goto Exit; - error = T1_Open_Face( face ); + error = CID_Open_Face( face ); if (error) goto Exit; /* if we just wanted to check the format, leave successfully now */ diff --git a/src/cid/rules.mk b/src/cid/rules.mk index cdfa653b6..5999a739b 100644 --- a/src/cid/rules.mk +++ b/src/cid/rules.mk @@ -1,32 +1,19 @@ # -# FreeType 2 driver configuration rules +# FreeType 2 CID driver configuration rules # # 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 +# 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. -#**************************************************************************** -#* * -#* The "Type1z" driver is an experimental replacement for the current * -#* Type 1 driver. It features a very different loading mechanism that * -#* is much faster than the one used by the `normal' driver, and also * -#* deals nicely with nearly broken Type 1 font files. It is also * -#* much smaller... * -#* * -#* Note that it may become a permanent replacement of the current * -#* "src/type1" driver in the future.. * -#* * -#**************************************************************************** - -# Type1z driver directory +# CID driver directory # CID_DIR := $(SRC_)cid CID_DIR_ := $(CID_DIR)$(SEP) @@ -34,57 +21,51 @@ CID_DIR_ := $(CID_DIR)$(SEP) # additional include flags used when compiling the driver # -CID_INCLUDE := $(SHARED) $(CID_DIR) -CID_COMPILE := $(FT_COMPILE) $(CID_INCLUDE:%=$I%) +CID_INCLUDE := $(CID_DIR) + +# compilation flags for the driver +# +CID_CFLAGS := $(CID_INCLUDE:%=$I%) +CID_COMPILE := $(FT_COMPILE) $(CID_CFLAGS) -# Type1 driver sources (i.e., C files) +# CID driver sources (i.e., C files) # CID_DRV_SRC := $(CID_DIR_)cidparse.c \ $(CID_DIR_)cidload.c \ $(CID_DIR_)cidriver.c \ $(CID_DIR_)cidgload.c \ - $(CID_DIR_)cidafm.c + $(CID_DIR_)cidafm.c \ + $(CID_DIR_)cidobjs.c -# Type1 driver headers +# CID driver headers # -CID_DRV_H := $(CID_DIR_)cidtokens.h \ - $(T1SHARED_H) \ - $(CID_DRV_SRC:%.c=%.h) +CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \ + $(CID_DIR_)cidtokens.h -# driver object(s) +# CID driver object(s) # -# CID_DRV_OBJ_M is used during `debug' builds -# CID_DRV_OBJ_S is used during `release' builds +# CID_DRV_OBJ_M is used during `multi' builds +# CID_DRV_OBJ_S is used during `single' builds # -CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR_)%.c=$(OBJ_)%.$O) \ - $(T1SHARED:$(T1SHARED_DIR_)%.c=$(OBJ_)%.$O) +CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR_)%.c=$(OBJ_)%.$O) CID_DRV_OBJ_S := $(OBJ_)type1cid.$O - -# driver source file(s) +# CID driver source file for single build # -CID_DRV_SRC_M := $(CID_DRV_SRC) $(T1SHARED_SRC) CID_DRV_SRC_S := $(CID_DIR_)type1cid.c -# driver - single object +# CID driver - single object # -# the driver is recompiled if any of the header or source files is changed -# -$(CID_DRV_OBJ_S): $(BASE_H) $(CID_DRV_H) $(CID_DRV_SRC) $(CID_DRV_SRC_S) +$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H) $(CID_COMPILE) $T$@ $(CID_DRV_SRC_S) -# driver - multiple objects +# CID driver - multiple objects # -# All objects are recompiled if any of the header files is changed -# -$(OBJ_)t1%.$O: $(CID_DIR_)t1%.c $(BASE_H) $(CID_DRV_H) - $(CID_COMPILE) $T$@ $< - -$(OBJ_)t1%.$O: $(T1SHARED_DIR_)t1%.c $(BASE_H) $(T1SHARED_H) +$(OBJ_)%.$O: $(CID_DIR_)%.c $(FREETYPE_H) $(CID_DRV_H) $(CID_COMPILE) $T$@ $< diff --git a/src/psnames/rules.mk b/src/psnames/rules.mk index 56654b83c..47580e79c 100644 --- a/src/psnames/rules.mk +++ b/src/psnames/rules.mk @@ -6,81 +6,70 @@ # 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 +# 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 PSNAMES_INCLUDE - # PSNAMES driver directory - # - PSNAMES_DIR := $(SRC_)psnames - PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP) +# PSNames driver directory +# +PSNAMES_DIR := $(SRC_)psnames +PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP) - # additional include flags used when compiling the driver - # - PSNAMES_INCLUDE := $(SHARED) $(PSNAMES_DIR) +# additional include flags used when compiling the driver +# +PSNAMES_INCLUDE := $(PSNAMES_DIR) - # compilation flags for the driver - # - PSNAMES_CFLAGS := $(PSNAMES_INCLUDE:%=$I%) - PSNAMES_COMPILE := $(FT_COMPILE) $(PSNAMES_CFLAGS) +# compilation flags for the driver +# +PSNAMES_CFLAGS := $(PSNAMES_INCLUDE:%=$I%) +PSNAMES_COMPILE := $(FT_COMPILE) $(PSNAMES_CFLAGS) - # driver sources (i.e., C files) - # - PSNAMES_DRV_SRC := $(PSNAMES_DIR_)psdriver.c +# PSNames driver sources (i.e., C files) +# +PSNAMES_DRV_SRC := $(PSNAMES_DIR_)psdriver.c - # driver headers - # - PSNAMES_DRV_H := $(BASE_H) \ - $(PSNAMES_DIR_)psdriver.h \ - $(PSNAMES_DIR_)pstables.h +# PSNames driver headers +# +PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \ + $(PSNAMES_DIR_)pstables.h - # driver object(s) - # - # PSNAMES_DRV_OBJ_M is used during `debug' builds - # PSNAMES_DRV_OBJ_S is used during `release' builds - # - PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR_)%.c=$(OBJ_)%.$O) - PSNAMES_DRV_OBJ_S := $(OBJ_)psnames.$O +# PSNames driver object(s) +# +# PSNAMES_DRV_OBJ_M is used during `multi' builds +# PSNAMES_DRV_OBJ_S is used during `single' builds +# +PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR_)%.c=$(OBJ_)%.$O) +PSNAMES_DRV_OBJ_S := $(OBJ_)psnames.$O + +# PSNames driver source file for single build +# +PSNAMES_DRV_SRC_S := $(PSNAMES_DIR_)psdriver.c - # driver source file(s) - # - PSNAMES_DRV_SRC_M := $(PSNAMES_DRV_SRC) - PSNAMES_DRV_SRC_S := $(PSNAMES_DIR_)psdriver.c +# PSNames driver - single object +# +$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \ + $(FREETYPE_H) $(PSNAMES_DRV_H) + $(PSNAMES_COMPILE) $T$@ $(PSNAMES_DRV_SRC_S) - # driver - single object - # - # the driver is recompiled if any of the header or source files is - # changed as well as any of the shared source files found in - # `shared' - # - $(PSNAMES_DRV_OBJ_S): $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) \ - $(PSNAMES_DRV_SRC) $(PSNAMES_DRV_SRC_S) - $(PSNAMES_COMPILE) $T$@ $(PSNAMES_DRV_SRC_S) +# PSNames driver - multiple objects +# +$(OBJ_)%.$O: $(PSNAMES_DIR_)%.c $(FREETYPE_H) $(PSNAMES_DRV_H) + $(PSNAMES_COMPILE) $T$@ $< - # driver - multiple objects - # - # All objects are recompiled if any of the header files is changed. - # - $(OBJ_)ps%.$O: $(PSNAMES_DIR_)ps%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) - $(PSNAMES_COMPILE) $T$@ $< +# update main driver object lists +# +DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) +DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) - # update main driver object lists - # - DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) - DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) - -endif - # EOF diff --git a/src/sfnt/rules.mk b/src/sfnt/rules.mk index a059b9c16..e3b0bbdd3 100644 --- a/src/sfnt/rules.mk +++ b/src/sfnt/rules.mk @@ -13,84 +13,66 @@ # fully. -ifndef SFNT_INCLUDE - # SFNT driver directory - # - SFNT_DIR := $(SRC_)sfnt - SFNT_DIR_ := $(SFNT_DIR)$(SEP) +# SFNT driver directory +# +SFNT_DIR := $(SRC_)sfnt +SFNT_DIR_ := $(SFNT_DIR)$(SEP) - # additional include flags used when compiling the driver - # - SFNT_INCLUDE := $(SHARED) $(SFNT_DIR) +# additional include flags used when compiling the driver +# +SFNT_INCLUDE := $(SFNT_DIR) - # compilation flags for the driver - # - SFNT_CFLAGS := $(SFNT_INCLUDE:%=$I%) - SFNT_COMPILE := $(FT_COMPILE) $(SFNT_CFLAGS) +# compilation flags for the driver +# +SFNT_CFLAGS := $(SFNT_INCLUDE:%=$I%) +SFNT_COMPILE := $(FT_COMPILE) $(SFNT_CFLAGS) - # driver sources (i.e., C files) - # - SFNT_DRV_SRC := $(SFNT_DIR_)ttload.c \ - $(SFNT_DIR_)ttcmap.c \ - $(SFNT_DIR_)ttsbit.c \ - $(SFNT_DIR_)ttpost.c \ - $(SFNT_DIR_)sfobjs.c \ - $(SFNT_DIR_)sfdriver.c +# SFNT driver sources (i.e., C files) +# +SFNT_DRV_SRC := $(SFNT_DIR_)ttload.c \ + $(SFNT_DIR_)ttcmap.c \ + $(SFNT_DIR_)ttsbit.c \ + $(SFNT_DIR_)ttpost.c \ + $(SFNT_DIR_)sfobjs.c \ + $(SFNT_DIR_)sfdriver.c - # driver headers - # - SFNT_DRV_H := $(BASE_H) \ - $(SFNT_DIR_)sfobjs.h \ - $(SFNT_DIR_)ttload.h \ - $(SFNT_DIR_)ttsbit.h \ - $(SFNT_DIR_)ttcmap.h \ - $(SFNT_DIR_)ttpost.h +# SFNT driver headers +# +SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) - # driver object(s) - # - # SFNT_DRV_OBJ_M is used during `debug' builds - # SFNT_DRV_OBJ_S is used during `release' builds - # - SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR_)%.c=$(OBJ_)%.$O) - SFNT_DRV_OBJ_S := $(OBJ_)sfnt.$O +# SFNT driver object(s) +# +# SFNT_DRV_OBJ_M is used during `multi' builds. +# SFNT_DRV_OBJ_S is used during `single' builds. +# +SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR_)%.c=$(OBJ_)%.$O) +SFNT_DRV_OBJ_S := $(OBJ_)sfnt.$O + +# SFNT driver source file for single build +# +SFNT_DRV_SRC_S := $(SFNT_DIR_)sfnt.c - # driver source file(s) - # - SFNT_DRV_SRC_M := $(SFNT_DRV_SRC) - SFNT_DRV_SRC_S := $(SFNT_DIR_)sfnt.c +# SFNT driver - single object +# +$(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \ + $(FREETYPE_H) $(SFNT_DRV_H) + $(SFNT_COMPILE) $T$@ $(SFNT_DRV_SRC_S) - # driver - single object - # - # the driver is recompiled if any of the header or source files is - # changed as well as any of the shared source files found in - # `shared' - # - $(SFNT_DRV_OBJ_S): $(BASE_H) $(SHARED_H) $(SFNT_DRV_H) \ - $(SFNT_DRV_SRC) $(SFNT_DRV_SRC_S) - $(SFNT_COMPILE) $T$@ $(SFNT_DRV_SRC_S) +# SFNT driver - multiple objects +# +$(OBJ_)%.$O: $(SFNT_DIR_)%.c $(FREETYPE_H) $(SFNT_DRV_H) + $(SFNT_COMPILE) $T$@ $< - # driver - multiple objects - # - # All objects are recompiled if any of the header files is changed - # - $(OBJ_)tt%.$O: $(SFNT_DIR_)tt%.c $(BASE_H) $(SHARED_H) $(SFNT_DRV_H) - $(SFNT_COMPILE) $T$@ $< +# update main driver object lists +# +DRV_OBJS_S += $(SFNT_DRV_OBJ_S) +DRV_OBJS_M += $(SFNT_DRV_OBJ_M) - $(OBJ_)sf%.$O: $(SFNT_DIR_)sf%.c $(BASE_H) $(SHARED_H) $(SFNT_DRV_H) - $(SFNT_COMPILE) $T$@ $< - - - # update main driver object lists - # - DRV_OBJS_S += $(SFNT_DRV_OBJ_S) - DRV_OBJS_M += $(SFNT_DRV_OBJ_M) - -endif # EOF diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 958a49f26..79d60f96d 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -16,6 +16,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 5d4cfacc7..e91fa254c 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -453,16 +453,14 @@ /* check against the last segment */ seg4 = cmap4->last_segment; - /* the following is equivalent to performing two tests, as in : */ - /* */ - /* if ( charCode >= seg4->startCount && charCode <= seg4->endCount */ - /* */ - /* Yes, that's a bit strange, but it's faster, and the idea behind */ - /* the cache is to significantly speed up charcode to glyph index */ - /* conversion.. */ - /* */ - /* Sorry if it isn't clear to your eyes.. */ - /* */ + /* the following is equivalent to performing two tests, as in */ + /* */ + /* if ( charCode >= seg4->startCount && charCode <= seg4->endCount ) */ + /* */ + /* Yes, that's a bit strange, but it's faster, and the idea behind */ + /* the cache is to significantly speed up charcode to glyph index */ + /* conversion. */ + if ( (TT_ULong)(charCode - seg4->startCount) < (TT_ULong)(seg4->endCount - seg4->startCount) ) goto Found; @@ -471,6 +469,7 @@ { /* the ranges are sorted in increasing order. If we are out of */ /* the range here, the char code isn't in the charmap, so exit. */ + if ( charCode > seg4->endCount ) continue; diff --git a/src/truetype/rules.mk b/src/truetype/rules.mk index a12ef0391..51c8556a2 100644 --- a/src/truetype/rules.mk +++ b/src/truetype/rules.mk @@ -6,34 +6,22 @@ # 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 +# 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 the rules defined for the SFNT driver, which are heavily used -# by the TrueType one. -# -include $(SRC_)sfnt/rules.mk - - # TrueType driver directory # TT_DIR := $(SRC_)truetype TT_DIR_ := $(TT_DIR)$(SEP) -# location of all extensions to the driver, if any -# -TT_EXT_DIR := $(TT_DIR_)extend -TT_EXT_DIR_ := $(TT_EXT_DIR)$(SEP) - # additional include flags used when compiling the driver # -TT_INCLUDE := $(SFNT_INCLUDE) $(TT_DIR) $(TT_EXT_DIR) - +TT_INCLUDE := $(TT_DIR) # compilation flags for the driver # @@ -41,7 +29,7 @@ TT_CFLAGS := $(TT_INCLUDE:%=$I%) TT_COMPILE := $(FT_COMPILE) $(TT_CFLAGS) -# driver sources (i.e., C files) +# TrueType driver sources (i.e., C files) # TT_DRV_SRC := $(TT_DIR_)ttobjs.c \ $(TT_DIR_)ttpload.c \ @@ -49,65 +37,33 @@ TT_DRV_SRC := $(TT_DIR_)ttobjs.c \ $(TT_DIR_)ttinterp.c \ $(TT_DIR_)ttdriver.c -# driver headers +# TrueType driver headers # -TT_DRV_H := $(SFNT_H) \ - $(TT_DRV_SRC:%.c=%.h) +TT_DRV_H := $(TT_DRV_SRC:%.c=%.h) -# default extensions sources +# TrueType driver object(s) # -TT_EXT_SRC := $(TT_EXT_DIR_)ttxkern.c \ - $(TT_EXT_DIR_)ttxgasp.c \ - $(TT_EXT_DIR_)ttxpost.c \ - $(TT_EXT_DIR_)ttxcmap.c \ - $(TT_EXT_DIR_)ttxwidth.c - -# default extensions headers -# -TT_EXT_H := $(TT_EXT_SRC:.c=.h) - - -# driver object(s) -# -# TT_DRV_OBJ_M is used during `debug' builds -# TT_DRV_OBJ_S is used during `release' builds +# TT_DRV_OBJ_M is used during `multi' builds +# TT_DRV_OBJ_S is used during `single' builds # TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR_)%.c=$(OBJ_)%.$O) TT_DRV_OBJ_S := $(OBJ_)truetype.$O - -# default extensions objects +# TrueType driver source file for single build # -TT_EXT_OBJ := $(TT_EXT_SRC:$(TT_EXT_DIR_)%.c=$(OBJ_)%.$O) - - -# driver source file(s) -# -TT_DRV_SRC_M := $(TT_DRV_SRC) $(SFNT_SRC) TT_DRV_SRC_S := $(TT_DIR_)truetype.c -# driver - single object +# TrueType driver - single object # -# the driver is recompiled if any of the header or source files is changed -# as well as any of the shared source files found in `shared/sfnt' -# -$(TT_DRV_OBJ_S): $(BASE_H) $(TT_DRV_H) $(TT_DRV_SRC) $(TT_DRV_SRC_S) +$(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H) $(TT_COMPILE) $T$@ $(TT_DRV_SRC_S) # driver - multiple objects # -# All objects are recompiled if any of the header files is changed -# -$(OBJ_)tt%.$O: $(TT_DIR_)tt%.c $(BASE_H) $(TT_DRV_H) - $(TT_COMPILE) $T$@ $< - -$(OBJ_)ttx%.$O: $(TT_EXT_DIR_)ttx%.c $(BASE_H) $(SFNT_H) $(TT_EXT_H) - $(TT_COMPILE) $T$@ $< - -$(OBJ_)tt%.$O: $(SFNT_DIR_)tt%.c $(BASE_H) $(SFNT_H) +$(OBJ_)%.$O: $(TT_DIR_)%.c $(FREETYPE_H) $(TT_DRV_H) $(TT_COMPILE) $T$@ $< diff --git a/src/type1z/t1afm.c b/src/type1z/t1afm.c index 56eb84a06..68bb6daf5 100644 --- a/src/type1z/t1afm.c +++ b/src/type1z/t1afm.c @@ -115,10 +115,10 @@ /* parse an AFM file - for now, only read the kerning pairs */ LOCAL_FUNC - FT_Error T1_Read_AFM( FT_Face t1_face, + T1_Error T1_Read_AFM( FT_Face t1_face, FT_Stream stream ) { - FT_Error error; + T1_Error error; FT_Memory memory = stream->memory; FT_Byte* start; FT_Byte* limit; diff --git a/src/type1z/t1afm.h b/src/type1z/t1afm.h index 984ae945c..4adf4fb7f 100644 --- a/src/type1z/t1afm.h +++ b/src/type1z/t1afm.h @@ -8,40 +8,43 @@ #ifndef T1AFM_H #define T1AFM_H +#include #include +#include +#include /* 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_ { - FT_UInt glyph1; - FT_UInt glyph2; - FT_Vector kerning; + T1_UInt glyph1; + T1_UInt glyph2; + T1_Vector kerning; } T1_Kern_Pair; typedef struct T1_AFM_ { - FT_Int num_pairs; + T1_Int num_pairs; T1_Kern_Pair* kern_pairs; } T1_AFM; LOCAL_DEF -FT_Error T1_Read_AFM( FT_Face face, - FT_Stream stream ); +T1_Error T1_Read_AFM( FT_Face face, + FT_Stream stream ); LOCAL_DEF -void T1_Done_AFM( FT_Memory memory, - T1_AFM* afm ); +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 ); + T1_UInt glyph1, + T1_UInt glyph2, + T1_Vector* kerning ); #endif /* T1AFM_H */ diff --git a/src/type1z/t1driver.c b/src/type1z/t1driver.c index b086d53bf..e90523224 100644 --- a/src/type1z/t1driver.c +++ b/src/type1z/t1driver.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -435,7 +436,7 @@ EXPORT_FUNC(FT_DriverInterface*) getDriverInterface( void ) { - return &t1_driver_interface; + return &t1z_driver_interface; } #endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */ diff --git a/src/type1z/t1load.c b/src/type1z/t1load.c index 3adbc3128..92e1ce620 100644 --- a/src/type1z/t1load.c +++ b/src/type1z/t1load.c @@ -148,14 +148,14 @@ goto Exit; } - LOCAL_FUNC FT_Error T1_Get_Multi_Master( T1_Face face, + LOCAL_FUNC T1_Error T1_Get_Multi_Master( T1_Face face, FT_Multi_Master* master ) { T1_Blend* blend = face->blend; T1_UInt n; - FT_Error error; + T1_Error error; - error = FT_Err_Invalid_Argument; + error = T1_Err_Invalid_Argument; if (blend) { master->num_axis = blend->num_axis; @@ -175,15 +175,15 @@ } - LOCAL_FUNC FT_Error T1_Set_MM_Blend( T1_Face face, + LOCAL_FUNC T1_Error T1_Set_MM_Blend( T1_Face face, T1_UInt num_coords, T1_Fixed* coords ) { T1_Blend* blend = face->blend; - FT_Error error; + T1_Error error; T1_UInt n, m; - error = FT_Err_Invalid_Argument; + error = T1_Err_Invalid_Argument; if (blend && blend->num_axis == num_coords) { /* recompute the weight vector from the blend coordinates */ @@ -213,15 +213,15 @@ } - LOCAL_FUNC FT_Error T1_Set_MM_Design( T1_Face face, + LOCAL_FUNC T1_Error T1_Set_MM_Design( T1_Face face, T1_UInt num_coords, T1_Long* coords ) { T1_Blend* blend = face->blend; - FT_Error error; + T1_Error error; T1_UInt n, p; - error = FT_Err_Invalid_Argument; + error = T1_Err_Invalid_Argument; if (blend && blend->num_axis == num_coords) { /* compute the blend coordinates through the blend design map */ @@ -328,7 +328,7 @@ { T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; T1_Int n, num_axis; - FT_Error error = 0; + T1_Error error = 0; T1_Blend* blend; FT_Memory memory; @@ -338,7 +338,7 @@ { FT_ERROR(( "T1.parse_blend_axis_types: incorrect number of axis: %d\n", num_axis )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -363,7 +363,7 @@ len = token->limit - token->start; if (len <= 0) { - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -387,7 +387,7 @@ T1_Int num_axis; T1_Parser* parser = &loader->parser; - FT_Error error = 0; + T1_Error error = 0; T1_Blend* blend; /* get the array of design tokens - compute number of designs */ @@ -396,7 +396,7 @@ { FT_ERROR(( "T1.design positions: incorrect number of designs: %d\n", num_designs )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -428,7 +428,7 @@ else if (n_axis != num_axis) { FT_ERROR(( "T1.design_positions: incorrect table\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -452,7 +452,7 @@ static void parse_blend_design_map( T1_Face face, T1_Loader* loader ) { - FT_Error error = 0; + T1_Error error = 0; T1_Parser* parser = &loader->parser; T1_Blend* blend; T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; @@ -466,7 +466,7 @@ { FT_ERROR(( "T1.design map: incorrect number of axis: %d\n", num_axis )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } old_cursor = parser->cursor; @@ -500,7 +500,7 @@ if (num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS) { FT_ERROR(( "T1.design map: incorrect table\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -525,7 +525,7 @@ static void parse_weight_vector( T1_Face face, T1_Loader* loader ) { - FT_Error error = 0; + T1_Error error = 0; T1_Parser* parser = &loader->parser; T1_Blend* blend = face->blend; T1_Token_Rec master; @@ -536,7 +536,7 @@ if (!blend || blend->num_designs == 0) { FT_ERROR(( "t1.weight_vector: too early !!\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -544,7 +544,7 @@ if (master.type != t1_token_array) { FT_ERROR(( "t1.weight_vector: incorrect format !!\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } @@ -839,7 +839,7 @@ } FT_ERROR(( "type1.read_binary_data: invalid size field\n" )); - parser->error = FT_Err_Invalid_File_Format; + parser->error = T1_Err_Invalid_File_Format; return 0; } @@ -852,7 +852,7 @@ void parse_font_name( T1_Face face, T1_Loader* loader ) { T1_Parser* parser = &loader->parser; - FT_Error error; + T1_Error error; FT_Memory memory = parser->memory; T1_Int len; T1_Byte* cur; @@ -926,7 +926,7 @@ if (cur >= limit) { FT_ERROR(( "type1.parse_encoding: out of bounds !!\n" )); - parser->error = FT_Err_Invalid_File_Format; + parser->error = T1_Err_Invalid_File_Format; return; } } @@ -939,7 +939,7 @@ T1_Int count, n; T1_Table* char_table = &loader->encoding_table; FT_Memory memory = parser->memory; - FT_Error error; + T1_Error error; /* read the number of entries in the encoding, should be 256 */ count = T1_ToInt( parser ); @@ -1042,7 +1042,7 @@ else { FT_ERROR(( "type1.parse_encoding: invalid token !!\n" )); - parser->error = FT_Err_Invalid_File_Format; + parser->error = T1_Err_Invalid_File_Format; } } } @@ -1054,7 +1054,7 @@ T1_Parser* parser = &loader->parser; T1_Table* table = &loader->subrs; FT_Memory memory = parser->memory; - FT_Error error; + T1_Error error; T1_Int n; loader->num_subrs = T1_ToInt( parser ); @@ -1100,7 +1100,7 @@ T1_Table* code_table = &loader->charstrings; T1_Table* name_table = &loader->glyph_names; FT_Memory memory = parser->memory; - FT_Error error; + T1_Error error; T1_Byte* cur; T1_Byte* limit = parser->limit; @@ -1352,7 +1352,7 @@ T1_Loader loader; T1_Parser* parser; T1_Font* type1 = &face->type1; - FT_Error error; + T1_Error error; t1_init_loader( &loader, face ); @@ -1379,13 +1379,13 @@ if ( !loader.subrs.init ) { FT_ERROR(( "T1.Open_Face: no subrs array in face !!\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; } if ( !loader.charstrings.init ) { FT_ERROR(( "T1.Open_Face: no charstrings array in face !!\n" )); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; } loader.subrs.init = 0; diff --git a/src/type1z/t1load.h b/src/type1z/t1load.h index 853559731..98a1359ae 100644 --- a/src/type1z/t1load.h +++ b/src/type1z/t1load.h @@ -19,6 +19,8 @@ #define T1LOAD_H #include +#include +#include #include #ifdef __cplusplus @@ -48,19 +50,21 @@ #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT LOCAL_DEF - FT_Error T1_Get_Multi_Master( T1_Face face, - FT_Multi_Master* master ); - - LOCAL_DEF FT_Error T1_Set_MM_Blend( T1_Face face, - T1_UInt num_coords, - T1_Fixed* coords ); - - LOCAL_DEF FT_Error T1_Set_MM_Design( T1_Face face, - T1_UInt num_coords, - T1_Long* coords ); + T1_Error T1_Get_Multi_Master( T1_Face face, + FT_Multi_Master* master ); LOCAL_DEF - void T1_Done_Blend( T1_Face face ); + T1_Error T1_Set_MM_Blend( T1_Face face, + T1_UInt num_coords, + T1_Fixed* coords ); + + LOCAL_DEF + T1_Error T1_Set_MM_Design( T1_Face face, + T1_UInt num_coords, + T1_Long* coords ); + + LOCAL_DEF + void T1_Done_Blend( T1_Face face ); #endif #ifdef __cplusplus diff --git a/src/type1z/t1objs.c b/src/type1z/t1objs.c index 84dd55b77..a711d2fd1 100644 --- a/src/type1z/t1objs.c +++ b/src/type1z/t1objs.c @@ -106,7 +106,7 @@ FT_Size_Metrics* metrics = &size->root.metrics; if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) - return FT_Err_Invalid_Argument; + return T1_Err_Invalid_Argument; /* Compute root ascender, descender, test height, and max_advance */ metrics->ascender = ( FT_MulFix( face->root.ascender, diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c index c2fc52c0d..7b05a935c 100644 --- a/src/type1z/t1parse.c +++ b/src/type1z/t1parse.c @@ -629,7 +629,7 @@ T1_Int len = 0; T1_Int count; T1_String* result; - FT_Error error; + T1_Error error; /* XXX : some stupid fonts have a "Notice" or "Copyright" string */ /* that simply doesn't begin with an opening parenthesis, even */ @@ -913,9 +913,9 @@ static - FT_Error read_pfb_tag( FT_Stream stream, T1_UShort *tag, T1_Long* size ) + T1_Error read_pfb_tag( FT_Stream stream, T1_UShort *tag, T1_Long* size ) { - FT_Error error; + T1_Error error; if (READ_UShort(*tag)) goto Exit; if (*tag == 0x8001 || *tag == 0x8002) @@ -942,7 +942,7 @@ FT_Stream stream, FT_Memory memory ) { - FT_Error error; + T1_Error error; T1_UShort tag; T1_Long size; @@ -1095,7 +1095,7 @@ { FT_Stream stream = parser->stream; FT_Memory memory = parser->memory; - FT_Error error = 0; + T1_Error error = 0; T1_Long size; if (parser->in_pfb) @@ -1182,7 +1182,7 @@ if (cur >= limit) { FT_ERROR(("T1.Open_Private: could not find 'eexec' keyword\n")); - error = FT_Err_Invalid_File_Format; + error = T1_Err_Invalid_File_Format; goto Exit; } } diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h index da80211a6..9ef51fc59 100644 --- a/src/type1z/t1parse.h +++ b/src/type1z/t1parse.h @@ -300,6 +300,12 @@ void T1_ToToken( T1_Parser* parser, T1_Token_Rec* token ); + LOCAL_FUNC + void T1_ToTokenArray( T1_Parser* parser, + T1_Token_Rec* tokens, + T1_UInt max_tokens, + T1_Int* pnum_tokens ); + LOCAL_DEF T1_Error T1_Load_Field( T1_Parser* parser, const T1_Field_Rec* field,