ref: 7dff772e5912f070325dae79008a1ae31ea5989e
parent: 9ab7c3c37e1514004f7e6ec05761f868e68420a6
author: Werner Lemberg <[email protected]>
date: Mon Jan 17 03:24:22 EST 2000
Added ftraster.h for better support of standalone mode. Fixed cleaning rules for the demo programs.
--- a/demos/Makefile
+++ b/demos/Makefile
@@ -1,4 +1,3 @@
-.PHONY: exes
all: exes
####################################################################
@@ -21,10 +20,10 @@
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 @@
####################################################################
#
+# 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 @@
# cannot take a long list of arguments, we simply erase the directory
# contents..
#
-.PHONY: clean distclean
ifdef DOSLIKE
clean_demo:
@@ -65,32 +90,15 @@
-$(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
T1_INCLUDES := $(SRC_)shared $(SRC_)type1
@@ -122,14 +130,6 @@
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 @@
$(LINK) $(LFLAGS) $T$@ $< $(FTLIB) $(GRAPH_LINK) $(EFENCE)
endif
-
-
--- /dev/null
+++ b/include/ftraster.h
@@ -1,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 */
--- 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;
}