Commit 15492f27 authored by David Turner's avatar David Turner
Browse files

- updated all source files to adhere to the new inclusion scheme

- the CFF loader now loads the encodings and charset tables
  though doesn't use them for now
parent 20f0291b
2000-12-07 David Turnre <david.turner@freetype.org>
* many, many files: changed source files to adhere to the new
header inclusion scheme. Not completely tested but works for
now here..
2000-12-06 David Turner <david.turner@freetype.org>
* src/cache/ftlru.c (FT_Lru_Done): fixed a small memory leak
......
......@@ -101,7 +101,7 @@
/*************************************************************************/
/* */
/* The macro FT2_SOURCE_FILE is used to include a given FreeType 2 */
/* The macro FT_SOURCE_FILE is used to include a given FreeType 2 */
/* component source file (be it a header, a C source file, or an */
/* included file). */
/* */
......@@ -114,9 +114,9 @@
/* FT_FLAT_COMPILATION. */
/* */
#ifdef FT_FLAT_COMPILATION
#define FT_SOURCE_FILE( d, x ) <d/x>
# define FT_SOURCE_FILE( d, x ) #x
#else
#define FT_SOURCE_FILE( d, x ) #x
# define FT_SOURCE_FILE( d, x ) <d/x>
#endif
......
......@@ -33,6 +33,7 @@
#define FT_INTERNAL_DEBUG_H FT2_INTERNAL_FILE(ftdebug.h)
#define FT_INTERNAL_CALC_H FT2_INTERNAL_FILE(ftcalc.h)
#define FT_INTERNAL_DRIVER_H FT2_INTERNAL_FILE(ftdriver.h)
#define FT_INTERNAL_EXTEND_H FT2_INTERNAL_FILE(ftextend.h)
#define FT_INTERNAL_SFNT_H FT2_INTERNAL_FILE(sfnt.h)
......
......@@ -61,6 +61,32 @@ FT_BEGIN_HEADER
} CFF_Index;
typedef struct CFF_Encoding_
{
FT_Stream stream;
FT_UInt format;
FT_ULong offset;
FT_UInt size;
FT_Byte* bytes;
} CFF_Encoding;
typedef struct CFF_Charset_
{
FT_Stream stream;
FT_UInt format;
FT_ULong offset;
FT_UInt size;
FT_Byte* bytes;
} CFF_Charset;
typedef struct CFF_Font_Dict_
{
FT_UInt version;
......@@ -195,8 +221,9 @@ FT_BEGIN_HEADER
CFF_Index string_index;
CFF_Index global_subrs_index;
/* we don't load the Encoding and CharSet tables */
CFF_Encoding encoding;
CFF_Charset charset;
CFF_Index charstrings_index;
CFF_Index font_dict_index;
CFF_Index private_index;
......
......@@ -18,18 +18,9 @@
/* */
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "ahglobal.h"
#include "ahglyph.h"
#else
#include <autohint/ahglobal.h>
#include <autohint/ahglyph.h>
#endif
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahglobal.h)
#include FT_SOURCE_FILE(autohint,ahglyph.h)
#define MAX_TEST_CHARACTERS 12
......
......@@ -20,26 +20,14 @@
/***************************************************************************/
#ifndef AHGLOBAL_H
#define AHGLOBAL_H
#ifndef __AHGLOBAL_H__
#define __AHGLOBAL_H__
#ifdef FT_FLAT_COMPILE
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahtypes.h)
#include FT_INTERNAL_OBJECTS_H
#include "ahtypes.h"
#else
#include <autohint/ahtypes.h>
#endif
#include <freetype/internal/ftobjs.h> /* for FT_LOCAL/FT_LOCAL_DEF */
#ifdef __cplusplus
extern "C" {
#endif
FT_BEGIN_HEADER
#define AH_IS_TOP_BLUE( b ) ( (b) == ah_blue_capital_top || \
......@@ -47,16 +35,13 @@
/* compute global metrics automatically */
FT_LOCAL
FT_Error ah_hinter_compute_globals( AH_Hinter* hinter );
FT_LOCAL FT_Error
ah_hinter_compute_globals( AH_Hinter* hinter );
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHGLOBAL_H */
#endif /* __AHGLOBAL_H__ */
/* END */
......@@ -19,23 +19,11 @@
/* */
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "ahglyph.h"
#include "ahangles.h"
#include "ahglobal.h"
#else
#include <autohint/ahglyph.h>
#include <autohint/ahangles.h>
#include <autohint/ahglobal.h>
#endif
#include <stdio.h>
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahglyph.h)
#include FT_SOURCE_FILE(autohint,ahangles.h)
#include FT_SOURCE_FILE(autohint,ahglobal.h)
#include <stdio.h>
#define xxxAH_DEBUG_GLYPH
......
......@@ -23,21 +23,10 @@
#ifndef AHGLYPH_H
#define AHGLYPH_H
#ifdef FT_FLAT_COMPILE
#include "ahtypes.h"
#else
#include <autohint/ahtypes.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahtypes.h)
FT_BEGIN_HEADER
typedef enum AH_UV_
{
......@@ -91,11 +80,7 @@
FT_LOCAL
void ah_outline_done( AH_Outline* outline );
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHGLYPH_H */
......
......@@ -18,22 +18,11 @@
/* */
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "ahhint.h"
#include "ahglyph.h"
#include "ahangles.h"
#else
#include <autohint/ahhint.h>
#include <autohint/ahglyph.h>
#include <autohint/ahangles.h>
#endif
#include <freetype/ftoutln.h>
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahhint.h)
#include FT_SOURCE_FILE(autohint,ahglyph.h)
#include FT_SOURCE_FILE(autohint,ahangles.h)
#include FT_OUTLINE_H
#define FACE_GLOBALS( face ) ((AH_Face_Globals*)(face)->autohint.data)
......
......@@ -22,22 +22,10 @@
#ifndef AHHINT_H
#define AHHINT_H
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahglobal.h)
#ifdef FT_FLAT_COMPILE
#include "ahglobal.h"
#else
#include <autohint/ahglobal.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
FT_BEGIN_HEADER
#define AH_HINT_DEFAULT 0
#define AH_HINT_NO_ALIGNMENT 1
......@@ -75,11 +63,7 @@
void ah_hinter_done_global_hints( AH_Hinter* hinter,
void* global_hints );
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHHINT_H */
......
......@@ -35,11 +35,9 @@
#ifndef AHLOADER_H
#define AHLOADER_H
#include <ft2build.h>
#ifdef __cplusplus
extern "C" {
#endif
FT_BEGIN_HEADER
#ifdef _STANDALONE_
......@@ -105,7 +103,7 @@
#else /* _STANDALONE */
#include <freetype/internal/ftobjs.h>
#include FT_INTERNAL_OBJECTS_H
#define AH_Load FT_GlyphLoad
#define AH_Loader FT_GlyphLoader
......@@ -123,11 +121,7 @@
#endif /* _STANDALONE_ */
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHLOADER_H */
......
......@@ -18,19 +18,9 @@
/* */
/***************************************************************************/
#include <freetype/ftmodule.h>
#ifdef FT_FLAT_COMPILE
#include "ahhint.h"
#else
#include <autohint/ahhint.h>
#endif
#include <ft2build.h>
#include FT_MODULE_H
#include FT_SOURCE_FILE(autohint,ahhint.h)
typedef struct FT_AutoHinterRec_
......
......@@ -22,20 +22,15 @@
#ifndef AHMODULE_H
#define AHMODULE_H
#include <freetype/ftmodule.h>
#include <ft2build.h>
#include FT_MODULE_H
#ifdef __cplusplus
extern "C" {
#endif
FT_BEGIN_HEADER
FT_CALLBACK_TABLE
const FT_Module_Class autohint_module_class;
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHMODULE_H */
......
......@@ -30,20 +30,9 @@
/* */
/*************************************************************************/
#include <freetype/internal/ftobjs.h> /* for ALLOC_ARRAY() and FREE() */
#ifdef FT_FLAT_COMPILE
#include "ahoptim.h"
#else
#include <autohint/ahoptim.h>
#endif
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H /* for ALLOC_ARRAY() and FREE() */
#include FT_SOURCE_FILE(autohint,ahoptim.h)
/* define this macro to use brute force optimisation -- this is slow, */
/* but a good way to perfect the distortion function `by hand' through */
......
......@@ -22,21 +22,10 @@
#ifndef AHOPTIM_H
#define AHOPTIM_H
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahtypes.h)
#ifdef FT_FLAT_COMPILE
#include "ahtypes.h"
#else
#include <autohint/ahtypes.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
FT_BEGIN_HEADER
/* the maximal number of stem configurations to record */
......@@ -135,10 +124,7 @@
void AH_Optimizer_Done( AH_Optimizer* optimizer );
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHOPTIM_H */
......
......@@ -23,41 +23,22 @@
#ifndef AHTYPES_H
#define AHTYPES_H
#include <freetype/internal/ftobjs.h> /* for freetype.h + FT_LOCAL etc. */
#ifdef FT_FLAT_COMPILE
#include "ahloader.h"
#else
#include <autohint/ahloader.h>
#endif
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_SOURCE_FILE(autohint,ahloader.h)
#define xxAH_DEBUG
#ifdef AH_DEBUG
#include <stdio.h>
#define AH_LOG( x ) printf##x
# include <stdio.h>
# define AH_LOG( x ) printf##x
#else
#define AH_LOG( x ) do ; while ( 0 ) /* nothing */
#endif
#ifdef __cplusplus
extern "C" {
# define AH_LOG( x ) do ; while ( 0 ) /* nothing */
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
......@@ -495,10 +476,7 @@
} AH_Hinter;
#ifdef __cplusplus
}
#endif
FT_END_HEADER
#endif /* AHTYPES_H */
......
......@@ -21,23 +21,11 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "ahangles.c"
#include "ahglyph.c"
#include "ahglobal.c"
#include "ahhint.c"
#include "ahmodule.c"
#else
#include <autohint/ahangles.c>
#include <autohint/ahglyph.c>
#include <autohint/ahglobal.c>
#include <autohint/ahhint.c>
#include <autohint/ahmodule.c>
#endif
#include <ft2build.h>
#include FT_SOURCE_FILE(autohint,ahangles.c)
#include FT_SOURCE_FILE(autohint,ahglyph.c)
#include FT_SOURCE_FILE(autohint,ahglobal.c)
#include FT_SOURCE_FILE(autohint,ahhint.c)
#include FT_SOURCE_FILE(autohint,ahmodule.c)
/* END */
......@@ -16,27 +16,14 @@
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "ftcalc.c"
#include "ftobjs.c"
#include "ftstream.c"
#include "ftlist.c"
#include "ftoutln.c"
#include "ftextend.c"
#include "ftnames.c"
#else /* FT_FLAT_COMPILE */
#include <base/ftcalc.c>
#include <base/ftobjs.c>
#include <base/ftstream.c>
#include <base/ftlist.c>
#include <base/ftoutln.c>
#include <base/ftextend.c>
#include <base/ftnames.c>
#endif /* FT_FLAT_COMPILE */
#include <ft2build.h>
#include FT_SOURCE_FILE(base,ftcalc.c)
#include FT_SOURCE_FILE(base,ftobjs.c)
#include FT_SOURCE_FILE(base,ftstream.c)
#include FT_SOURCE_FILE(base,ftlist.c)
#include FT_SOURCE_FILE(base,ftoutln.c)
#include FT_SOURCE_FILE(base,ftextend.c)
#include FT_SOURCE_FILE(base,ftnames.c)
/* END */
......@@ -23,10 +23,10 @@
/* */
/*************************************************************************/
#include <freetype/ftbbox.h>
#include <freetype/ftimage.h>
#include <freetype/ftoutln.h>
#include <ft2build.h>
#include FT_BBOX_H
#include FT_IMAGE_H
#include FT_OUTLINE_H
typedef struct TBBox_Rec_
......
......@@ -30,10 +30,10 @@
/* */
/*************************************************************************/
#include <freetype/internal/ftcalc.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftobjs.h> /* for ABS() */
#include <ft2build.h>
#include FT_INTERNAL_CALC_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
/*************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment