Added ftraster.h for better support of standalone mode. Fixed cleaning rules for the demo programs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
diff --git a/demos/Makefile b/demos/Makefile
index 30fa35f..8c5f526 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
####################################################################
@@ -36,6 +35,33 @@ 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 0000000..1e0ecb3
--- /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 <ftimage.h>
+
+#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 b0059a1..99dcf35 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 <ftimage.h>
+#include <ftraster.h>
#ifndef _STANDALONE_
#include <ftconfig.h>
#endif
@@ -2236,13 +2236,12 @@
/* <Return> */
/* 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;
}