summaryrefslogtreecommitdiff
path: root/src/freetype2/autofit/aftypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/freetype2/autofit/aftypes.h')
-rw-r--r--src/freetype2/autofit/aftypes.h66
1 files changed, 60 insertions, 6 deletions
diff --git a/src/freetype2/autofit/aftypes.h b/src/freetype2/autofit/aftypes.h
index bd3fa88..5574f0c 100644
--- a/src/freetype2/autofit/aftypes.h
+++ b/src/freetype2/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, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,7 +58,8 @@ FT_BEGIN_HEADER
#ifdef AF_DEBUG
-#include <stdio.h>
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
#define AF_LOG( x ) do { if ( _af_debug ) printf x; } while ( 0 )
extern int _af_debug;
@@ -69,7 +70,7 @@ extern void* _af_debug_hints;
#else /* !AF_DEBUG */
-#define AF_LOG( x ) do ; while ( 0 ) /* nothing */
+#define AF_LOG( x ) do { } while ( 0 ) /* nothing */
#endif /* !AF_DEBUG */
@@ -202,7 +203,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 +261,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,
@@ -284,6 +285,7 @@ extern void* _af_debug_hints;
{
AF_ScriptClass clazz;
AF_ScalerRec scaler;
+ FT_Bool digits_have_same_width;
} AF_ScriptMetricsRec, *AF_ScriptMetrics;
@@ -320,6 +322,8 @@ extern void* _af_debug_hints;
} AF_Script_UniRangeRec;
+#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) }
+
typedef const AF_Script_UniRangeRec *AF_Script_UniRange;
@@ -328,7 +332,7 @@ extern void* _af_debug_hints;
AF_Script script;
AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
- FT_UInt script_metrics_size;
+ FT_Offset script_metrics_size;
AF_Script_InitMetricsFunc script_metrics_init;
AF_Script_ScaleMetricsFunc script_metrics_scale;
AF_Script_DoneMetricsFunc script_metrics_done;
@@ -338,6 +342,56 @@ extern void* _af_debug_hints;
} AF_ScriptClassRec;
+/* Declare and define vtables for classes */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define AF_DECLARE_SCRIPT_CLASS(script_class) \
+ FT_CALLBACK_TABLE const AF_ScriptClassRec \
+ script_class;
+
+#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size, \
+ m_init, m_scale, m_done, h_init, h_apply) \
+ FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec \
+ script_class = \
+ { \
+ script_, \
+ ranges, \
+ \
+ m_size, \
+ \
+ m_init, \
+ m_scale, \
+ m_done, \
+ \
+ h_init, \
+ h_apply \
+ };
+
+#else
+
+#define AF_DECLARE_SCRIPT_CLASS(script_class) \
+ FT_LOCAL(void) \
+ FT_Init_Class_##script_class(AF_ScriptClassRec* ac);
+
+#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size, \
+ m_init, m_scale, m_done, h_init, h_apply) \
+ FT_LOCAL_DEF(void) \
+ FT_Init_Class_##script_class(AF_ScriptClassRec* ac) \
+ { \
+ ac->script = script_; \
+ ac->script_uni_ranges = ranges; \
+ \
+ ac->script_metrics_size = m_size; \
+ \
+ ac->script_metrics_init = m_init; \
+ ac->script_metrics_scale = m_scale; \
+ ac->script_metrics_done = m_done; \
+ \
+ ac->script_hints_init = h_init; \
+ ac->script_hints_apply = h_apply; \
+ }
+#endif
+
/* */