summaryrefslogtreecommitdiffstats
path: root/src/autofit/aftypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/autofit/aftypes.h')
-rw-r--r--src/autofit/aftypes.h71
1 files changed, 40 insertions, 31 deletions
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index 78e3fd7..b483619 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -41,6 +41,10 @@
#include "afblue.h"
+#ifdef FT_DEBUG_AUTOFIT
+#include FT_CONFIG_STANDARD_LIBRARY_H
+#endif
+
FT_BEGIN_HEADER
@@ -54,8 +58,6 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_AUTOFIT
-#include FT_CONFIG_STANDARD_LIBRARY_H
-
extern int _af_debug_disable_horz_hints;
extern int _af_debug_disable_vert_hints;
extern int _af_debug_disable_blue_hints;
@@ -209,13 +211,19 @@ extern void* _af_debug_hints;
typedef void
(*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics metrics );
+ typedef void
+ (*AF_WritingSystem_GetStdWidthsFunc)( AF_StyleMetrics metrics,
+ FT_Pos* stdHW,
+ FT_Pos* stdVW );
+
typedef FT_Error
(*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints,
AF_StyleMetrics metrics );
typedef void
- (*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints hints,
+ (*AF_WritingSystem_ApplyHintsFunc)( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_StyleMetrics metrics );
@@ -273,6 +281,7 @@ extern void* _af_debug_hints;
AF_WritingSystem_InitMetricsFunc style_metrics_init;
AF_WritingSystem_ScaleMetricsFunc style_metrics_scale;
AF_WritingSystem_DoneMetricsFunc style_metrics_done;
+ AF_WritingSystem_GetStdWidthsFunc style_metrics_getstdw;
AF_WritingSystem_InitHintsFunc style_hints_init;
AF_WritingSystem_ApplyHintsFunc style_hints_apply;
@@ -291,15 +300,16 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * Each script is associated with a set of Unicode ranges that gets used
- * to test whether the font face supports the script.
+ * Each script is associated with two sets of Unicode ranges to test
+ * whether the font face supports the script, and which non-base
+ * characters the script contains.
*
* We use four-letter script tags from the OpenType specification,
* extended by `NONE', which indicates `no script'.
*/
#undef SCRIPT
-#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
+#define SCRIPT( s, S, d, h, ss ) \
AF_SCRIPT_ ## S,
/* The list of known scripts. */
@@ -329,11 +339,11 @@ extern void* _af_debug_hints;
{
AF_Script script;
- AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
+ /* last element in the ranges must be { 0, 0 } */
+ AF_Script_UniRange script_uni_ranges;
+ AF_Script_UniRange script_uni_nonbase_ranges;
- FT_UInt32 standard_char1; /* for default width and height */
- FT_UInt32 standard_char2; /* ditto */
- FT_UInt32 standard_char3; /* ditto */
+ const char* standard_charstring; /* for default width and height */
} AF_ScriptClassRec;
@@ -483,6 +493,7 @@ extern void* _af_debug_hints;
m_init, \
m_scale, \
m_done, \
+ m_stdw, \
h_init, \
h_apply ) \
FT_CALLBACK_TABLE_DEF \
@@ -495,6 +506,7 @@ extern void* _af_debug_hints;
m_init, \
m_scale, \
m_done, \
+ m_stdw, \
\
h_init, \
h_apply \
@@ -509,17 +521,15 @@ extern void* _af_debug_hints;
script_class, \
script, \
ranges, \
- std_char1, \
- std_char2, \
- std_char3 ) \
+ nonbase_ranges, \
+ std_charstring ) \
FT_CALLBACK_TABLE_DEF \
const AF_ScriptClassRec script_class = \
{ \
script, \
ranges, \
- std_char1, \
- std_char2, \
- std_char3 \
+ nonbase_ranges, \
+ std_charstring, \
};
@@ -562,16 +572,17 @@ extern void* _af_debug_hints;
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \
{ \
- ac->writing_system = system; \
+ ac->writing_system = system; \
\
- ac->style_metrics_size = m_size; \
+ ac->style_metrics_size = m_size; \
\
- ac->style_metrics_init = m_init; \
- ac->style_metrics_scale = m_scale; \
- ac->style_metrics_done = m_done; \
+ ac->style_metrics_init = m_init; \
+ ac->style_metrics_scale = m_scale; \
+ ac->style_metrics_done = m_done; \
+ ac->style_metrics_getstdw = m_stdw; \
\
- ac->style_hints_init = h_init; \
- ac->style_hints_apply = h_apply; \
+ ac->style_hints_init = h_init; \
+ ac->style_hints_apply = h_apply; \
}
@@ -583,17 +594,15 @@ extern void* _af_debug_hints;
script_class, \
script_, \
ranges, \
- std_char1, \
- std_char2, \
- std_char3 ) \
+ nonbase_ranges, \
+ std_charstring ) \
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
{ \
- ac->script = script_; \
- ac->script_uni_ranges = ranges; \
- ac->standard_char1 = std_char1; \
- ac->standard_char2 = std_char2; \
- ac->standard_char3 = std_char3; \
+ ac->script = script_; \
+ ac->script_uni_ranges = ranges; \
+ ac->script_uni_nonbase_ranges = nonbase_ranges; \
+ ac->standard_charstring = std_charstring; \
}