From 7dff772e5912f070325dae79008a1ae31ea5989e Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 17 Jan 2000 08:24:22 +0000 Subject: [PATCH] Added ftraster.h for better support of standalone mode. Fixed cleaning rules for the demo programs. --- demos/Makefile | 62 ++++++++++++++++++++--------------------- include/ftraster.h | 68 +++++++++++++++++++++++++++++++++++++++++++++ src/base/ftraster.c | 18 ++++++------ 3 files changed, 107 insertions(+), 41 deletions(-) create mode 100644 include/ftraster.h diff --git a/demos/Makefile b/demos/Makefile index 30fa35fc0..8c5f52626 100644 --- a/demos/Makefile +++ b/demos/Makefile @@ -1,4 +1,3 @@ -.PHONY: exes all: exes #################################################################### @@ -21,10 +20,10 @@ no_config_mk := 1 endif ifdef no_config_mk - exes: @echo Please compile the library before the demo programs! - +clean distclean: + @echo "I need \`../config.mk' to do that!" else #################################################################### @@ -34,6 +33,33 @@ else # include ../config.mk +#################################################################### +# +# Define a few important variables now +# +# +TOP_ := $(TOP)$(SEP) +SRC_ := $(TOP)$(SEP)src$(SEP) + +BIN_ := bin$(SEP) +OBJ_ := obj$(SEP) + +GRAPH_DIR := graph + +SRC_DIR := src +SRC_DIR_ := $(SRC_DIR)$(SEP) + + +.PHONY: exes clean distclean + +################################################################### +# +# Include the rules needed to compile the graphics sub-system. +# This will also select which graphics driver to compile to the +# sub-system.. +# +include $(GRAPH_DIR)/rules.mk + #################################################################### # # Detect DOS-like platforms, currently DOS, Win 3.1, Win32 & OS/2 @@ -50,7 +76,6 @@ endif # cannot take a long list of arguments, we simply erase the directory # contents.. # -.PHONY: clean distclean ifdef DOSLIKE clean_demo: @@ -65,31 +90,14 @@ clean_demo: -$(DELETE) $(OBJ_)*.$O -$(DELETE) $(SRC_)*.bak graph$(SEP)*.bak -$(DELETE) $(SRC_)*~ graph$(SEP)*~ - - distclean_demo: clean_demo -$(DELETE) $(EXES:%=$(BIN_)%) + -$(DELETE) $(GRAPH_LIB) endif clean: clean_demo distclean: distclean_demo -#################################################################### -# -# Define a few important variables now -# -# -TOP_ := $(TOP)$(SEP) -SRC_ := $(TOP)$(SEP)src$(SEP) - -BIN_ := bin$(SEP) -OBJ_ := obj$(SEP) - -GRAPH_DIR := graph - -SRC_DIR := src -SRC_DIR_ := $(SRC_DIR)$(SEP) - FT_INCLUDES := $(BUILD) $(TOP_)include $(SRC_)base TT_INCLUDES := $(SRC_)shared $(SRC_)truetype @@ -122,14 +130,6 @@ ifneq ($(findstring $(PLATFORM),os2 unix),) EXES += ttdebug endif -################################################################### -# -# Include the rules needed to compile the graphics sub-system. -# This will also select which graphics driver to compile to the -# sub-system.. -# -include $(GRAPH_DIR)/rules.mk - exes: $(EXES:%=$(BIN_)%$E) @@ -223,5 +223,3 @@ $(BIN_)fttimer$E: $(OBJ_)fttimer.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(LINK) $(LFLAGS) $T$@ $< $(FTLIB) $(GRAPH_LINK) $(EFENCE) endif - - diff --git a/include/ftraster.h b/include/ftraster.h new file mode 100644 index 000000000..1e0ecb3c6 --- /dev/null +++ b/include/ftraster.h @@ -0,0 +1,68 @@ +/***************************************************************************/ +/* */ +/* ftraster.h */ +/* */ +/* The FreeType glyph rasterizer (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef FTRASTER_H +#define FTRASTER_H + +#ifdef __cplusplus + extern "C" { +#endif + + + /*************************************************************************/ + /* */ + /* Uncomment the following line if you are using ftraster.c as a */ + /* standalone module, fully independent of FreeType. */ + /* */ +/* #define _STANDALONE_ */ + +#include + +#ifndef EXPORT_DEF +#define EXPORT_DEF /* nothing */ +#endif + + EXPORT_DEF + int FT_Raster_Init( FT_Raster raster, + const char* pool_base, + long pool_size ); + + EXPORT_DEF + int FT_Raster_Render( FT_Raster raster, + FT_Outline* outline, + FT_Bitmap* target_map ); + + EXPORT_DEF + long FT_Raster_ObjSize( void ); + + /* FT_Raster_SetPalette() is currently unused by FreeType 2 */ + + EXPORT_DEF + int FT_Raster_SetPalette( FT_Raster raster, + int count, + const char* palette ); + + +#ifdef __cplusplus + } +#endif + +#endif /* FTRASTER_H */ + + +/* END */ diff --git a/src/base/ftraster.c b/src/base/ftraster.c index b0059a1e4..99dcf353b 100644 --- a/src/base/ftraster.c +++ b/src/base/ftraster.c @@ -1,10 +1,10 @@ /***************************************************************************/ /* */ -/* ftraster2.c */ +/* ftraster.c */ /* */ /* The FreeType glyph rasterizer (body). */ /* */ -/* Copyright 1996-1999 by */ +/* Copyright 1996-2000 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -53,7 +53,7 @@ /*************************************************************************/ -#include +#include #ifndef _STANDALONE_ #include #endif @@ -2236,13 +2236,12 @@ /* */ /* Error code. 0 means sucess. */ /* */ - - + static int FT_Decompose_Outline( FT_Outline* outline, FT_Outline_Funcs* interface, void* user ) { - typedef enum _phases + typedef enum _phases { phase_point, phase_conic, @@ -2478,7 +2477,8 @@ static TResult Convert_Glyph( RAS_ARG_ FT_Outline* outline ) { - static FT_Outline_Funcs interface = + static + FT_Outline_Funcs interface = { (FT_Outline_MoveTo_Func)Move_To, (FT_Outline_LineTo_Func)Line_To, @@ -2519,8 +2519,8 @@ /* */ /* Inits an empty linked list. */ /* */ - static void - Init_Linked( TProfileList* l ) + static + void Init_Linked( TProfileList* l ) { *l = NULL; }