aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/autofit
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/src/autofit')
-rw-r--r--freetype/src/autofit/afcjk.c12
-rw-r--r--freetype/src/autofit/aferrors.h3
-rw-r--r--freetype/src/autofit/afloader.c19
-rw-r--r--freetype/src/autofit/afloader.h4
-rw-r--r--freetype/src/autofit/afpic.c10
-rw-r--r--freetype/src/autofit/afpic.h13
6 files changed, 40 insertions, 21 deletions
diff --git a/freetype/src/autofit/afcjk.c b/freetype/src/autofit/afcjk.c
index 0acef9c85..8e407c86c 100644
--- a/freetype/src/autofit/afcjk.c
+++ b/freetype/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/freetype/src/autofit/aferrors.h b/freetype/src/autofit/aferrors.h
index c2ed5fe2a..50e1a22dd 100644
--- a/freetype/src/autofit/aferrors.h
+++ b/freetype/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/freetype/src/autofit/afloader.c b/freetype/src/autofit/afloader.c
index 966a0df73..34ef9d809 100644
--- a/freetype/src/autofit/afloader.c
+++ b/freetype/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/freetype/src/autofit/afloader.h b/freetype/src/autofit/afloader.h
index 3f91e1a22..eec0e9271 100644
--- a/freetype/src/autofit/afloader.h
+++ b/freetype/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/freetype/src/autofit/afpic.c b/freetype/src/autofit/afpic.c
index 3aefbc51c..87074afcf 100644
--- a/freetype/src/autofit/afpic.c
+++ b/freetype/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/freetype/src/autofit/afpic.h b/freetype/src/autofit/afpic.h
index c1632e76e..21b0ff988 100644
--- a/freetype/src/autofit/afpic.h
+++ b/freetype/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 */
/* */