summaryrefslogtreecommitdiffstats
path: root/src/autofit
diff options
context:
space:
mode:
Diffstat (limited to 'src/autofit')
-rw-r--r--src/autofit/Jamfile39
-rw-r--r--src/autofit/afcjk.c12
-rw-r--r--src/autofit/afcjk.h19
-rw-r--r--src/autofit/afglobal.c6
-rw-r--r--src/autofit/afhints.h10
-rw-r--r--src/autofit/afindic.c8
-rw-r--r--src/autofit/aflatin.c8
-rw-r--r--src/autofit/afloader.c19
-rw-r--r--src/autofit/aftypes.h6
-rw-r--r--src/autofit/module.mk23
-rw-r--r--src/autofit/rules.mk78
11 files changed, 57 insertions, 171 deletions
diff --git a/src/autofit/Jamfile b/src/autofit/Jamfile
deleted file mode 100644
index acee8bf..0000000
--- a/src/autofit/Jamfile
+++ /dev/null
@@ -1,39 +0,0 @@
-# FreeType 2 src/autofit Jamfile
-#
-# Copyright 2003, 2004, 2005, 2006, 2007 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.
-
-SubDir FT2_TOP src autofit ;
-
-{
- local _sources ;
-
- # define FT2_AUTOFIT2 do enable to experimental latin hinter replacement
- if $(FT2_AUTOFIT2)
- {
- DEFINES += FT_OPTION_AUTOFIT2 ;
- }
- if $(FT2_MULTI)
- {
- _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp ;
-
- if $(FT2_AUTOFIT2)
- {
- _sources += aflatin2 ;
- }
- }
- else
- {
- _sources = autofit ;
- }
-
- Library $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/autofit Jamfile
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index c7ca266..7e9438b 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -45,7 +45,7 @@
/*************************************************************************/
/*************************************************************************/
- static FT_Error
+ FT_LOCAL_DEF( FT_Error )
af_cjk_metrics_init( AF_LatinMetrics metrics,
FT_Face face )
{
@@ -91,7 +91,7 @@
}
- static void
+ FT_LOCAL_DEF( void )
af_cjk_metrics_scale( AF_LatinMetrics metrics,
AF_Scaler scaler )
{
@@ -427,7 +427,9 @@
/* insert a new edge in the list and */
/* sort according to the position */
- error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+ error = af_axis_hints_new_edge( axis, seg->pos,
+ (AF_Direction)seg->dir,
+ memory, &edge );
if ( error )
goto Exit;
@@ -596,7 +598,7 @@
}
- static FT_Error
+ FT_LOCAL_DEF( FT_Error )
af_cjk_hints_init( AF_GlyphHints hints,
AF_LatinMetrics metrics )
{
@@ -1350,7 +1352,7 @@
}
- static FT_Error
+ FT_LOCAL_DEF( FT_Error )
af_cjk_hints_apply( AF_GlyphHints hints,
FT_Outline* outline,
AF_LatinMetrics metrics )
diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h
index 0de4a5a..9f77fda 100644
--- a/src/autofit/afcjk.h
+++ b/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK script (specification). */
/* */
-/* Copyright 2006 by */
+/* Copyright 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,6 +31,23 @@ FT_BEGIN_HEADER
af_cjk_script_class;
+ FT_LOCAL( FT_Error )
+ af_cjk_metrics_init( AF_LatinMetrics metrics,
+ FT_Face face );
+
+ FT_LOCAL( void )
+ af_cjk_metrics_scale( AF_LatinMetrics metrics,
+ AF_Scaler scaler );
+
+ FT_LOCAL( FT_Error )
+ af_cjk_hints_init( AF_GlyphHints hints,
+ AF_LatinMetrics metrics );
+
+ FT_LOCAL( FT_Error )
+ af_cjk_hints_apply( AF_GlyphHints hints,
+ FT_Outline* outline,
+ AF_LatinMetrics metrics );
+
/* */
FT_END_HEADER
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index ad3baa1..bfb9091 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter routines to compute global hinting values (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -84,8 +84,8 @@
if ( error )
{
/*
- * Ignore this error; we simply use Latin as the standard
- * script. XXX: Shouldn't we rather disable hinting?
+ * Ignore this error; we simply use the default script.
+ * XXX: Shouldn't we rather disable hinting?
*/
error = AF_Err_Ok;
goto Exit;
diff --git a/src/autofit/afhints.h b/src/autofit/afhints.h
index 1308d5c..6758268 100644
--- a/src/autofit/afhints.h
+++ b/src/autofit/afhints.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (specification). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,7 +30,7 @@ FT_BEGIN_HEADER
* script analysis routines (until now).
*/
- typedef enum
+ typedef enum AF_Dimension_
{
AF_DIMENSION_HORZ = 0, /* x coordinates, */
/* i.e., vertical segments & edges */
@@ -44,7 +44,7 @@ FT_BEGIN_HEADER
/* hint directions -- the values are computed so that two vectors are */
/* in opposite directions iff `dir1 + dir2 == 0' */
- typedef enum
+ typedef enum AF_Direction_
{
AF_DIR_NONE = 4,
AF_DIR_RIGHT = 1,
@@ -56,7 +56,7 @@ FT_BEGIN_HEADER
/* point hint flags */
- typedef enum
+ typedef enum AF_Flags_
{
AF_FLAG_NONE = 0,
@@ -87,7 +87,7 @@ FT_BEGIN_HEADER
/* edge hint flags */
- typedef enum
+ typedef enum AF_Edge_Flags_
{
AF_EDGE_NORMAL = 0,
AF_EDGE_ROUND = 1 << 0,
diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c
index c6e7522..3d27f52 100644
--- a/src/autofit/afindic.c
+++ b/src/autofit/afindic.c
@@ -43,7 +43,7 @@
static void
af_indic_metrics_scale( AF_LatinMetrics metrics,
- AF_Scaler scaler )
+ AF_Scaler scaler )
{
/* use CJK routines */
af_cjk_metrics_scale( metrics, scaler );
@@ -52,7 +52,7 @@
static FT_Error
af_indic_hints_init( AF_GlyphHints hints,
- AF_LatinMetrics metrics )
+ AF_LatinMetrics metrics )
{
/* use CJK routines */
return af_cjk_hints_init( hints, metrics );
@@ -61,8 +61,8 @@
static FT_Error
af_indic_hints_apply( AF_GlyphHints hints,
- FT_Outline* outline,
- AF_LatinMetrics metrics)
+ FT_Outline* outline,
+ AF_LatinMetrics metrics)
{
/* use CJK routines */
return af_cjk_hints_apply( hints, outline, metrics );
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 2ae9ec5..b70da06 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -197,7 +197,7 @@
FT_UInt glyph_index;
FT_Int best_point, best_y, best_first, best_last;
FT_Vector* points;
- FT_Bool round;
+ FT_Bool round = 0;
AF_LOG(( "'%c'", *p ));
@@ -1004,12 +1004,14 @@
if ( !found )
{
- AF_Edge edge;
+ AF_Edge edge;
/* insert a new edge in the list and */
/* sort according to the position */
- error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+ error = af_axis_hints_new_edge( axis, seg->pos,
+ (AF_Direction)seg->dir,
+ memory, &edge );
if ( error )
goto Exit;
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index 4e4373a..4e48c2f 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -165,9 +165,10 @@
/* now load the slot image into the auto-outline and run the */
/* automatic hinting process */
- metrics->clazz->script_hints_apply( hints,
- &gloader->current.outline,
- metrics );
+ if ( metrics->clazz->script_hints_apply )
+ metrics->clazz->script_hints_apply( hints,
+ &gloader->current.outline,
+ metrics );
/* we now need to hint the metrics according to the change in */
/* width/positioning that occurred during the hinting process */
@@ -515,9 +516,13 @@
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
load_flags &= ~FT_LOAD_RENDER;
- error = metrics->clazz->script_hints_init( &loader->hints, metrics );
- if ( error )
- goto Exit;
+ if ( metrics->clazz->script_hints_init )
+ {
+ error = metrics->clazz->script_hints_init( &loader->hints,
+ metrics );
+ if ( error )
+ goto Exit;
+ }
error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );
}
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index bd3fa88..56811f0 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter types (specification only). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -202,7 +202,7 @@ extern void* _af_debug_hints;
* auto-hinted glyph image.
*/
- typedef enum
+ typedef enum AF_ScalerFlags_
{
AF_SCALER_FLAG_NO_HORIZONTAL = 1, /* disable horizontal hinting */
AF_SCALER_FLAG_NO_VERTICAL = 2, /* disable vertical hinting */
@@ -260,7 +260,7 @@ extern void* _af_debug_hints;
* used by more than one script.
*/
- typedef enum
+ typedef enum AF_Script_
{
AF_SCRIPT_NONE = 0,
AF_SCRIPT_LATIN = 1,
diff --git a/src/autofit/module.mk b/src/autofit/module.mk
deleted file mode 100644
index 4a386ce..0000000
--- a/src/autofit/module.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# FreeType 2 auto-fitter module definition
-#
-
-
-# Copyright 2003, 2004, 2005, 2006 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.
-
-
-FTMODULE_H_COMMANDS += AUTOFIT_MODULE
-
-define AUTOFIT_MODULE
-$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
-$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
-endef
-
-# EOF
diff --git a/src/autofit/rules.mk b/src/autofit/rules.mk
deleted file mode 100644
index 017489d..0000000
--- a/src/autofit/rules.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# FreeType 2 auto-fitter module configuration rules
-#
-
-
-# Copyright 2003, 2004, 2005, 2006, 2007 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.
-
-
-# AUTOF driver directory
-#
-AUTOF_DIR := $(SRC_DIR)/autofit
-
-
-# compilation flags for the driver
-#
-AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))
-
-
-# AUTOF driver sources (i.e., C files)
-#
-AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
- $(AUTOF_DIR)/afcjk.c \
- $(AUTOF_DIR)/afdummy.c \
- $(AUTOF_DIR)/afglobal.c \
- $(AUTOF_DIR)/afhints.c \
- $(AUTOF_DIR)/afindic.c \
- $(AUTOF_DIR)/aflatin.c \
- $(AUTOF_DIR)/afloader.c \
- $(AUTOF_DIR)/afmodule.c \
- $(AUTOF_DIR)/afwarp.c
-
-# AUTOF driver headers
-#
-AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \
- $(AUTOF_DIR)/aftypes.h \
- $(AUTOF_DIR)/aferrors.h
-
-
-# AUTOF driver object(s)
-#
-# AUTOF_DRV_OBJ_M is used during `multi' builds.
-# AUTOF_DRV_OBJ_S is used during `single' builds.
-#
-AUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O)
-AUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O
-
-# AUTOF driver source file for single build
-#
-AUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c
-
-
-# AUTOF driver - single object
-#
-$(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \
- $(FREETYPE_H) $(AUTOF_DRV_H)
- $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S))
-
-
-# AUTOF driver - multiple objects
-#
-$(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H)
- $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
-
-
-# update main driver object lists
-#
-DRV_OBJS_S += $(AUTOF_DRV_OBJ_S)
-DRV_OBJS_M += $(AUTOF_DRV_OBJ_M)
-
-
-# EOF