summaryrefslogtreecommitdiffstats
path: root/src/autofit
diff options
context:
space:
mode:
Diffstat (limited to 'src/autofit')
-rw-r--r--src/autofit/afcjk.c12
-rw-r--r--src/autofit/afdummy.c2
-rw-r--r--src/autofit/aferrors.h3
-rw-r--r--src/autofit/afglobal.c2
-rw-r--r--src/autofit/afindic.c8
-rw-r--r--src/autofit/aflatin.c4
-rw-r--r--src/autofit/aflatin2.c10
-rw-r--r--src/autofit/afloader.c19
-rw-r--r--src/autofit/afloader.h4
-rw-r--r--src/autofit/afpic.c10
-rw-r--r--src/autofit/afpic.h13
-rw-r--r--src/autofit/aftypes.h2
-rw-r--r--src/autofit/afwarp.c2
13 files changed, 55 insertions, 36 deletions
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 0acef9c..8e407c8 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK script (body). */
/* */
-/* Copyright 2006-2011 by */
+/* Copyright 2006-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1610,7 +1610,7 @@
goto Exit;
}
- offset = cur_len % 64;
+ offset = cur_len & 63;
if ( offset < 32 )
{
@@ -2225,11 +2225,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
AF_SCRIPT_CJK,
af_cjk_uniranges,
- sizeof( AF_CJKMetricsRec ),
+ sizeof ( AF_CJKMetricsRec ),
(AF_Script_InitMetricsFunc) af_cjk_metrics_init,
(AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale,
@@ -2247,11 +2247,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
AF_SCRIPT_CJK,
af_cjk_uniranges,
- sizeof( AF_CJKMetricsRec ),
+ sizeof ( AF_CJKMetricsRec ),
(AF_Script_InitMetricsFunc) NULL,
(AF_Script_ScaleMetricsFunc)NULL,
diff --git a/src/autofit/afdummy.c b/src/autofit/afdummy.c
index c712651..4bf278c 100644
--- a/src/autofit/afdummy.c
+++ b/src/autofit/afdummy.c
@@ -47,7 +47,7 @@
AF_SCRIPT_NONE,
NULL,
- sizeof( AF_ScriptMetricsRec ),
+ sizeof ( AF_ScriptMetricsRec ),
(AF_Script_InitMetricsFunc) NULL,
(AF_Script_ScaleMetricsFunc)NULL,
diff --git a/src/autofit/aferrors.h b/src/autofit/aferrors.h
index c2ed5fe..50e1a22 100644
--- a/src/autofit/aferrors.h
+++ b/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
/* */
/* Autofitter error codes (specification only). */
/* */
-/* Copyright 2005 by */
+/* Copyright 2005, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,6 +30,7 @@
#undef __FTERRORS_H__
+#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX AF_Err_
#define FT_ERR_BASE FT_Mod_Err_Autofit
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index 3c5f02e..3e0c02d 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -43,7 +43,7 @@
#endif
&af_latin_script_class,
&af_cjk_script_class,
- &af_indic_script_class,
+ &af_indic_script_class,
NULL /* do not remove */
};
diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c
index c232cff..9c74838 100644
--- a/src/autofit/afindic.c
+++ b/src/autofit/afindic.c
@@ -113,11 +113,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
AF_SCRIPT_INDIC,
af_indic_uniranges,
- sizeof( AF_CJKMetricsRec ),
+ sizeof ( AF_CJKMetricsRec ),
(AF_Script_InitMetricsFunc) af_indic_metrics_init,
(AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
@@ -135,11 +135,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
AF_SCRIPT_INDIC,
af_indic_uniranges,
- sizeof( AF_CJKMetricsRec ),
+ sizeof ( AF_CJKMetricsRec ),
(AF_Script_InitMetricsFunc) NULL,
(AF_Script_ScaleMetricsFunc)NULL,
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 54fcf7f..30145a2 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -2341,11 +2341,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_latin_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_latin_script_class,
AF_SCRIPT_LATIN,
af_latin_uniranges,
- sizeof( AF_LatinMetricsRec ),
+ sizeof ( AF_LatinMetricsRec ),
(AF_Script_InitMetricsFunc) af_latin_metrics_init,
(AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 23558b8..ea6af8d 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -133,7 +133,7 @@
dist = -dist;
if ( num_widths < AF_LATIN_MAX_WIDTHS )
- axis->widths[ num_widths++ ].org = dist;
+ axis->widths[num_widths++].org = dist;
}
}
@@ -1359,10 +1359,10 @@
af_latin2_hints_compute_blue_edges( AF_GlyphHints hints,
AF_LatinMetrics metrics )
{
- AF_AxisHints axis = &hints->axis[ AF_DIMENSION_VERT ];
+ AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT];
AF_Edge edge = axis->edges;
AF_Edge edge_limit = edge + axis->num_edges;
- AF_LatinAxis latin = &metrics->axis[ AF_DIMENSION_VERT ];
+ AF_LatinAxis latin = &metrics->axis[AF_DIMENSION_VERT];
FT_Fixed scale = latin->scale;
FT_Pos best_dist0; /* initial threshold */
@@ -2356,11 +2356,11 @@
};
- AF_DEFINE_SCRIPT_CLASS(af_latin2_script_class,
+ AF_DEFINE_SCRIPT_CLASS( af_latin2_script_class,
AF_SCRIPT_LATIN2,
af_latin2_uniranges,
- sizeof( AF_LatinMetricsRec ),
+ sizeof ( AF_LatinMetricsRec ),
(AF_Script_InitMetricsFunc) af_latin2_metrics_init,
(AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale,
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index 966a0df..34ef9d8 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003-2009, 2011 by */
+/* Copyright 2003-2009, 2011-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -433,9 +433,10 @@
slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
x_scale );
#else
- if ( FT_IS_FIXED_WIDTH( slot->face ) ||
- ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
- metrics->digits_have_same_width ) )
+ if ( scaler->render_mode != FT_RENDER_MODE_LIGHT &&
+ ( FT_IS_FIXED_WIDTH( slot->face ) ||
+ ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
+ metrics->digits_have_same_width ) ) )
{
slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
metrics->scaler.x_scale );
@@ -465,7 +466,13 @@
if ( error )
goto Exit;
- slot->outline = internal->loader->base.outline;
+ /* reassign all outline fields except flags to protect them */
+ slot->outline.n_contours = internal->loader->base.outline.n_contours;
+ slot->outline.n_points = internal->loader->base.outline.n_points;
+ slot->outline.points = internal->loader->base.outline.points;
+ slot->outline.tags = internal->loader->base.outline.tags;
+ slot->outline.contours = internal->loader->base.outline.contours;
+
slot->format = FT_GLYPH_FORMAT_OUTLINE;
}
@@ -480,7 +487,7 @@
af_loader_load_glyph( AF_Loader loader,
FT_Face face,
FT_UInt gindex,
- FT_UInt32 load_flags )
+ FT_Int32 load_flags )
{
FT_Error error;
FT_Size size = face->size;
diff --git a/src/autofit/afloader.h b/src/autofit/afloader.h
index 3f91e1a..eec0e92 100644
--- a/src/autofit/afloader.h
+++ b/src/autofit/afloader.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (specification). */
/* */
-/* Copyright 2003-2005, 2011 by */
+/* Copyright 2003-2005, 2011-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -60,7 +60,7 @@ FT_BEGIN_HEADER
af_loader_load_glyph( AF_Loader loader,
FT_Face face,
FT_UInt gindex,
- FT_UInt32 load_flags );
+ FT_Int32 load_flags );
/* */
diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c
index 3aefbc5..87074af 100644
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -20,16 +20,20 @@
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "afpic.h"
+#include "aferrors.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from afmodule.c */
- void FT_Init_Class_af_autofitter_service( FT_Library,
- FT_AutoHinter_ServiceRec* );
+ void FT_Init_Class_af_autofitter_service(
+ FT_Library library,
+ FT_AutoHinter_ServiceRec* clazz );
/* forward declaration of PIC init functions from script classes */
#include "aflatin.h"
+#ifdef FT_OPTION_AUTOFIT2
#include "aflatin2.h"
+#endif
#include "afcjk.h"
#include "afdummy.h"
#include "afindic.h"
@@ -73,7 +77,7 @@
&container->af_script_classes_rec[ss];
}
container->af_script_classes[AF_SCRIPT_CLASSES_COUNT - 1] = NULL;
-
+
/* add call to initialization function when you add new scripts */
ss = 0;
FT_Init_Class_af_dummy_script_class(
diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h
index c1632e7..21b0ff9 100644
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -19,7 +19,7 @@
#ifndef __AFPIC_H__
#define __AFPIC_H__
-
+
FT_BEGIN_HEADER
#include FT_INTERNAL_PIC_H
@@ -38,9 +38,9 @@ FT_BEGIN_HEADER
#ifdef FT_OPTION_AUTOFIT2
#define AF_SCRIPT_CLASSES_COUNT 6
#else
-#define AF_SCRIPT_CLASSES_COUNT 5
+#define AF_SCRIPT_CLASSES_COUNT 5
#endif
-#define AF_SCRIPT_CLASSES_REC_COUNT ( AF_SCRIPT_CLASSES_COUNT - 1 )
+#define AF_SCRIPT_CLASSES_REC_COUNT ( AF_SCRIPT_CLASSES_COUNT - 1 )
typedef struct AFModulePIC_
{
@@ -57,6 +57,13 @@ FT_BEGIN_HEADER
#define AF_AF_AUTOFITTER_SERVICE_GET \
( GET_PIC( library )->af_autofitter_service )
+ /* see afpic.c for the implementation */
+ void
+ autofit_module_class_pic_free( FT_Library library );
+
+ FT_Error
+ autofit_module_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index 44997d1..21e442c 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -231,7 +231,7 @@ extern void* _af_debug_hints;
AF_SCRIPT_NONE = 0,
AF_SCRIPT_LATIN = 1,
AF_SCRIPT_CJK = 2,
- AF_SCRIPT_INDIC = 3,
+ AF_SCRIPT_INDIC = 3,
#ifdef FT_OPTION_AUTOFIT2
AF_SCRIPT_LATIN2,
#endif
diff --git a/src/autofit/afwarp.c b/src/autofit/afwarp.c
index d0d4850..34a97ff 100644
--- a/src/autofit/afwarp.c
+++ b/src/autofit/afwarp.c
@@ -352,7 +352,7 @@
{
FT_Fixed best_scale = warper->best_scale;
FT_Pos best_delta = warper->best_delta;
-
+
hints->xmin_delta = FT_MulFix( X1, best_scale - org_scale )
+ best_delta;