From efce08d67c1c2a8bf0d0d58463e754c746433d23 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 11 May 2000 18:23:52 +0000 Subject: [PATCH] major re-organisation of the FreeType 2 directory hierarchy --- CHANGES | 29 +- config/freetype.mk | 226 --------- config/modules.mk | 1 - demos/Makefile | 4 +- demos/src/compos.c | 4 +- demos/src/ftlint.c | 4 +- demos/src/ftrast.c | 6 +- demos/src/ftrast.h | 2 +- demos/src/ftrast2.c | 462 +++--------------- demos/src/ftrast2.h | 2 +- demos/src/ftstring.c | 6 +- demos/src/fttimer.c | 5 +- demos/src/ftview.c | 16 +- demos/src/ttdebug.c | 2 +- include/freetype/config/ftconfig.h | 186 +++++++ .../freetype/config}/ftmodule.h | 0 .../freetype/config}/ftoption.h | 0 include/{ => freetype}/freetype.h | 6 +- include/{ => freetype}/ftbbox.h | 2 +- include/freetype/fterrors.h | 115 +++++ include/{ => freetype}/ftglyph.h | 2 +- include/{ => freetype}/ftgrays.h | 2 +- include/{ => freetype}/ftimage.h | 0 include/{ => freetype}/ftraster.h | 2 +- include/{ => freetype}/ftsystem.h | 0 .../freetype/internal}/autohint.h | 2 +- .../freetype/internal}/ftcalc.h | 4 +- .../freetype/internal}/ftdebug.h | 2 +- .../freetype/internal}/ftdriver.h | 2 +- .../freetype/internal}/ftextend.h | 2 +- .../freetype/internal}/ftlist.h | 2 +- .../freetype/internal}/ftobjs.h | 15 +- .../freetype/internal}/ftoutln.h | 2 +- .../freetype/internal}/ftstream.h | 2 +- .../freetype/internal}/psnames.h | 2 +- .../freetype/internal}/sfnt.h | 4 +- .../freetype/internal}/t1types.h | 4 +- .../freetype/internal}/tterrors.h | 0 .../freetype/internal}/tttypes.h | 2 +- include/{ => freetype}/t1tables.h | 75 ++- include/{ => freetype}/ttnameid.h | 0 include/{ => freetype}/tttables.h | 2 +- {src/shared => include/freetype}/tttags.h | 2 +- include/fterrors.h | 82 ---- src/base/ftcalc.c | 6 +- src/base/ftdebug.c | 2 +- src/base/ftextend.c | 2 +- src/base/ftglyph.c | 4 +- src/base/ftgrays.c | 6 +- src/base/ftinit.c | 12 +- src/base/ftlist.c | 6 +- src/base/ftobjs.c | 10 +- src/base/ftoutln.c | 9 +- src/base/ftraster.c | 11 +- src/base/ftstream.c | 4 +- src/base/ftsystem.c | 4 +- src/base/rules.mk | 14 +- src/macfond/fonddrvr.c | 4 +- src/oldapi/ttapi.c | 18 +- src/psnames/psdriver.c | 4 +- src/psnames/psdriver.h | 4 +- src/sfnt/sfdriver.c | 2 +- src/sfnt/sfdriver.h | 3 +- src/sfnt/ttcmap.c | 4 +- src/sfnt/ttcmap.h | 2 +- src/sfnt/ttload.c | 7 +- src/sfnt/ttload.h | 4 +- src/sfnt/ttpost.c | 8 +- src/sfnt/ttpost.h | 4 +- src/sfnt/ttsbit.c | 6 +- src/shared/readme.txt | 6 - src/shared/rules.mk | 27 - src/truetype/ttdriver.c | 8 +- src/truetype/ttdriver.h | 5 +- src/truetype/tterrors.h | 4 +- src/truetype/ttgload.c | 13 +- src/truetype/ttinterp.c | 7 +- src/truetype/ttobjs.c | 15 +- src/truetype/ttobjs.h | 4 +- src/truetype/ttpload.c | 8 +- src/truetype/ttpload.h | 2 +- src/type1/t1afm.c | 6 +- src/type1/t1afm.h | 2 +- src/type1/t1driver.c | 6 +- src/type1/t1gload.c | 4 +- src/type1/t1hinter.c | 2 +- src/type1/t1load.c | 6 +- src/type1/t1load.h | 2 +- src/type1/t1objs.c | 6 +- src/type1/t1objs.h | 6 +- src/type1/t1parse.c | 4 +- src/type1/t1parse.h | 2 +- src/type1/t1tokens.c | 4 +- src/type1z/t1afm.c | 4 +- src/type1z/t1afm.h | 2 +- src/type1z/t1driver.c | 6 +- src/type1z/t1errors.h | 2 +- src/type1z/t1gload.c | 4 +- src/type1z/t1load.c | 6 +- src/type1z/t1load.h | 2 +- src/type1z/t1objs.c | 6 +- src/type1z/t1objs.h | 6 +- src/type1z/t1parse.c | 8 +- src/type1z/t1parse.h | 2 +- 104 files changed, 683 insertions(+), 964 deletions(-) delete mode 100644 config/freetype.mk create mode 100644 include/freetype/config/ftconfig.h rename {config => include/freetype/config}/ftmodule.h (100%) rename {config => include/freetype/config}/ftoption.h (100%) rename include/{ => freetype}/freetype.h (99%) rename include/{ => freetype}/ftbbox.h (99%) create mode 100644 include/freetype/fterrors.h rename include/{ => freetype}/ftglyph.h (99%) rename include/{ => freetype}/ftgrays.h (96%) rename include/{ => freetype}/ftimage.h (100%) rename include/{ => freetype}/ftraster.h (98%) rename include/{ => freetype}/ftsystem.h (100%) rename {src/shared => include/freetype/internal}/autohint.h (99%) rename {src/base => include/freetype/internal}/ftcalc.h (97%) rename {src/base => include/freetype/internal}/ftdebug.h (98%) rename {src/base => include/freetype/internal}/ftdriver.h (99%) rename {src/base => include/freetype/internal}/ftextend.h (99%) rename {src/base => include/freetype/internal}/ftlist.h (99%) rename {src/base => include/freetype/internal}/ftobjs.h (98%) rename {src/base => include/freetype/internal}/ftoutln.h (61%) rename {src/base => include/freetype/internal}/ftstream.h (99%) rename {src/shared => include/freetype/internal}/psnames.h (99%) rename {src/shared => include/freetype/internal}/sfnt.h (99%) rename {src/shared => include/freetype/internal}/t1types.h (99%) rename {src/shared => include/freetype/internal}/tterrors.h (100%) rename {src/shared => include/freetype/internal}/tttypes.h (99%) rename include/{ => freetype}/t1tables.h (72%) rename include/{ => freetype}/ttnameid.h (100%) rename include/{ => freetype}/tttables.h (99%) rename {src/shared => include/freetype}/tttags.h (98%) delete mode 100644 include/fterrors.h delete mode 100644 src/shared/readme.txt delete mode 100644 src/shared/rules.mk diff --git a/CHANGES b/CHANGES index 5f36ca9f1..8bd9900e5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,31 @@ -LASTEST CHANGES - 14-apr-2000 +LATEST CHANGES - + + + + - updated the structure of FT_Outline_Funcs in order to allow + direct coordinate scaling within the outline decomposition routine + (this is important for virtual "on" points with TrueType outlines) + + updates to the rasters to support this.. + + - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order + to support version 2 of the table (see OpenType 1.2 spec) + + - created "include/tttables.h" and "include/t1tables.h" to allow + client applications to access some of the SFNT and T1 tables of a + face with a procedural interface (see FT_Get_Sfnt_Table()) + + updates to internal source files to reflect the change.. + + - some cleanups in the source code to get rid of warnings when compiling + with the "-Wall -W -ansi -pedantic" options in gcc. + + - debugged and moved the smooth renderer to "src/base/ftgrays.c" and + its header to "include/ftgrays.h" + + - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with + up to 80 sub-glyphs !! Thanks to Werner + +================================================================================ +OLD CHANGES - 14-apr-2000 - fixed a bug in the TrueType glyph loader that prevented the correct loading of some CJK glyphs in mingli.ttf diff --git a/config/freetype.mk b/config/freetype.mk deleted file mode 100644 index 84f0e7775..000000000 --- a/config/freetype.mk +++ /dev/null @@ -1,226 +0,0 @@ -# -# FreeType 2 library sub-Makefile -# - - -# 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. - - -# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY -# OTHER MAKEFILES. - - -# The targets `objects' and `library' are defined at the end of this -# Makefile when all rules have been included. -# -.PHONY: build_freetype objects library - -# default target -- build objects and library -# -build_freetype: objects library - -# `multi' target -- build multiple objects and library -# -multi: objects library - - -# The FreeType source directory. -# -SRC := $(TOP)$(SEP)src - - -# The directory where the base layer components are placed. By default, -# this is `freetype/src/base'. -# -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). -# -# -SRC_ := $(SRC)$(SEP) -BASE_ := $(BASE_DIR)$(SEP) -OBJ_ := $(OBJ_DIR)$(SEP) -LIB_ := $(LIB_DIR)$(SEP) -PUBLIC_ := $(TOP)$(SEP)include$(SEP) -CONFIG_ := $(TOP)$(SEP)config$(SEP) - - -# The name of the final library file. -# -FT_LIBRARY := $(LIB_)$(LIBRARY).$A - - -# include paths -# -# IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed -# in front of the include list. Porters are then able to -# put their own version of some of the FreeType components -# in the `freetype/config/' directory, as these -# files will override the default sources. -# -INCLUDES := $(BUILD) $(TOP)$(SEP)config $(TOP)$(SEP)include $(INCLUDES) - -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, -# debug/optimization/warning flags + ansi compliance if needed. -# -FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS) -FT_CC = $(CC) $(FT_CFLAGS) -FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS) - - -# include the `modules' rules file -# -include $(CONFIG_)modules.mk - - -# Free the lists of driver objects. -# -COMPONENTS_LIST := -DRIVERS_LIST := -OBJECTS_LIST := - -# 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. -# -ifndef FTSYS_SRC - FTSYS_SRC = $(BASE_)ftsystem.c -endif -FTSYS_OBJ = $(OBJ_)ftsystem.$O - -OBJECTS_LIST += $(FTSYS_OBJ) - -$(FTSYS_OBJ): $(FTSYS_SRC) $(BASE_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 -FTDEBUG_OBJ = $(OBJ_)ftdebug.$O - -OBJECTS_LIST += $(FTDEBUG_OBJ) - -$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(BASE_H) - $(FT_COMPILE) $T$@ $< - - -# Define $(PUBLIC_H) as the list of all public header files located in -# `$(TOP)/include'. -# -PUBLIC_H := $(wildcard $(PUBLIC_)*.h) - - -# Include all rule files from FreeType components. -# -include $(wildcard $(SRC)/*/rules.mk) - - -# FTInit file -# -# 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 -# which contain additional include paths and macros used to compile the -# single `ftinit.c' source. -# -FTINIT_SRC := $(BASE_)ftinit.c -FTINIT_OBJ := $(OBJ_)ftinit.$O - -OBJECTS_LIST += $(FTINIT_OBJ) - -$(FTINIT_OBJ): $(FTINIT_SRC) $(BASE_H) $(FT_MODULE_LIST) - $(FT_COMPILE) $T$@ $< - - -# All FreeType library objects -# -# By default, we include the base layer extensions. These could be -# omitted on builds which do not want them. -# -OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) -OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) - - -# The target `multi' on the Make command line indicates that we want to -# compile each source file independently. -# -# Otherwise, each module/driver is compiled in a single object file through -# source file inclusion (see `src/base/ftbase.c' or -# `src/truetype/truetype.c' for examples). -# -BASE_OBJECTS := $(OBJECTS_LIST) - -ifneq ($(findstring multi,$(MAKECMDGOALS)),) - OBJECTS_LIST += $(OBJ_M) -else - OBJECTS_LIST += $(OBJ_S) -endif - -objects: $(OBJECTS_LIST) - -library: $(FT_LIBRARY) - -.c.$O: - $(FT_COMPILE) $T$@ $< - - -# Standard cleaning and distclean rules. These are not accepted -# on all systems though. -# -clean_freetype_std: - -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) - -distclean_freetype_std: clean_freetype_std - -$(DELETE) $(FT_LIBRARY) - -$(DELETE) *.orig *~ core *.core - -# The Dos command shell does not support very long list of arguments, so -# we are stuck with wildcards. -# -clean_freetype_dos: - -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O 2> nul - -distclean_freetype_dos: clean_freetype_dos - -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul - -# Remove configuration file (used for distclean). -# -remove_config_mk: - -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(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. -# -clean: clean_freetype -distclean: distclean_freetype remove_config_mk - -# EOF diff --git a/config/modules.mk b/config/modules.mk index 897834273..876b33e0b 100644 --- a/config/modules.mk +++ b/config/modules.mk @@ -2,7 +2,6 @@ # FreeType 2 modules sub-Makefile # - # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # diff --git a/demos/Makefile b/demos/Makefile index 3a69279de..9c090acb9 100644 --- a/demos/Makefile +++ b/demos/Makefile @@ -267,8 +267,8 @@ else $(LINK) - $(BIN_)ftview$E: $(OBJ_)ftview.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(OBJ_)ftrast2.$O - $(GRAPH_LINK) $(OBJ_)ftrast2.$O + $(BIN_)ftview$E: $(OBJ_)ftview.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(OBJ_)ftrast2.$O $(OBJ_)ftrast.$O + $(GRAPH_LINK) $(OBJ_)ftrast2.$O $(OBJ_)ftrast.$O $(BIN_)ftstring$E: $(OBJ_)ftstring.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(GRAPH_LINK) diff --git a/demos/src/compos.c b/demos/src/compos.c index d7a77c3b3..2ae0b0f20 100644 --- a/demos/src/compos.c +++ b/demos/src/compos.c @@ -13,9 +13,7 @@ /* */ /****************************************************************************/ -#include "freetype.h" -#include "ftobjs.h" -#include "ftdriver.h" +#include #include #include diff --git a/demos/src/ftlint.c b/demos/src/ftlint.c index 3a5ff0e97..5066906d6 100644 --- a/demos/src/ftlint.c +++ b/demos/src/ftlint.c @@ -13,9 +13,7 @@ /* */ /****************************************************************************/ -#include "freetype.h" -#include "ftobjs.h" -#include "ftdriver.h" +#include #include #include diff --git a/demos/src/ftrast.c b/demos/src/ftrast.c index 6f86a7230..267261de6 100644 --- a/demos/src/ftrast.c +++ b/demos/src/ftrast.c @@ -21,7 +21,7 @@ ******************************************************************/ #include "ftrast.h" -#include /* for FT_MulDiv only */ +#include /* for FT_MulDiv only */ /*************************************************************************/ /* */ @@ -107,7 +107,7 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_raster -#include +#include /* The default render pool size */ @@ -2941,7 +2941,7 @@ Scan_DropOuts : #else -#include +#include static int ft_black_new( FT_Memory memory, TRaster_Instance* *araster ) diff --git a/demos/src/ftrast.h b/demos/src/ftrast.h index c08dee363..25db0dcd8 100644 --- a/demos/src/ftrast.h +++ b/demos/src/ftrast.h @@ -1,7 +1,7 @@ #ifndef FTRASTER_H #define FTRASTER_H -#include +#include extern FT_Raster_Funcs ft_black_raster; diff --git a/demos/src/ftrast2.c b/demos/src/ftrast2.c index 67393f072..1d235667f 100644 --- a/demos/src/ftrast2.c +++ b/demos/src/ftrast2.c @@ -37,14 +37,35 @@ * ******************************************************************/ -#include "ftraster.h" -#include /* for FT_Outline_Decompose */ +#include "ftrast2.h" +#include /* for FT_Outline_Decompose */ #ifndef EXPORT_FUNC #define EXPORT_FUNC /* nothing */ #endif +/**************************************************************************/ +/* */ +/* We need a 32-bit unsigned word for our optimized 2x2 filter.. The */ +/* following uses the ANSI header file to compute exactly */ +/* wether to use unsigned int or unsigned long */ +/* */ +#include + +/* The number of bytes in an `int' type. */ +#if UINT_MAX == 0xFFFFFFFF +typedef unsigned int Word32; +typedef int Int32; +#elif ULONG_MAX == 0xFFFFFFFF +typedef unsigned long Word32; +typedef long Int32; +#else +#error "could not find a 32-bit word on this machine !!" +#endif + + + #ifndef _xxFREETYPE_ /**************************************************************************/ @@ -98,7 +119,7 @@ /* anti-aliasing mode.. Ignored if FT_RASTER_OPTION_ANTI_ALIAS isn't */ /* defined.. */ /* */ -#define FT_RASTER_ANTI_ALIAS_17 +#undef FT_RASTER_ANTI_ALIAS_17 /**************************************************************************/ /* */ @@ -250,7 +271,7 @@ /* or high). These are ideals in order to subdivise bezier arcs in halves */ /* though simple additions and shifts. */ - typedef long TPos, *PPos; + typedef Int32 TPos, *PPos; /* The type of a scanline position/coordinate within a map */ @@ -472,7 +493,7 @@ long grays[20]; /* Palette of gray levels used for render */ - int gray_width; /* length in bytes of the onochrome */ + int gray_width; /* length in bytes of the monochrome */ /* intermediate scanline of gray_lines. */ /* Each gray pixel takes 2 or 4 bits long */ @@ -1070,367 +1091,6 @@ #endif - - -#ifdef FT_RASTER_CONIC_BEZIERS -/****************************************************************************/ -/* */ -/* Conic_Up */ -/* */ -/* */ -/* Computes the scan-line intersections of an ascending second-order */ -/* Bezier arc and stores them in the render pool. The arc is taken */ -/* from the top of the stack.. */ -/* */ -/* */ -/* miny :: minimum vertical grid coordinate */ -/* maxy :: maximum vertical grid coordinate */ -/* */ -/* */ -/* SUCCESS or FAILURE */ -/* */ -/****************************************************************************/ - - static - TBool Conic_Up( RAS_ARGS TPos miny, TPos maxy ) - { - TPos y1, y2, e, e2, e0; - int f1; - - TPoint* arc; - TPoint* start_arc; - - PPos top; - - - arc = ras.arc; - y1 = arc[2].y; - y2 = arc[0].y; - top = ras.cursor; - - if ( y2 < miny || y1 > maxy ) - goto Fin; - - e2 = FLOOR( y2 ); - - if ( e2 > maxy ) - e2 = maxy; - - e0 = miny; - - if ( y1 < miny ) - e = miny; - else - { - e = CEILING( y1 ); - f1 = FRAC( y1 ); - e0 = e; - - if ( f1 == 0 ) - { - if ( ras.joint ) - { - top--; - ras.joint = FALSE; - } - - *top++ = arc[2].x; - - DEBUG_PSET; - - e += ras.precision; - } - } - - if ( ras.fresh ) - { - ras.cur_prof->start = TRUNC( e0 ); - ras.fresh = FALSE; - } - - if ( e2 < e ) - goto Fin; - - if ( ( top+TRUNC(e2-e)+1 ) >= ras.pool_limit ) - { - ras.cursor = top; - ras.error = ErrRaster_Overflow; - return FAILURE; - } - - start_arc = arc; - - while ( arc >= start_arc && e <= e2 ) - { - ras.joint = FALSE; - - y2 = arc[0].y; - - if ( y2 > e ) - { - y1 = arc[2].y; - if ( y2 - y1 >= ras.precision_step ) - { - Split_Conic( arc ); - arc += 2; - } - else - { - *top++ = arc[2].x + - FMulDiv( arc[0].x-arc[2].x, - e - y1, - y2 - y1 ); - DEBUG_PSET; - - arc -= 2; - e += ras.precision; - } - } - else - { - if ( y2 == e ) - { - ras.joint = TRUE; - *top++ = arc[0].x; - - DEBUG_PSET; - - e += ras.precision; - } - arc -= 2; - } - } - - Fin: - ras.cursor = top; - ras.arc -= 2; - return SUCCESS; - } - - -/****************************************************************************/ -/* */ -/* Conic_Down */ -/* */ -/* */ -/* Computes the scan-line intersections of a descending second-order */ -/* Bezier arc and stores them in the render pool. The arc is taken */ -/* from the top of the stack.. */ -/* */ -/* */ -/* miny :: minimum vertical grid coordinate */ -/* maxy :: maximum vertical grid coordinate */ -/* */ -/* */ -/* SUCCESS or FAILURE */ -/* */ -/****************************************************************************/ - - static - TBool Conic_Down( RAS_ARGS TPos miny, TPos maxy ) - { - TPoint* arc = ras.arc; - TBool result, fresh; - - - arc[0].y = -arc[0].y; - arc[1].y = -arc[1].y; - arc[2].y = -arc[2].y; - - fresh = ras.fresh; - - result = Conic_Up( RAS_VARS -maxy, -miny ); - - if ( fresh && !ras.fresh ) - ras.cur_prof->start = -ras.cur_prof->start; - - arc[0].y = -arc[0].y; - return result; - } - -#endif /* FT_RASTER_CONIC_BEZIERS */ - - - -#ifdef FT_RASTER_CUBIC_BEZIERS -/****************************************************************************/ -/* */ -/* Cubic_Up */ -/* */ -/* */ -/* Computes the scan-line intersections of an ascending third-order */ -/* bezier arc and stores them in the render pool */ -/* */ -/* */ -/* miny :: minimum vertical grid coordinate */ -/* maxy :: maximum vertical grid coordinate */ -/* */ -/* */ -/* SUCCESS or FAILURE */ -/* */ -/****************************************************************************/ - static - TBool Cubic_Up( RAS_ARGS TPos miny, TPos maxy ) - { - TPos y1, y2, e, e2, e0; - int f1; - - TPoint* arc; - TPoint* start_arc; - - TPos* top; - - - arc = ras.arc; - y1 = arc[3].y; - y2 = arc[0].y; - top = ras.cursor; - - if ( y2 < miny || y1 > maxy ) - goto Fin; - - e2 = FLOOR( y2 ); - - if ( e2 > maxy ) - e2 = maxy; - - e0 = miny; - - if ( y1 < miny ) - e = miny; - else - { - e = CEILING( y1 ); - f1 = FRAC( y1 ); - e0 = e; - - if ( f1 == 0 ) - { - if ( ras.joint ) - { - top--; - ras.joint = FALSE; - } - - *top++ = arc[3].x; - - DEBUG_PSET; - - e += ras.precision; - } - } - - if ( ras.fresh ) - { - ras.cur_prof->start = TRUNC( e0 ); - ras.fresh = FALSE; - } - - if ( e2 < e ) - goto Fin; - - if ( ( top+TRUNC(e2-e)+1 ) >= ras.pool_limit ) - { - ras.cursor = top; - ras.error = ErrRaster_Overflow; - return FAILURE; - } - - start_arc = arc; - - while ( arc >= start_arc && e <= e2 ) - { - ras.joint = FALSE; - - y2 = arc[0].y; - - if ( y2 > e ) - { - y1 = arc[3].y; - if ( y2 - y1 >= ras.precision_step ) - { - Split_Cubic( arc ); - arc += 3; - } - else - { - *top++ = arc[3].x + - FMulDiv( arc[0].x-arc[3].x, - e - y1, - y2 - y1 ); - DEBUG_PSET; - - arc -= 3; - e += ras.precision; - } - } - else - { - if ( y2 == e ) - { - ras.joint = TRUE; - *top++ = arc[0].x; - - DEBUG_PSET; - - e += ras.precision; - } - arc -= 3; - } - } - - Fin: - ras.cursor = top; - ras.arc -= 3; - return SUCCESS; - } - - -/****************************************************************************/ -/* */ -/* Cubic_Down */ -/* */ -/* */ -/* Computes the scan-line intersections of a descending third-order */ -/* bezier arc and stores them in the render pool */ -/* */ -/* */ -/* miny :: minimum vertical grid coordinate */ -/* maxy :: maximum vertical grid coordinate */ -/* */ -/* */ -/* SUCCESS or FAILURE */ -/* */ -/****************************************************************************/ - static - TBool Cubic_Down( RAS_ARGS TPos miny, TPos maxy ) - { - TPoint* arc = ras.arc; - TBool result, fresh; - - - arc[0].y = -arc[0].y; - arc[1].y = -arc[1].y; - arc[2].y = -arc[2].y; - arc[3].y = -arc[3].y; - - fresh = ras.fresh; - - result = Cubic_Up( RAS_VARS -maxy, -miny ); - - if ( fresh && !ras.fresh ) - ras.cur_prof->start = -ras.cur_prof->start; - - arc[0].y = -arc[0].y; - return result; - } - -#endif /* FT_RASTER_CUBIC_BEZIERS */ - - - - - /* A function type describing the functions used to split bezier arcs */ typedef void (*TSplitter)( TPoint* base ); @@ -2756,6 +2416,21 @@ /* */ /***********************************************************************/ + static + const Word32 LMask5[17] = + { 0xF0F0F0F0, 0xF0F0F070, 0xF0F0F030, 0xF0F0F010, + 0xF0F0F000, 0xF0F07000, 0xF0F03000, 0xF0F01000, + 0xF0F00000, 0xF0700000, 0xF0300000, 0xF0100000, + 0xF0000000, 0x70000000, 0x30000000, 0x10000000, + 0x00000000 }; + + static + const Word32 LPos5[17] = + { 0x80000000, 0x40000000, 0x20000000, 0x10000000, + 0x00800000, 0x00400000, 0x00200000, 0x00100000, + 0x00008000, 0x00004000, 0x00002000, 0x00001000, + 0x00000080, 0x00000040, 0x00000020, 0x00000010 }; + static void Vertical_Gray5_Sweep_Init( RAS_ARGS int* min, int* max ) { long pitch; @@ -2775,29 +2450,12 @@ ras.gray_max_x = -32000; } - static void Vertical_Gray5_Sweep_Span( RAS_ARGS TScan y, TPos x1, TPos x2 ) { - static - const unsigned int LMask[17] = -#ifdef FT_RASTER_LITTLE_ENDIAN - { 0xF0F0F0F0, 0xF0F0F070, 0xF0F0F030, 0xF0F0F010, - 0xF0F0F000, 0xF0F07000, 0xF0F03000, 0xF0F01000, - 0xF0F00000, 0xF0700000, 0xF0300000, 0xF0100000, - 0xF0000000, 0x70000000, 0x30000000, 0x10000000, - 0x00000000 }; -#else - { 0xF0F0F0F0, 0x70F0F0F0, 0x30F0F0F0, 0x10F0F0F0, - 0x00F0F0F0, 0x0070F0F0, 0x0030F0F0, 0x0010F0F0, - 0x0000F0F0, 0x000070F0, 0x000030F0, 0x000010F0, - 0x000000F0, 0x00000070, 0x00000030, 0x00000010, - 0x00000000 }; -#endif - - TPos e1, e2; - int c1, c2; + TPos e1, e2; + int c1, c2; TByte* target; unsigned int f1, f2; @@ -2823,9 +2481,9 @@ c1 = e1 >> 4; c2 = e2 >> 4; - fill = LMask[0]; - f1 = LMask[ e1 & 15 ]; - f2 = fill ^ LMask[ 1+(e2 & 15) ]; + fill = LMask5[0]; + f1 = LMask5[ e1 & 15 ]; + f2 = fill ^ LMask5[ 1+(e2 & 15) ]; f1 >>= shift; f2 >>= shift; @@ -2839,7 +2497,7 @@ if (c2 > 0) { - int* slice = (int*)target; + Word32* slice = (Word32*)target; slice[0] |= f1; c2--; @@ -2851,7 +2509,7 @@ slice[1] |= f2; } else - ((int*)target)[0] |= ( f1 & f2 ); + ((Word32*)target)[0] |= ( f1 & f2 ); } } @@ -2860,15 +2518,14 @@ int Vertical_Gray5_Test_Pixel( RAS_ARGS int y, int x ) { - int c1 = x >> 2; - int f1 = x & 3; - int mask = (0x80 >> f1) >> ((y & 1)*4); + int c1 = x >> 4; + Word32 mask = LPos5[ x & 15 ] >> ((y & 1)*4); (void)y; return ( x >= 0 && x < ras.bit_width && - ras.bit_buffer[c1] & mask ); + ((Word32*)ras.bit_buffer + c1)[0] & mask ); } @@ -2882,14 +2539,13 @@ if ( x >= 0 && x < ras.bit_width ) { - int c1 = x >> 2; - int f1 = x & 3; - int mask = (0x80 >> f1) >> ((y & 1)*4); + int c1 = x >> 4; + Word32 mask = LPos5[ x & 15 ] >> ((y & 1)*4); - if ( ras.gray_min_x > c1/4 ) ras.gray_min_x = c1/4; - if ( ras.gray_max_x < c1/4 ) ras.gray_max_x = c1/4; + if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1; + if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1; - ras.bit_buffer[c1] |= mask; + ((Word32*)ras.bit_buffer + c1)[0] |= mask; } } @@ -3886,6 +3542,7 @@ Scan_DropOuts : static int Raster_Render8( FT_Raster raster ) { + UNUSED_RASTER return ErrRaster_Unimplemented; } @@ -4004,6 +3661,9 @@ void Reset_Palette_17( RAS_ARG ) int count, const char* palette ) { + (void)raster; + (void)palette; + switch (count) { #ifdef FT_RASTER_OPTION_ANTI_ALIAS @@ -4077,7 +3737,7 @@ void Reset_Palette_17( RAS_ARG ) #else -#include +#include static int ft_black2_new( FT_Memory memory, FT_Raster *araster ) diff --git a/demos/src/ftrast2.h b/demos/src/ftrast2.h index 8cd9adb45..a0b26b683 100644 --- a/demos/src/ftrast2.h +++ b/demos/src/ftrast2.h @@ -19,7 +19,7 @@ #ifndef FTRAST2_H #define FTRAST2_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/demos/src/ftstring.c b/demos/src/ftstring.c index cd232ad16..2888c6adc 100644 --- a/demos/src/ftstring.c +++ b/demos/src/ftstring.c @@ -10,8 +10,8 @@ /* */ /****************************************************************************/ -#include "freetype.h" -#include "ftglyph.h" +#include +#include #include "common.h" #include @@ -23,7 +23,7 @@ #include "graph.h" #include "grfont.h" -#include "ftgrays.h" +#include #define DIM_X 500 #define DIM_Y 400 diff --git a/demos/src/fttimer.c b/demos/src/fttimer.c index 3be261513..78a3ec0e1 100644 --- a/demos/src/fttimer.c +++ b/demos/src/fttimer.c @@ -19,8 +19,7 @@ /* */ /****************************************************************************/ -#include "freetype.h" -#include "ftoutln.h" +#include #include #include @@ -28,7 +27,7 @@ #include /* for clock() */ #include "graph.h" -#include "ftgrays.h" +#include /* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include */ /* to get the HZ macro which is the equivalent. */ diff --git a/demos/src/ftview.c b/demos/src/ftview.c index e0367b466..9e2a9b07c 100644 --- a/demos/src/ftview.c +++ b/demos/src/ftview.c @@ -15,8 +15,7 @@ /* */ /****************************************************************************/ -#include "freetype.h" -#include "ftoutln.h" +#include #include "common.h" #include @@ -27,7 +26,8 @@ #include "graph.h" #include "grfont.h" -#include "ftgrays.h" +#include +#include "ftrast.h" #include "ftrast2.h" #define DIM_X 500 @@ -60,9 +60,9 @@ $\243^\250*\265\371%!\247:/;.,?<>"; int ptsize; /* current point size */ int hinted = 1; /* is glyph hinting active ? */ - int antialias = 1; /* is anti-aliasing active ? */ + int antialias = 0; /* is anti-aliasing active ? */ int use_sbits = 1; /* do we use embedded bitmaps ? */ - int low_prec = 1; /* force low precision */ + int low_prec = 0; /* force low precision */ int Num; /* current first glyph index */ int res = 72; @@ -425,8 +425,10 @@ $\243^\250*\265\371%!\247:/;.,?<>"; error = 1; if ( !antialias) - error = FT_Set_Raster( library, &ft_black2_raster ); - + { + error = FT_Set_Raster( library, use_grays ? &ft_black2_raster + : &ft_black_raster ); + } else if ( use_grays && antialias ) error = FT_Set_Raster( library, &ft_grays_raster ); diff --git a/demos/src/ttdebug.c b/demos/src/ttdebug.c index 5239a82d7..c983013c1 100644 --- a/demos/src/ttdebug.c +++ b/demos/src/ttdebug.c @@ -26,7 +26,7 @@ #endif -#include "freetype.h" +#include #include "ttobjs.h" #include "ttdriver.h" #include "ttinterp.h" diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h new file mode 100644 index 000000000..7db5818ae --- /dev/null +++ b/include/freetype/config/ftconfig.h @@ -0,0 +1,186 @@ +/***************************************************************************/ +/* */ +/* ftconfig.h */ +/* */ +/* ANSI-specific configuration file (specification only). */ +/* */ +/* 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. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This header file contains a number of macro definitions that are used */ + /* by the rest of the engine. Most of the macros here are automatically */ + /* determined at compile time, and you should not need to change it to */ + /* port FreeType, except to compile the library with a non ANSI compiler */ + /* */ + /* Note however that if some specific modifications are needed, we */ + /* advise you to place a modified copy in your build directory. */ + /* */ + /* The build directory is usually "freetype/config/", and */ + /* contains system-specific files that are always included first when */ + /* building the library.. */ + /* */ + /* This ANSI version should stay in "freetype/config" */ + /* */ + /*************************************************************************/ + +#ifndef FTCONFIG_H +#define FTCONFIG_H + +/* Include the header file containing all developer build options */ +#include + + /*************************************************************************/ + /* */ + /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ + /* */ + /* These macros can be toggled to suit a specific system. The current */ + /* ones are defaults used to compile FreeType in an ANSI C environment */ + /* (16bit compilers are also supported). Copy this file to your own */ + /* `freetype/arch/' directory, and edit it to port the engine. */ + /* */ + /*************************************************************************/ + + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* We use values to know the sizes of the types. */ +#include + +/* The number of bytes in an `int' type. */ +#if UINT_MAX == 0xFFFFFFFF +#define SIZEOF_INT 4 +#elif UINT_MAX == 0xFFFF +#define SIZEOF_INT 2 +#elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF +#define SIZEOF_INT 8 +#else +#error "Unsupported number of bytes in `int' type!" +#endif + +/* The number of bytes in a `long' type. */ +#if ULONG_MAX == 0xFFFFFFFF +#define SIZEOF_LONG 4 +#elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF +#define SIZEOF_LONG 8 +#else +#error "Unsupported number of bytes in `long' type!" +#endif + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the header file. */ +#define HAVE_FCNTL_H 0 + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H 0 + + +/* Preferred alignment of data */ +#define FT_ALIGNMENT 8 + + + + /*************************************************************************/ + /* */ + /* AUTOMATIC CONFIGURATION MACROS */ + /* */ + /* These macros are computed from the ones defined above. Don't touch */ + /* their definition, unless you know precisely what you're doing. No */ + /* porter should need to mess with them. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* IntN types */ + /* */ + /* Used to guarantee the size of some specific integers. */ + /* */ + typedef signed short FT_Int16; + typedef unsigned short FT_Word16; + +#if SIZEOF_INT == 4 + + typedef signed int FT_Int32; + typedef unsigned int FT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long FT_Int32; + typedef unsigned long FT_Word32; + +#else +#error "no 32bit type found - please check your configuration files" +#endif + +#if SIZEOF_LONG == 8 + + /* LONG64 must be defined when a 64-bit type is available */ +#define LONG64 +#define INT64 long + +#else + + + /*************************************************************************/ + /* */ + /* many compilers provide the non-ANSI 'long long' 64-bit type. You can */ + /* activate it by defining the FTCALC_USE_LONG_LONG macro in `ftoption.h'*/ + /* Note that this will produce many -ansi warnings during library */ + /* compilation, and that in many cases, the generated code will not be */ + /* smaller or faster !! */ + /* */ +#ifdef FTCALC_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* FTCALC_USE_LONG_LONG */ +#endif + + +#ifdef FT_MAKE_OPTION_SINGLE_OBJECT +#define LOCAL_DEF static +#define LOCAL_FUNC static +#else +#define LOCAL_DEF extern +#define LOCAL_FUNC /* nothing */ +#endif + +#ifdef FT_MAKE_OPTION_SINGLE_LIBRARY_OBJECT +#define BASE_DEF LOCAL_DEF +#define BASE_FUNC LOCAL_FUNC +#else +#define BASE_DEF extern +#define BASE_FUNC /* nothing */ +#endif + +#ifndef EXPORT_DEF +#define EXPORT_DEF extern +#endif + +#ifndef EXPORT_FUNC +#define EXPORT_FUNC /* nothing */ +#endif + +#endif /* FTCONFIG_H */ + + +/* END */ diff --git a/config/ftmodule.h b/include/freetype/config/ftmodule.h similarity index 100% rename from config/ftmodule.h rename to include/freetype/config/ftmodule.h diff --git a/config/ftoption.h b/include/freetype/config/ftoption.h similarity index 100% rename from config/ftoption.h rename to include/freetype/config/ftoption.h diff --git a/include/freetype.h b/include/freetype/freetype.h similarity index 99% rename from include/freetype.h rename to include/freetype/freetype.h index ff4e2a88e..ae87c5106 100644 --- a/include/freetype.h +++ b/include/freetype/freetype.h @@ -52,9 +52,9 @@ #define EXPORT_DEF extern #endif -#include -#include -#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/ftbbox.h b/include/freetype/ftbbox.h similarity index 99% rename from include/ftbbox.h rename to include/freetype/ftbbox.h index f3dfb606b..6b769465d 100644 --- a/include/ftbbox.h +++ b/include/freetype/ftbbox.h @@ -30,7 +30,7 @@ #ifndef FTBBOX_H #define FTBBOX_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h new file mode 100644 index 000000000..aa67c207c --- /dev/null +++ b/include/freetype/fterrors.h @@ -0,0 +1,115 @@ +/***************************************************************************/ +/* */ +/* fterrors.h */ +/* */ +/* FreeType error codes (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/* This file is used to define the FreeType error enumeration constants */ +/* It can also be used to create an error message table easily with */ +/* something like: */ +/* */ +/* { */ +/* */ +/* #undef FTERRORS_H */ +/* #define FT_ERRORDEF( e, v, s ) { e, s ], */ +/* #define FT_ERROR_START_LIST { */ +/* #define FT_ERROR_END_LIST { 0, 0 } }; */ +/* */ +/* const struct { int err_code; const char* err_msg } ft_errors[] = */ +/* #include */ +/* } */ +/* */ +/***************************************************************************/ + +#ifndef FTERRORS_H +#define FTERRORS_H + +#ifndef FT_ERRORDEF +#define FT_ERRORDEF( e, v, s ) e = v, +#define FT_ERROR_START_LIST enum { +#define FT_ERROR_END_LIST FT_Err_Max }; +#endif /* FT_ERRORDEF */ + +#ifdef FT_ERROR_START_LIST +FT_ERROR_START_LIST +#endif + + FT_ERRORDEF( FT_Err_Ok, 0x0000, "no error" ) + FT_ERRORDEF( FT_Err_Cannot_Open_Resource, 0x0001, "can't open stream" ) + FT_ERRORDEF( FT_Err_Unknown_File_Format, 0x0002, "unknown file format" ) + FT_ERRORDEF( FT_Err_Invalid_File_Format, 0x0003, "broken file" ) + + FT_ERRORDEF( FT_Err_Invalid_Argument, 0x0010, "invalid argument" ) + FT_ERRORDEF( FT_Err_Invalid_Handle, 0x0011, "invalid object handle" ) + FT_ERRORDEF( FT_Err_Invalid_Glyph_Index, 0x0012, "invalid glyph index" ) + FT_ERRORDEF( FT_Err_Invalid_Character_Code, 0x0013, "invalid character code" ) + + FT_ERRORDEF( FT_Err_Unimplemented_Feature, 0x0020, "unimplemented feature" ) + FT_ERRORDEF( FT_Err_Invalid_Glyph_Format, 0x0021, "invalid glyph image format" ) + + FT_ERRORDEF( FT_Err_Invalid_Library_Handle, 0x0030, "invalid library handle" ) + FT_ERRORDEF( FT_Err_Invalid_Driver_Handle, 0x0031, "invalid module handle" ) + FT_ERRORDEF( FT_Err_Invalid_Face_Handle, 0x0032, "invalid face handle" ) + FT_ERRORDEF( FT_Err_Invalid_Size_Handle, 0x0033, "invalid size handle" ) + FT_ERRORDEF( FT_Err_Invalid_Slot_Handle, 0x0034, "invalid glyph slot handle" ) + FT_ERRORDEF( FT_Err_Invalid_CharMap_Handle, 0x0035, "invalid charmap handle" ) + FT_ERRORDEF( FT_Err_Invalid_Outline, 0x0036, "invalid outline" ) + FT_ERRORDEF( FT_Err_Invalid_Dimensions, 0x0037, "invalid dimensions" ) + + FT_ERRORDEF( FT_Err_Unavailable_Outline, 0x0040, "unavailable outline" ) + FT_ERRORDEF( FT_Err_Unavailable_Bitmap, 0x0041, "unavailable bitmap" ) + FT_ERRORDEF( FT_Err_File_Is_Not_Collection, 0x0042, "file is not a font collection" ) + FT_ERRORDEF( FT_Err_Too_Many_Drivers, 0x0043, "too many modules" ) + FT_ERRORDEF( FT_Err_Too_Many_Glyph_Formats, 0x0044, "too many glyph formats" ) + FT_ERRORDEF( FT_Err_Too_Many_Extensions, 0x0045, "too many extensions" ) + + FT_ERRORDEF( FT_Err_Out_Of_Memory, 0x0050, "out of memory" ) + FT_ERRORDEF( FT_Err_Unlisted_Object, 0x0051, "unlisted object" ) + + FT_ERRORDEF( FT_Err_Invalid_Stream_Handle, 0x0060, "invalid stream handle" ) + FT_ERRORDEF( FT_Err_Cannot_Open_Stream, 0x0061, "cannot open stream" ) + FT_ERRORDEF( FT_Err_Invalid_Stream_Seek, 0x0062, "invalid stream seek" ) + FT_ERRORDEF( FT_Err_Invalid_Stream_Skip, 0x0063, "invalid stream skip" ) + FT_ERRORDEF( FT_Err_Invalid_Stream_Read, 0x0064, "invalid stream read" ) + FT_ERRORDEF( FT_Err_Invalid_Stream_Operation, 0x0065, "invalid stream operation" ) + FT_ERRORDEF( FT_Err_Invalid_Frame_Operation, 0x0066, "invalid frame operation" ) + FT_ERRORDEF( FT_Err_Nested_Frame_Access, 0x0067, "nested frame access" ) + FT_ERRORDEF( FT_Err_Invalid_Frame_Read, 0x0068, "invalid frame read" ) + + FT_ERRORDEF( FT_Err_Too_Many_Points, 0x0070, "too many points in glyph" ) + FT_ERRORDEF( FT_Err_Too_Many_Contours, 0x0071, "too many contours in glyph" ) + FT_ERRORDEF( FT_Err_Invalid_Composite, 0x0072, "invalid composite glyph" ) + FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0073, "too many hints in glyph" ) + FT_ERRORDEF( FT_Err_Too_Many_Edges, 0x0074, "too many edges in glyph" ) + FT_ERRORDEF( FT_Err_Too_Many_Strokes, 0x0075, "too many strokes in glyph" ) + +/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */ + +/* range 0x500 - 0x5FF is reserved for TrueDoc specific stuff */ + +/* range 0x600 - 0x6FF is reserved for Type1 specific stuff */ + + FT_ERRORDEF( FT_Err_Raster_Uninitialized, 0x0080, "raster uninitialized" ) + FT_ERRORDEF( FT_Err_Raster_Corrupted, 0x0081, "raster corrupted !!" ) + FT_ERRORDEF( FT_Err_Raster_Overflow, 0x0082, "raster overflow !!" ) + +#ifdef FT_ERROR_END_LIST +FT_ERROR_END_LIST +#endif + +#undef FT_ERROR_START_LIST +#undef FT_ERROR_END_LIST +#undef FT_ERRORDEF + +#endif /* FTERRORS_H */ + +/* END */ diff --git a/include/ftglyph.h b/include/freetype/ftglyph.h similarity index 99% rename from include/ftglyph.h rename to include/freetype/ftglyph.h index cafc24160..6380efa40 100644 --- a/include/ftglyph.h +++ b/include/freetype/ftglyph.h @@ -26,7 +26,7 @@ #ifndef FTGLYPH_H #define FTGLYPH_H -#include +#include typedef enum { diff --git a/include/ftgrays.h b/include/freetype/ftgrays.h similarity index 96% rename from include/ftgrays.h rename to include/freetype/ftgrays.h index 5a3e156ca..ca7da3750 100644 --- a/include/ftgrays.h +++ b/include/freetype/ftgrays.h @@ -1,7 +1,7 @@ #ifndef FTGRAYS_H #define FTGRAYS_H -#include +#include /*************************************************************************/ /* */ diff --git a/include/ftimage.h b/include/freetype/ftimage.h similarity index 100% rename from include/ftimage.h rename to include/freetype/ftimage.h diff --git a/include/ftraster.h b/include/freetype/ftraster.h similarity index 98% rename from include/ftraster.h rename to include/freetype/ftraster.h index 0ba630b24..f7ce0f835 100644 --- a/include/ftraster.h +++ b/include/freetype/ftraster.h @@ -31,7 +31,7 @@ /* */ /* #define _STANDALONE_ */ -#include +#include #ifndef EXPORT_DEF #define EXPORT_DEF /* nothing */ diff --git a/include/ftsystem.h b/include/freetype/ftsystem.h similarity index 100% rename from include/ftsystem.h rename to include/freetype/ftsystem.h diff --git a/src/shared/autohint.h b/include/freetype/internal/autohint.h similarity index 99% rename from src/shared/autohint.h rename to include/freetype/internal/autohint.h index 288d1e470..fced489c5 100644 --- a/src/shared/autohint.h +++ b/include/freetype/internal/autohint.h @@ -62,7 +62,7 @@ * */ -#include +#include typedef struct FT_AutoHinterRec_ *FT_AutoHinter; diff --git a/src/base/ftcalc.h b/include/freetype/internal/ftcalc.h similarity index 97% rename from src/base/ftcalc.h rename to include/freetype/internal/ftcalc.h index cbc2e70d7..aac93748b 100644 --- a/src/base/ftcalc.h +++ b/include/freetype/internal/ftcalc.h @@ -19,8 +19,8 @@ #ifndef FTCALC_H #define FTCALC_H -#include -#include /* for LONG64 */ +#include +#include /* for LONG64 */ #ifdef __cplusplus extern "C" { diff --git a/src/base/ftdebug.h b/include/freetype/internal/ftdebug.h similarity index 98% rename from src/base/ftdebug.h rename to include/freetype/internal/ftdebug.h index 2e90646b2..bf0e1648a 100644 --- a/src/base/ftdebug.h +++ b/include/freetype/internal/ftdebug.h @@ -43,7 +43,7 @@ #ifndef FTDEBUG_H #define FTDEBUG_H -#include /* for FT_DEBUG_LEVEL_TRACE, FT_DEBUG_LEVEL_ERROR */ +#include /* for FT_DEBUG_LEVEL_TRACE, FT_DEBUG_LEVEL_ERROR */ #ifdef __cplusplus diff --git a/src/base/ftdriver.h b/include/freetype/internal/ftdriver.h similarity index 99% rename from src/base/ftdriver.h rename to include/freetype/internal/ftdriver.h index 3462a1826..2f6117f60 100644 --- a/src/base/ftdriver.h +++ b/include/freetype/internal/ftdriver.h @@ -18,7 +18,7 @@ #ifndef FTDRIVER_H #define FTDRIVER_H -#include +#include /*************************************************************************/ /*************************************************************************/ diff --git a/src/base/ftextend.h b/include/freetype/internal/ftextend.h similarity index 99% rename from src/base/ftextend.h rename to include/freetype/internal/ftextend.h index ddd891d96..5c9232b28 100644 --- a/src/base/ftextend.h +++ b/include/freetype/internal/ftextend.h @@ -18,7 +18,7 @@ #ifndef FTEXTEND_H #define FTEXTEND_H -#include +#include #ifdef __cplusplus diff --git a/src/base/ftlist.h b/include/freetype/internal/ftlist.h similarity index 99% rename from src/base/ftlist.h rename to include/freetype/internal/ftlist.h index 6241115ec..97ef81629 100644 --- a/src/base/ftlist.h +++ b/include/freetype/internal/ftlist.h @@ -26,7 +26,7 @@ #ifndef FTLIST_H #define FTLIST_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/base/ftobjs.h b/include/freetype/internal/ftobjs.h similarity index 98% rename from src/base/ftobjs.h rename to include/freetype/internal/ftobjs.h index afdda1975..f20b0b0ac 100644 --- a/src/base/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -25,9 +25,9 @@ #ifndef FTOBJS_H #define FTOBJS_H -#include -#include -#include +#include +#include +#include /*************************************************************************/ /* */ @@ -67,7 +67,6 @@ #define ABS( a ) ( (a) < 0 ? -(a) : (a) ) #endif - /*************************************************************************/ /* */ /* */ @@ -166,6 +165,14 @@ #define FREE( _pointer_ ) FT_Free( memory, (void**)&(_pointer_) ) + /* various useful types and definitions */ + + extern void FP_Panic( const char* message ); + + extern FT_Memory FP_New_Memory( void ); + + + EXPORT_DEF diff --git a/src/base/ftoutln.h b/include/freetype/internal/ftoutln.h similarity index 61% rename from src/base/ftoutln.h rename to include/freetype/internal/ftoutln.h index 438d00b2c..a4f92eeff 100644 --- a/src/base/ftoutln.h +++ b/include/freetype/internal/ftoutln.h @@ -1,6 +1,6 @@ #ifndef FTOUTLN_H #define FTOUTLN_H -#include +#include #endif /* FTOUTLN_H */ diff --git a/src/base/ftstream.h b/include/freetype/internal/ftstream.h similarity index 99% rename from src/base/ftstream.h rename to include/freetype/internal/ftstream.h index dc6017ef5..cc0b8decc 100644 --- a/src/base/ftstream.h +++ b/include/freetype/internal/ftstream.h @@ -1,7 +1,7 @@ #ifndef FTSTREAM_H #define FTSTREAM_H -#include +#include /* format of an 8-bit frame_op value = [ xxxxx | e | s ] */ /* where s is set to 1 when the value is signed.. */ diff --git a/src/shared/psnames.h b/include/freetype/internal/psnames.h similarity index 99% rename from src/shared/psnames.h rename to include/freetype/internal/psnames.h index 86fdba2a7..53011f389 100644 --- a/src/shared/psnames.h +++ b/include/freetype/internal/psnames.h @@ -19,7 +19,7 @@ #ifndef PSNAMES_H #define PSNAMES_H -#include +#include /************************************************************************** * diff --git a/src/shared/sfnt.h b/include/freetype/internal/sfnt.h similarity index 99% rename from src/shared/sfnt.h rename to include/freetype/internal/sfnt.h index d08f7f905..b08492a40 100644 --- a/src/shared/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -19,8 +19,8 @@ #ifndef SFNT_H #define SFNT_H -#include -#include +#include +#include /*************************************************************************/ diff --git a/src/shared/t1types.h b/include/freetype/internal/t1types.h similarity index 99% rename from src/shared/t1types.h rename to include/freetype/internal/t1types.h index cdcfd8897..9c755f54d 100644 --- a/src/shared/t1types.h +++ b/include/freetype/internal/t1types.h @@ -21,8 +21,8 @@ #ifndef T1TYPES_H #define T1TYPES_H -#include -#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/shared/tterrors.h b/include/freetype/internal/tterrors.h similarity index 100% rename from src/shared/tterrors.h rename to include/freetype/internal/tterrors.h diff --git a/src/shared/tttypes.h b/include/freetype/internal/tttypes.h similarity index 99% rename from src/shared/tttypes.h rename to include/freetype/internal/tttypes.h index 29136fed8..f28c0b972 100644 --- a/src/shared/tttypes.h +++ b/include/freetype/internal/tttypes.h @@ -24,7 +24,7 @@ #define TTTYPES_H -#include +#include #ifdef __cplusplus diff --git a/include/t1tables.h b/include/freetype/t1tables.h similarity index 72% rename from include/t1tables.h rename to include/freetype/t1tables.h index ae7ed905b..0f565aa3d 100644 --- a/include/t1tables.h +++ b/include/freetype/t1tables.h @@ -19,7 +19,7 @@ #ifndef T1TABLES_H #define T1TABLES_H -#include +#include /* Note that we separate font data in T1_FontInfo and T1_Private structures */ /* in order to later support multiple master fonts.. */ @@ -103,6 +103,78 @@ } T1_Private; + /************************************************************************* + * + * + * T1_Blend_Flags + * + * + * A set of flags used to indicate which fields are present in a + * given blen dictionary (font info or private). Used to support + * multiple masters.. + * + */ + typedef enum + { + t1_blend_none = 0, + + /* required fields in a FontInfo blend dictionary */ + t1_blend_underline_position, + t1_blend_underline_thickness, + t1_blend_italic_angle, + + /* required fields in a Private blend dictionary */ + t1_blend_blue_values, + t1_blend_other_blues, + t1_blend_standard_width, + t1_blend_standard_height, + t1_blend_stem_snap_widths, + t1_blend_stem_snap_heights, + t1_blend_blue_scale, + t1_blend_blue_shift, + t1_blend_family_blues, + t1_blend_family_other_blues, + t1_blend_force_bold, + + /* never remove */ + t1_blend_max + + } T1_Flags; + + + typedef struct T1_Blend_Pos + { + FT_Fixed min; + FT_Fixed max; + + } T1_Blend_Pos; + + /************************************************************************* + * + * + * T1_Blend + * + * + * A structure used to describe the multiple-master fonts information + * of a given Type 1 font. + * + */ + typedef struct T1_Blend_ + { + FT_Int num_axis; + FT_String* axis_types[4]; + + /* XXXX : add /BlendDesignMap entries */ + + FT_Int num_blends; + T1_Flags* flags [17]; + T1_Private* privates [17]; + T1_FontInfo* fontinfos[17]; + + } T1_Blend; + + + typedef struct CID_FontDict_ { T1_FontInfo font_info; @@ -142,4 +214,5 @@ } CID_Info; + #endif /* T1TABLES_H */ diff --git a/include/ttnameid.h b/include/freetype/ttnameid.h similarity index 100% rename from include/ttnameid.h rename to include/freetype/ttnameid.h diff --git a/include/tttables.h b/include/freetype/tttables.h similarity index 99% rename from include/tttables.h rename to include/freetype/tttables.h index 87f7600c5..edd678047 100644 --- a/include/tttables.h +++ b/include/freetype/tttables.h @@ -19,7 +19,7 @@ #ifndef TTTABLES_H #define TTTABLES_H -#include +#include /*************************************************************************/ /* */ diff --git a/src/shared/tttags.h b/include/freetype/tttags.h similarity index 98% rename from src/shared/tttags.h rename to include/freetype/tttags.h index 3cb3bc9a3..e55593fad 100644 --- a/src/shared/tttags.h +++ b/include/freetype/tttags.h @@ -20,7 +20,7 @@ #define TTAGS_H -#include /* for MAKE_TT_TAG() */ +#include /* for MAKE_TT_TAG() */ #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) diff --git a/include/fterrors.h b/include/fterrors.h deleted file mode 100644 index 6df9ae3c3..000000000 --- a/include/fterrors.h +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************/ -/* */ -/* fterrors.h */ -/* */ -/* FreeType error codes (specification). */ -/* */ -/* Copyright 1996-1999 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. */ -/* */ -/***************************************************************************/ - - -#define FT_Err_Ok 0x000 - -#define FT_Err_Cannot_Open_Resource 0x001 -#define FT_Err_Unknown_File_Format 0x002 -#define FT_Err_Invalid_File_Format 0x002 - -#define FT_Err_Invalid_Argument 0x003 -#define FT_Err_Invalid_Handle 0x004 -#define FT_Err_Invalid_Glyph_Index 0x00A -#define FT_Err_Invalid_Character_Code 0x00B - -#define FT_Err_Unimplemented_Feature 0x010 -#define FT_Err_Invalid_Glyph_Format 0x00D - -#define FT_Err_Invalid_Library_Handle 0x004 -#define FT_Err_Invalid_Driver_Handle 0x005 -#define FT_Err_Invalid_Face_Handle 0x006 -#define FT_Err_Invalid_Size_Handle 0x007 -#define FT_Err_Invalid_Slot_Handle 0x008 -#define FT_Err_Invalid_CharMap_Handle 0x009 -#define FT_Err_Invalid_Outline 0x00B -#define FT_Err_Invalid_Dimensions 0x00C - -#define FT_Err_Unavailable_Outline 0x011 -#define FT_Err_Unavailable_Bitmap 0x012 -#define FT_Err_Unavailable_Pixmap 0x013 -#define FT_Err_File_Is_Not_Collection 0x014 -#define FT_Err_Too_Many_Drivers 0x015 -#define FT_Err_Too_Many_Glyph_Formats 0x016 -#define FT_Err_Too_Many_Extensions 0x017 - -#define FT_Err_Out_Of_Memory 0x100 -#define FT_Err_Unlisted_Object 0x101 - -#define FT_Err_Invalid_Resource_Handle 0x200 -#define FT_Err_Invalid_Stream_Handle 0x201 -#define FT_Err_Cannot_Open_Stream 0x202 -#define FT_Err_Invalid_Stream_Seek 0x203 -#define FT_Err_Invalid_Stream_Skip 0x204 -#define FT_Err_Invalid_Stream_Read 0x205 -#define FT_Err_Invalid_Stream_Operation 0x206 -#define FT_Err_Invalid_Frame_Operation 0x207 -#define FT_Err_Nested_Frame_Access 0x208 -#define FT_Err_Invalid_Frame_Read 0x209 - -#define FT_Err_Too_Many_Points 0x300 -#define FT_Err_Too_Many_Contours 0x301 -#define FT_Err_Invalid_Composite 0x302 -#define FT_Err_Too_Many_Hints 0x303 -#define FT_Err_Too_Many_Edges 0x304 -#define FT_Err_Too_Many_Strokes 0x305 - -/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */ - -/* range 0x500 - 0x5FF is reserved for TrueDoc specific stuff */ - -/* range 0x600 - 0x6FF is reserved for Type1 specific stuff */ - -#define FT_Err_Raster_Uninitialized 0xF00 -#define FT_Err_Raster_Corrupted 0xF01 -#define FT_Err_Raster_Overflow 0xF02 - - -/* END */ diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index 3440e427f..92ad70693 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -30,9 +30,9 @@ /* */ /*************************************************************************/ -#include -#include -#include /* for ABS() */ +#include +#include +#include /* for ABS() */ #ifdef FT_CONFIG_OPTION_OLD_CALCS diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c index 06d232981..fa71216b8 100644 --- a/src/base/ftdebug.c +++ b/src/base/ftdebug.c @@ -16,7 +16,7 @@ /***************************************************************************/ -#include +#include #ifdef FT_DEBUG_LEVEL_TRACE char ft_trace_levels[trace_max]; diff --git a/src/base/ftextend.c b/src/base/ftextend.c index 9bbe0bf2a..5cddfcde1 100644 --- a/src/base/ftextend.c +++ b/src/base/ftextend.c @@ -24,7 +24,7 @@ /* */ /*************************************************************************/ -#include +#include /* required by the tracing mode */ #undef FT_COMPONENT diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index 248c38645..17e698e93 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -23,8 +23,8 @@ /* */ /***************************************************************************/ -#include -#include +#include +#include static void ft_prepare_glyph( FT_Glyph glyph, diff --git a/src/base/ftgrays.c b/src/base/ftgrays.c index 9362f0bc6..9228fde6e 100644 --- a/src/base/ftgrays.c +++ b/src/base/ftgrays.c @@ -46,7 +46,7 @@ /* - faster than the standard renderer for small (< 20) pixel sizes */ /* */ -#include +#include #if 1 #include /* for memcpy */ @@ -57,7 +57,7 @@ #ifdef _STANDALONE_ #error "implementation of FT_Outline_Decompose missing !!!" #else -#include /* to link to FT_Outline_Decompose */ +#include /* to link to FT_Outline_Decompose */ #endif /* define this to dump debugging information */ @@ -1428,7 +1428,7 @@ int check_sort( PCell cells, int count ) #else -#include "ftobjs.h" +#include static int grays_raster_new( FT_Memory memory, FT_Raster* araster ) diff --git a/src/base/ftinit.c b/src/base/ftinit.c index 01e145453..0399dc486 100644 --- a/src/base/ftinit.c +++ b/src/base/ftinit.c @@ -41,10 +41,10 @@ /*************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_init @@ -52,7 +52,7 @@ #undef FT_DRIVER #define FT_DRIVER( x ) extern FT_DriverInterface x; -#include +#include #undef FT_DRIVER #define FT_DRIVER( x ) &x, @@ -60,7 +60,7 @@ static const FT_DriverInterface* ft_default_drivers[] = { -#include +#include 0 }; diff --git a/src/base/ftlist.c b/src/base/ftlist.c index a7db2231f..ddcba9aa4 100644 --- a/src/base/ftlist.c +++ b/src/base/ftlist.c @@ -23,9 +23,9 @@ /*************************************************************************/ -#include -#include -#include +#include +#include +#include /*************************************************************************/ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 121ab1187..436cee36a 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -15,12 +15,12 @@ /* */ /***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include /*************************************************************************/ /*************************************************************************/ diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index f63115f6c..40181689a 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -23,11 +23,10 @@ /*************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include static const FT_Outline null_outline = { 0, 0, 0, 0, 0, 0 }; diff --git a/src/base/ftraster.c b/src/base/ftraster.c index 82ecd0e2f..c0c444aaf 100644 --- a/src/base/ftraster.c +++ b/src/base/ftraster.c @@ -61,10 +61,9 @@ #endif -#include +#include #ifndef _STANDALONE_ -#include -#include +#include #endif #ifndef EXPORT_FUNC @@ -167,8 +166,8 @@ #else /* _STANDALONE_ */ -#include -#include +#include +#include /*************************************************************************/ /* */ @@ -3924,7 +3923,7 @@ Scan_DropOuts : #else -#include "ftobjs.h" +#include static int ft_raster_new( FT_Memory memory, FT_Raster* araster ) diff --git a/src/base/ftstream.c b/src/base/ftstream.c index a39106808..03abfb5ca 100644 --- a/src/base/ftstream.c +++ b/src/base/ftstream.c @@ -1,5 +1,5 @@ -#include -#include +#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_stream diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c index 0da26b84a..9836e414b 100644 --- a/src/base/ftsystem.c +++ b/src/base/ftsystem.c @@ -20,8 +20,8 @@ * **************************************************************************/ -#include -#include +#include +#include #include #include diff --git a/src/base/rules.mk b/src/base/rules.mk index 875bd0d66..7ea7488ef 100644 --- a/src/base/rules.mk +++ b/src/base/rules.mk @@ -39,13 +39,13 @@ BASE_SRC := $(BASE_)ftcalc.c \ # Base layer headers # -BASE_H := $(BASE_)ftcalc.h \ - $(BASE_)ftdebug.h \ - $(BASE_)ftdriver.h \ - $(BASE_)ftextend.h \ - $(BASE_)ftlist.h \ - $(BASE_)ftobjs.h \ - $(BASE_)ftstream.h +BASE_H := $(INTERNAL_)ftcalc.h \ + $(INTERNAL_)ftdebug.h \ + $(INTERNAL_)ftdriver.h \ + $(INTERNAL_)ftextend.h \ + $(INTERNAL_)ftlist.h \ + $(INTERNAL_)ftobjs.h \ + $(INTERNAL_)ftstream.h # Base layer `extensions' sources diff --git a/src/macfond/fonddrvr.c b/src/macfond/fonddrvr.c index f004f5fe6..b0a03f353 100644 --- a/src/macfond/fonddrvr.c +++ b/src/macfond/fonddrvr.c @@ -63,8 +63,8 @@ change to ftobjs.c to make this work. */ -#include -#include +#include +#include #include #include diff --git a/src/oldapi/ttapi.c b/src/oldapi/ttapi.c index ae31f02dd..6367251d6 100644 --- a/src/oldapi/ttapi.c +++ b/src/oldapi/ttapi.c @@ -21,17 +21,17 @@ * ******************************************************************/ -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include +#include <../truetype/ttdriver.h> +#include <../truetype/ttobjs.h> +#include <../truetype/ttcmap.h> #define _TRUETYPE_ #include /* backwards compatible interface */ diff --git a/src/psnames/psdriver.c b/src/psnames/psdriver.c index 8162bd495..23d59b8e8 100644 --- a/src/psnames/psdriver.c +++ b/src/psnames/psdriver.c @@ -1,6 +1,6 @@ +#include +#include #include -#include -#include #include #ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES diff --git a/src/psnames/psdriver.h b/src/psnames/psdriver.h index 4349457ef..615eb9352 100644 --- a/src/psnames/psdriver.h +++ b/src/psnames/psdriver.h @@ -19,8 +19,8 @@ #ifndef PSDRIVER_H #define PSDRIVER_H -#include -#include +#include +#include EXPORT_DEF const FT_DriverInterface psnames_driver_interface; diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index 93472d9a6..0273067d6 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -1,9 +1,9 @@ +#include #include #include #include #include #include -#include static const SFNT_Interface sfnt_interface = { diff --git a/src/sfnt/sfdriver.h b/src/sfnt/sfdriver.h index b0eb25850..43640eb35 100644 --- a/src/sfnt/sfdriver.h +++ b/src/sfnt/sfdriver.h @@ -19,8 +19,7 @@ #ifndef SFDRIVER_H #define SFDRIVER_H -#include -#include +#include EXPORT_DEF const FT_DriverInterface sfnt_driver_interface; diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 7a1a2ad70..32604e0b1 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -16,11 +16,11 @@ /***************************************************************************/ -#include +#include +#include #include #include -#include /* required by the tracing mode */ #undef FT_COMPONENT diff --git a/src/sfnt/ttcmap.h b/src/sfnt/ttcmap.h index d5da24000..49ac80d35 100644 --- a/src/sfnt/ttcmap.h +++ b/src/sfnt/ttcmap.h @@ -19,7 +19,7 @@ #ifndef TTCMAP_H #define TTCMAP_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 211ee4a36..0a7f0874e 100644 --- a/src/sfnt/ttload.c +++ b/src/sfnt/ttload.c @@ -21,13 +21,12 @@ /***************************************************************************/ -#include -#include +#include +#include +#include #include -#include #include -#include /* required by the tracing mode */ #undef FT_COMPONENT diff --git a/src/sfnt/ttload.h b/src/sfnt/ttload.h index 28902e733..7a6d69af5 100644 --- a/src/sfnt/ttload.h +++ b/src/sfnt/ttload.h @@ -21,8 +21,8 @@ #define TTLOAD_H -#include -#include +#include +#include /* #include */ diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c index b55eb5b61..9055da50e 100644 --- a/src/sfnt/ttpost.c +++ b/src/sfnt/ttpost.c @@ -24,17 +24,17 @@ /* */ /*************************************************************************/ -#include +#include +#include +#include #include -#include #include -#include /* When this configuration macro is defined, we rely on the "psnames" */ /* module to grab the glyph names.. */ #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include +#include #define MAC_NAME(x) ((TT_String*)psnames->macintosh_name(x)) #else diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h index eeb0bf1a5..944c00c65 100644 --- a/src/sfnt/ttpost.h +++ b/src/sfnt/ttpost.h @@ -29,8 +29,8 @@ #ifndef TTPOST_H #define TTPOST_H -#include -#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index b7020bbd4..1e63db20d 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -21,11 +21,11 @@ /***************************************************************************/ -#include +#include +#include +#include #include -#include -#include /*************************************************************************/ diff --git a/src/shared/readme.txt b/src/shared/readme.txt deleted file mode 100644 index b48163a30..000000000 --- a/src/shared/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ -WARNING: - -The files in these subdirectories are shared by several font drivers. - -All C source files are included by at least one of the drivers, and -thus should _never_ be compiled directly. diff --git a/src/shared/rules.mk b/src/shared/rules.mk deleted file mode 100644 index 6fc1d58ee..000000000 --- a/src/shared/rules.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# FreeType 2 shared files 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 -# 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 SHARED_RULES - SHARED_RULES := 1 - - SHARED := $(SRC_)shared - SHARED_ := $(SHARED)$(SEP) - - SHARED_H := $(wildcard $(SHARED_)*.h) - SHARED_SRC := $(wildcard $(SHARED_)*.c) - -endif - -# EOF diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 7673f6a47..82bcd6ccb 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -16,10 +16,10 @@ /***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/truetype/ttdriver.h b/src/truetype/ttdriver.h index 062e70187..5e31b751f 100644 --- a/src/truetype/ttdriver.h +++ b/src/truetype/ttdriver.h @@ -19,11 +19,10 @@ #ifndef TTDRIVER_H #define TTDRIVER_H -#include -#include +#include +#include #include #include -#include EXPORT_DEF diff --git a/src/truetype/tterrors.h b/src/truetype/tterrors.h index 90286e3ed..c8b272c62 100644 --- a/src/truetype/tterrors.h +++ b/src/truetype/tterrors.h @@ -19,7 +19,6 @@ #ifndef TTERRORS_H #define TTERRORS_H - /*************************************************************************/ /* */ /* Error codes declaration */ @@ -92,6 +91,9 @@ #define TT_Err_Invalid_Displacement 0x410 #define TT_Err_Execution_Too_Long 0x411 +#define TT_Err_Too_Many_Instruction_Defs 0x412 +#define TT_Err_Too_Many_Function_Defs 0x412 + /* Other TrueType specific error codes. */ #define TT_Err_Table_Missing 0x420 diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index e824f62e9..bd66e8f2d 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -16,16 +16,15 @@ /***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include +#include + -#include #include -#include - #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #include #endif diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index 8f84abd34..d26293d5c 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -16,11 +16,12 @@ /***************************************************************************/ -#include -#include -#include +#include +#include +#include #include +#include #include #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index abb95995f..2023f36f2 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -16,15 +16,14 @@ /***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include +#include +#include #include #include diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h index e22d3f61b..ac57b7b44 100644 --- a/src/truetype/ttobjs.h +++ b/src/truetype/ttobjs.h @@ -20,8 +20,8 @@ #define TTOBJS_H -#include -#include +#include +#include #include diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c index 4293b9379..56d61cc65 100644 --- a/src/truetype/ttpload.c +++ b/src/truetype/ttpload.c @@ -16,12 +16,12 @@ /***************************************************************************/ -#include -#include -#include +#include +#include +#include +#include #include -#include #include #undef FT_COMPONENT diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h index bb7c51777..30b2972ed 100644 --- a/src/truetype/ttpload.h +++ b/src/truetype/ttpload.h @@ -19,7 +19,7 @@ #ifndef TTPLOAD_H #define TTPLOAD_H -#include +#include #ifdef __cplusplus diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c index f619e28e5..2b904af83 100644 --- a/src/type1/t1afm.c +++ b/src/type1/t1afm.c @@ -5,10 +5,10 @@ * ***************************************************************************/ -#include -#include -#include +#include +#include #include /* for qsort */ +#include LOCAL_FUNC void T1_Done_AFM( FT_Memory memory, T1_AFM* afm ) diff --git a/src/type1/t1afm.h b/src/type1/t1afm.h index 567ed6325..61e18b82c 100644 --- a/src/type1/t1afm.h +++ b/src/type1/t1afm.h @@ -8,7 +8,7 @@ #ifndef T1AFM_H #define T1AFM_H -#include +#include /* In this version, we only read the kerning table from the */ /* AFM file. We may add support for ligatures a bit later.. */ diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index ed5920118..78fe415bc 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_t1driver diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index d644267aa..e9cd8a3e5 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -16,8 +16,8 @@ ******************************************************************/ #include -#include -#include +#include +#include #ifndef T1_CONFIG_OPTION_DISABLE_HINTER #include diff --git a/src/type1/t1hinter.c b/src/type1/t1hinter.c index 3a09ed7a5..f9d5db9b5 100644 --- a/src/type1/t1hinter.c +++ b/src/type1/t1hinter.c @@ -20,7 +20,7 @@ * ******************************************************************/ -#include +#include #include #include diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 87c2d1fee..e4802da9c 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -1,7 +1,7 @@ -#include -#include +#include +#include +#include -#include #include #include diff --git a/src/type1/t1load.h b/src/type1/t1load.h index 9e0ee4736..673316a03 100644 --- a/src/type1/t1load.h +++ b/src/type1/t1load.h @@ -18,7 +18,7 @@ #ifndef T1LOAD_H #define T1LOAD_H -#include +#include #include #ifdef __cplusplus diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index 79d26db9b..23b6a900c 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -15,8 +15,8 @@ * ******************************************************************/ -#include -#include +#include +#include #include #include @@ -26,7 +26,7 @@ #include #endif -#include +#include /* Required by tracing mode */ #undef FT_COMPONENT diff --git a/src/type1/t1objs.h b/src/type1/t1objs.h index e11a3a1c3..51c71861a 100644 --- a/src/type1/t1objs.h +++ b/src/type1/t1objs.h @@ -18,11 +18,11 @@ #ifndef T1OBJS_H #define T1OBJS_H -#include -#include +#include +#include +#include #include -#include #ifdef __cplusplus extern "C" { diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c index e3710b07f..d897d7446 100644 --- a/src/type1/t1parse.c +++ b/src/type1/t1parse.c @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include /* for sscanf */ diff --git a/src/type1/t1parse.h b/src/type1/t1parse.h index b124c08e9..99666807a 100644 --- a/src/type1/t1parse.h +++ b/src/type1/t1parse.h @@ -25,7 +25,7 @@ #ifndef T1PARSE_H #define T1PARSE_H -#include +#include #include #ifdef __cplusplus diff --git a/src/type1/t1tokens.c b/src/type1/t1tokens.c index 92a16d7e1..f4aca2831 100644 --- a/src/type1/t1tokens.c +++ b/src/type1/t1tokens.c @@ -23,8 +23,8 @@ * ******************************************************************/ -#include -#include +#include +#include #include #include diff --git a/src/type1z/t1afm.c b/src/type1z/t1afm.c index f619e28e5..b9f8d8398 100644 --- a/src/type1z/t1afm.c +++ b/src/type1z/t1afm.c @@ -6,8 +6,8 @@ ***************************************************************************/ #include -#include -#include +#include +#include #include /* for qsort */ LOCAL_FUNC diff --git a/src/type1z/t1afm.h b/src/type1z/t1afm.h index 567ed6325..61e18b82c 100644 --- a/src/type1z/t1afm.h +++ b/src/type1z/t1afm.h @@ -8,7 +8,7 @@ #ifndef T1AFM_H #define T1AFM_H -#include +#include /* In this version, we only read the kerning table from the */ /* AFM file. We may add support for ligatures a bit later.. */ diff --git a/src/type1z/t1driver.c b/src/type1z/t1driver.c index d25b95700..3cef9b5d0 100644 --- a/src/type1z/t1driver.c +++ b/src/type1z/t1driver.c @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_t1driver diff --git a/src/type1z/t1errors.h b/src/type1z/t1errors.h index f268d8770..93731c11d 100644 --- a/src/type1z/t1errors.h +++ b/src/type1z/t1errors.h @@ -18,7 +18,7 @@ #ifndef T1ERRORS_H #define T1ERRORS_H -#include +#include /************************ error codes declaration **************/ diff --git a/src/type1z/t1gload.c b/src/type1z/t1gload.c index 200ed35a3..b75098ed6 100644 --- a/src/type1z/t1gload.c +++ b/src/type1z/t1gload.c @@ -16,8 +16,8 @@ ******************************************************************/ #include -#include -#include +#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_t1gload diff --git a/src/type1z/t1load.c b/src/type1z/t1load.c index 3e4ef921e..2566419f8 100644 --- a/src/type1z/t1load.c +++ b/src/type1z/t1load.c @@ -59,10 +59,10 @@ * ******************************************************************/ -#include -#include +#include +#include -#include +#include #include #include #include diff --git a/src/type1z/t1load.h b/src/type1z/t1load.h index 6a1a45c03..093096c86 100644 --- a/src/type1z/t1load.h +++ b/src/type1z/t1load.h @@ -18,7 +18,7 @@ #ifndef T1LOAD_H #define T1LOAD_H -#include +#include #include #ifdef __cplusplus diff --git a/src/type1z/t1objs.c b/src/type1z/t1objs.c index c034c160c..43d876b38 100644 --- a/src/type1z/t1objs.c +++ b/src/type1z/t1objs.c @@ -15,12 +15,12 @@ * ******************************************************************/ -#include -#include +#include +#include #include #include -#include +#include #include /* Required by tracing mode */ diff --git a/src/type1z/t1objs.h b/src/type1z/t1objs.h index 8a168636b..5b41f3a8d 100644 --- a/src/type1z/t1objs.h +++ b/src/type1z/t1objs.h @@ -18,10 +18,10 @@ #ifndef T1OBJS_H #define T1OBJS_H -#include -#include +#include +#include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c index a1f4be993..3cb47a928 100644 --- a/src/type1z/t1parse.c +++ b/src/type1z/t1parse.c @@ -28,10 +28,10 @@ * ******************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h index 4487193d6..686691862 100644 --- a/src/type1z/t1parse.h +++ b/src/type1z/t1parse.h @@ -31,7 +31,7 @@ #ifndef T1PARSE_H #define T1PARSE_H -#include +#include #ifdef __cplusplus extern "C" {