2005-03-03 18:09:08 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* aftypes.h */
|
|
|
|
/* */
|
|
|
|
/* Auto-fitter types (specification only). */
|
|
|
|
/* */
|
2013-07-31 22:49:29 +02:00
|
|
|
/* Copyright 2003-2009, 2011-2013 by */
|
2005-03-03 18:09:08 +01:00
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2006-02-10 23:15:22 +01:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
|
|
|
* Its main feature is the ability to differentiate between different
|
2013-07-31 22:49:29 +02:00
|
|
|
* writing systems in order to apply script-specific rules.
|
2006-02-10 23:15:22 +01:00
|
|
|
*
|
2007-01-31 00:08:50 +01:00
|
|
|
* The code has also been compartmentized into several entities that
|
2006-02-10 23:15:22 +01:00
|
|
|
* should make algorithmic experimentation easier than with the old
|
|
|
|
* code.
|
|
|
|
*
|
|
|
|
*************************************************************************/
|
2005-03-03 18:09:08 +01:00
|
|
|
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
#ifndef __AFTYPES_H__
|
|
|
|
#define __AFTYPES_H__
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
#include FT_FREETYPE_H
|
|
|
|
#include FT_OUTLINE_H
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
#include FT_INTERNAL_DEBUG_H
|
|
|
|
|
2013-08-25 08:23:22 +02:00
|
|
|
#include "afblue.h"
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** D E B U G G I N G *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2011-04-18 19:05:28 +02:00
|
|
|
#ifdef FT_DEBUG_AUTOFIT
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2009-01-13 18:34:48 +01:00
|
|
|
#include FT_CONFIG_STANDARD_LIBRARY_H
|
|
|
|
|
2006-11-03 10:40:12 +01:00
|
|
|
extern int _af_debug_disable_horz_hints;
|
|
|
|
extern int _af_debug_disable_vert_hints;
|
|
|
|
extern int _af_debug_disable_blue_hints;
|
2006-11-02 17:37:35 +01:00
|
|
|
extern void* _af_debug_hints;
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2011-04-18 19:05:28 +02:00
|
|
|
#endif /* FT_DEBUG_AUTOFIT */
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** U T I L I T Y S T U F F *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
typedef struct AF_WidthRec_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
|
|
|
FT_Pos org; /* original position/width in font units */
|
|
|
|
FT_Pos cur; /* current/scaled position/width in device sub-pixels */
|
|
|
|
FT_Pos fit; /* current/fitted position/width in device sub-pixels */
|
|
|
|
|
|
|
|
} AF_WidthRec, *AF_Width;
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL( void )
|
2005-03-03 18:09:08 +01:00
|
|
|
af_sort_pos( FT_UInt count,
|
|
|
|
FT_Pos* table );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
FT_LOCAL( void )
|
2012-07-03 11:54:12 +02:00
|
|
|
af_sort_and_quantize_widths( FT_UInt* count,
|
|
|
|
AF_Width widths,
|
|
|
|
FT_Pos threshold );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** A N G L E T Y P E S *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The auto-fitter doesn't need a very high angular accuracy;
|
|
|
|
* this allows us to speed up some computations considerably with a
|
|
|
|
* light Cordic algorithm (see afangles.c).
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef FT_Int AF_Angle;
|
|
|
|
|
|
|
|
|
|
|
|
#define AF_ANGLE_PI 256
|
|
|
|
#define AF_ANGLE_2PI ( AF_ANGLE_PI * 2 )
|
|
|
|
#define AF_ANGLE_PI2 ( AF_ANGLE_PI / 2 )
|
|
|
|
#define AF_ANGLE_PI4 ( AF_ANGLE_PI / 4 )
|
|
|
|
|
|
|
|
|
* include/freetype/internal/tttypes.h, src/autofit/afangles.c,
src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
src/autofit/aftypes.h, src/base/ftcalc.c, src/base/ftoutln.c,
src/gzip/ftgzip.c, src/psaux/psconv.c, src/truetype/ttgload.c,
src/type1/t1gload.c:
this is a major patch used to drastically improve the performance
of loading glyphs. This both speeds up loading the glypn vector
themselves and the auto-fitter.
note that we've started using inline assembler with GCC to
implement FT_MulFix, given that this function is so damn
important for the engine's performance.
the resulting speed-up is about 25%.
2006-05-17 15:34:21 +02:00
|
|
|
#if 0
|
2005-03-03 18:09:08 +01:00
|
|
|
/*
|
|
|
|
* compute the angle of a given 2-D vector
|
|
|
|
*/
|
2004-03-27 09:43:17 +01:00
|
|
|
FT_LOCAL( AF_Angle )
|
|
|
|
af_angle_atan( FT_Pos dx,
|
|
|
|
FT_Pos dy );
|
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*
|
|
|
|
* compute `angle2 - angle1'; the result is always within
|
|
|
|
* the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
|
|
|
|
*/
|
2004-03-27 09:43:17 +01:00
|
|
|
FT_LOCAL( AF_Angle )
|
|
|
|
af_angle_diff( AF_Angle angle1,
|
|
|
|
AF_Angle angle2 );
|
2005-11-11 16:49:14 +01:00
|
|
|
#endif /* 0 */
|
|
|
|
|
|
|
|
|
|
|
|
#define AF_ANGLE_DIFF( result, angle1, angle2 ) \
|
|
|
|
FT_BEGIN_STMNT \
|
|
|
|
AF_Angle _delta = (angle2) - (angle1); \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
_delta %= AF_ANGLE_2PI; \
|
|
|
|
if ( _delta < 0 ) \
|
|
|
|
_delta += AF_ANGLE_2PI; \
|
|
|
|
\
|
|
|
|
if ( _delta > AF_ANGLE_PI ) \
|
|
|
|
_delta -= AF_ANGLE_2PI; \
|
|
|
|
\
|
|
|
|
result = _delta; \
|
2005-10-28 18:14:14 +02:00
|
|
|
FT_END_STMNT
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-11-11 16:49:14 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/* opaque handle to glyph-specific hints -- see `afhints.h' for more
|
|
|
|
* details
|
|
|
|
*/
|
|
|
|
typedef struct AF_GlyphHintsRec_* AF_GlyphHints;
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** S C A L E R S *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*
|
|
|
|
* A scaler models the target pixel device that will receive the
|
|
|
|
* auto-hinted glyph image.
|
|
|
|
*/
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2008-05-29 00:17:28 +02:00
|
|
|
typedef enum AF_ScalerFlags_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
|
|
|
AF_SCALER_FLAG_NO_HORIZONTAL = 1, /* disable horizontal hinting */
|
|
|
|
AF_SCALER_FLAG_NO_VERTICAL = 2, /* disable vertical hinting */
|
|
|
|
AF_SCALER_FLAG_NO_ADVANCE = 4 /* disable advance hinting */
|
|
|
|
|
|
|
|
} AF_ScalerFlags;
|
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef struct AF_ScalerRec_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
2005-03-03 18:09:08 +01:00
|
|
|
FT_Face face; /* source font face */
|
|
|
|
FT_Fixed x_scale; /* from font units to 1/64th device pixels */
|
|
|
|
FT_Fixed y_scale; /* from font units to 1/64th device pixels */
|
|
|
|
FT_Pos x_delta; /* in 1/64th device pixels */
|
|
|
|
FT_Pos y_delta; /* in 1/64th device pixels */
|
|
|
|
FT_Render_Mode render_mode; /* monochrome, anti-aliased, LCD, etc. */
|
|
|
|
FT_UInt32 flags; /* additional control flags, see above */
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
} AF_ScalerRec, *AF_Scaler;
|
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
#define AF_SCALER_EQUAL_SCALES( a, b ) \
|
|
|
|
( (a)->x_scale == (b)->x_scale && \
|
|
|
|
(a)->y_scale == (b)->y_scale && \
|
|
|
|
(a)->x_delta == (b)->x_delta && \
|
|
|
|
(a)->y_delta == (b)->y_delta )
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
2013-07-31 22:49:29 +02:00
|
|
|
/***** S C R I P T M E T R I C S *****/
|
2005-03-03 18:09:08 +01:00
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
/* This is the main structure which combines writing systems and script */
|
|
|
|
/* data (for a given face object, see below). */
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
typedef struct AF_WritingSystemClassRec_ const* AF_WritingSystemClass;
|
|
|
|
typedef struct AF_ScriptClassRec_ const* AF_ScriptClass;
|
|
|
|
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef struct AF_ScriptMetricsRec_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
2013-07-30 23:17:04 +02:00
|
|
|
AF_ScriptClass script_class;
|
2005-03-03 18:09:08 +01:00
|
|
|
AF_ScalerRec scaler;
|
2009-04-27 19:40:35 +02:00
|
|
|
FT_Bool digits_have_same_width;
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2012-09-18 15:23:41 +02:00
|
|
|
AF_FaceGlobals globals; /* to access properties */
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
} AF_ScriptMetricsRec, *AF_ScriptMetrics;
|
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/* This function parses an FT_Face to compute global metrics for
|
|
|
|
* a specific script.
|
|
|
|
*/
|
|
|
|
typedef FT_Error
|
|
|
|
(*AF_Script_InitMetricsFunc)( AF_ScriptMetrics metrics,
|
|
|
|
FT_Face face );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef void
|
|
|
|
(*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics metrics,
|
|
|
|
AF_Scaler scaler );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef void
|
|
|
|
(*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics metrics );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef FT_Error
|
|
|
|
(*AF_Script_InitHintsFunc)( AF_GlyphHints hints,
|
|
|
|
AF_ScriptMetrics metrics );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
typedef void
|
|
|
|
(*AF_Script_ApplyHintsFunc)( AF_GlyphHints hints,
|
|
|
|
FT_Outline* outline,
|
|
|
|
AF_ScriptMetrics metrics );
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** W R I T I N G S Y S T E M S *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* In FreeType, a writing system consists of multiple scripts which can
|
|
|
|
* be handled similarly *in a typographical way*; the relationship is not
|
|
|
|
* based on history. For example, both the Greek and the unrelated
|
|
|
|
* Armenian scripts share the same features like ascender, descender,
|
|
|
|
* x-height, etc. Essentially, a writing system is covered by a
|
|
|
|
* submodule of the auto-fitter; it contains
|
|
|
|
*
|
|
|
|
* - a specific global analyzer which computes global metrics specific to
|
|
|
|
* the script (based on script-specific characters to identify ascender
|
|
|
|
* height, x-height, etc.),
|
|
|
|
*
|
|
|
|
* - a specific glyph analyzer that computes segments and edges for each
|
|
|
|
* glyph covered by the script,
|
|
|
|
*
|
|
|
|
* - a specific grid-fitting algorithm that distorts the scaled glyph
|
|
|
|
* outline according to the results of the glyph analyzer.
|
|
|
|
*/
|
|
|
|
|
2013-08-02 19:51:17 +02:00
|
|
|
#define __AFWRTSYS_H__ /* don't load header files */
|
|
|
|
#undef WRITING_SYSTEM
|
|
|
|
#define WRITING_SYSTEM( ws, WS ) \
|
|
|
|
AF_WRITING_SYSTEM_ ## WS,
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
/* The list of known writing systems. */
|
|
|
|
typedef enum AF_WritingSystem_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
|
|
|
|
2013-08-02 19:51:17 +02:00
|
|
|
#include "afwrtsys.h"
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
AF_WRITING_SYSTEM_MAX /* do not remove */
|
2009-07-31 17:30:21 +02:00
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
} AF_WritingSystem;
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2013-08-02 19:51:17 +02:00
|
|
|
#undef __AFWRTSYS_H__
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
typedef struct AF_WritingSystemClassRec_
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
2013-07-31 22:49:29 +02:00
|
|
|
AF_WritingSystem writing_system;
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2009-07-31 17:32:07 +02:00
|
|
|
FT_Offset script_metrics_size;
|
2004-03-27 09:43:17 +01:00
|
|
|
AF_Script_InitMetricsFunc script_metrics_init;
|
|
|
|
AF_Script_ScaleMetricsFunc script_metrics_scale;
|
|
|
|
AF_Script_DoneMetricsFunc script_metrics_done;
|
|
|
|
|
|
|
|
AF_Script_InitHintsFunc script_hints_init;
|
|
|
|
AF_Script_ApplyHintsFunc script_hints_apply;
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
} AF_WritingSystemClassRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** S C R I P T S *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Each script is associated with a set of Unicode ranges which gets used
|
|
|
|
* to test whether the font face supports the script. It also references
|
|
|
|
* the writing system it belongs to.
|
|
|
|
*
|
|
|
|
* We use four-letter script tags from the OpenType specification.
|
|
|
|
*/
|
|
|
|
|
2013-08-02 20:25:21 +02:00
|
|
|
#undef SCRIPT
|
|
|
|
#define SCRIPT(s, S ) \
|
|
|
|
AF_SCRIPT_ ## S,
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
/* The list of known scripts. */
|
|
|
|
typedef enum AF_Script_
|
|
|
|
{
|
2013-08-02 20:25:21 +02:00
|
|
|
|
|
|
|
#include "afscript.h"
|
2013-07-31 22:49:29 +02:00
|
|
|
|
|
|
|
AF_SCRIPT_MAX /* do not remove */
|
|
|
|
|
|
|
|
} AF_Script;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct AF_Script_UniRangeRec_
|
|
|
|
{
|
|
|
|
FT_UInt32 first;
|
|
|
|
FT_UInt32 last;
|
|
|
|
|
|
|
|
} AF_Script_UniRangeRec;
|
|
|
|
|
|
|
|
#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) }
|
|
|
|
|
|
|
|
typedef const AF_Script_UniRangeRec* AF_Script_UniRange;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct AF_ScriptClassRec_
|
|
|
|
{
|
2013-08-25 08:23:22 +02:00
|
|
|
AF_Script script;
|
|
|
|
AF_Blue_Stringset blue_stringset;
|
|
|
|
AF_WritingSystem writing_system;
|
2013-07-31 22:49:29 +02:00
|
|
|
|
|
|
|
AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
|
|
|
|
FT_UInt32 standard_char; /* for default width and height */
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
} AF_ScriptClassRec;
|
|
|
|
|
2011-01-23 12:42:23 +01:00
|
|
|
|
|
|
|
/* Declare and define vtables for classes */
|
2009-04-05 17:23:38 +02:00
|
|
|
#ifndef FT_CONFIG_OPTION_PIC
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
|
|
|
|
FT_CALLBACK_TABLE const AF_WritingSystemClassRec \
|
|
|
|
writing_system_class;
|
|
|
|
|
|
|
|
#define AF_DEFINE_WRITING_SYSTEM_CLASS( \
|
|
|
|
writing_system_class, \
|
|
|
|
system, \
|
|
|
|
m_size, \
|
|
|
|
m_init, \
|
|
|
|
m_scale, \
|
|
|
|
m_done, \
|
|
|
|
h_init, \
|
|
|
|
h_apply ) \
|
|
|
|
FT_CALLBACK_TABLE_DEF \
|
|
|
|
const AF_WritingSystemClassRec writing_system_class = \
|
|
|
|
{ \
|
|
|
|
system, \
|
|
|
|
\
|
|
|
|
m_size, \
|
|
|
|
\
|
|
|
|
m_init, \
|
|
|
|
m_scale, \
|
|
|
|
m_done, \
|
|
|
|
\
|
|
|
|
h_init, \
|
|
|
|
h_apply \
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-23 12:42:23 +01:00
|
|
|
#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
|
|
|
|
FT_CALLBACK_TABLE const AF_ScriptClassRec \
|
2009-04-05 17:23:38 +02:00
|
|
|
script_class;
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
#define AF_DEFINE_SCRIPT_CLASS( \
|
|
|
|
script_class, \
|
|
|
|
script_, \
|
2013-08-25 08:23:22 +02:00
|
|
|
blue_stringset_, \
|
2013-07-31 22:49:29 +02:00
|
|
|
writing_system_, \
|
|
|
|
ranges, \
|
|
|
|
std_char ) \
|
|
|
|
FT_CALLBACK_TABLE_DEF \
|
|
|
|
const AF_ScriptClassRec script_class = \
|
|
|
|
{ \
|
|
|
|
script_, \
|
2013-08-25 08:23:22 +02:00
|
|
|
blue_stringset_, \
|
2013-07-31 22:49:29 +02:00
|
|
|
writing_system_, \
|
|
|
|
ranges, \
|
|
|
|
std_char \
|
2009-04-05 17:23:38 +02:00
|
|
|
};
|
|
|
|
|
2011-01-23 12:42:23 +01:00
|
|
|
#else /* FT_CONFIG_OPTION_PIC */
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
|
|
|
|
FT_LOCAL( void ) \
|
|
|
|
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac );
|
|
|
|
|
|
|
|
#define AF_DEFINE_WRITING_SYSTEM_CLASS( \
|
|
|
|
writing_system_class, \
|
|
|
|
system, \
|
|
|
|
m_size, \
|
|
|
|
m_init, \
|
|
|
|
m_scale, \
|
|
|
|
m_done, \
|
|
|
|
h_init, \
|
|
|
|
h_apply ) \
|
|
|
|
FT_LOCAL_DEF( void ) \
|
|
|
|
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \
|
|
|
|
{ \
|
|
|
|
ac->writing_system = system; \
|
|
|
|
\
|
|
|
|
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; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-10-24 14:22:14 +02:00
|
|
|
#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
|
|
|
|
FT_LOCAL( void ) \
|
|
|
|
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac );
|
2011-01-23 12:42:23 +01:00
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
#define AF_DEFINE_SCRIPT_CLASS( \
|
|
|
|
script_class, \
|
|
|
|
script_, \
|
2013-08-25 08:23:22 +02:00
|
|
|
blue_string_set_, \
|
2013-07-31 22:49:29 +02:00
|
|
|
writing_system_, \
|
|
|
|
ranges, \
|
|
|
|
std_char ) \
|
|
|
|
FT_LOCAL_DEF( void ) \
|
|
|
|
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
|
|
|
|
{ \
|
|
|
|
ac->script = script_; \
|
2013-08-25 08:23:22 +02:00
|
|
|
ac->blue_stringset = blue_stringset_; \
|
2013-07-31 22:49:29 +02:00
|
|
|
ac->writing_system = writing_system_; \
|
|
|
|
ac->script_uni_ranges = ranges; \
|
|
|
|
ac->standard_char = std_char; \
|
2009-04-05 17:23:38 +02:00
|
|
|
}
|
2011-01-23 12:42:23 +01:00
|
|
|
|
|
|
|
#endif /* FT_CONFIG_OPTION_PIC */
|
2009-04-05 17:23:38 +02:00
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
/* */
|
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
|
|
|
#endif /* __AFTYPES_H__ */
|
2005-03-03 18:09:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|