mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-21 05:36:39 +08:00
Sync changes from upstream repository
First publish of public opennurbs from 8.x source
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,241 +1,241 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshalgo.h */
|
||||
/* */
|
||||
/* PostScript hinting algorithm (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHALGO_H_
|
||||
#define PSHALGO_H_
|
||||
|
||||
|
||||
#include "pshrec.h"
|
||||
#include "pshglob.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* handle to Hint structure */
|
||||
typedef struct PSH_HintRec_* PSH_Hint;
|
||||
|
||||
|
||||
/* hint bit-flags */
|
||||
#define PSH_HINT_GHOST PS_HINT_FLAG_GHOST
|
||||
#define PSH_HINT_BOTTOM PS_HINT_FLAG_BOTTOM
|
||||
#define PSH_HINT_ACTIVE 4U
|
||||
#define PSH_HINT_FITTED 8U
|
||||
|
||||
|
||||
#define psh_hint_is_active( x ) ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 )
|
||||
#define psh_hint_is_ghost( x ) ( ( (x)->flags & PSH_HINT_GHOST ) != 0 )
|
||||
#define psh_hint_is_fitted( x ) ( ( (x)->flags & PSH_HINT_FITTED ) != 0 )
|
||||
|
||||
#define psh_hint_activate( x ) (x)->flags |= PSH_HINT_ACTIVE
|
||||
#define psh_hint_deactivate( x ) (x)->flags &= ~PSH_HINT_ACTIVE
|
||||
#define psh_hint_set_fitted( x ) (x)->flags |= PSH_HINT_FITTED
|
||||
|
||||
|
||||
/* hint structure */
|
||||
typedef struct PSH_HintRec_
|
||||
{
|
||||
FT_Int org_pos;
|
||||
FT_Int org_len;
|
||||
FT_Pos cur_pos;
|
||||
FT_Pos cur_len;
|
||||
FT_UInt flags;
|
||||
PSH_Hint parent;
|
||||
FT_Int order;
|
||||
|
||||
} PSH_HintRec;
|
||||
|
||||
|
||||
/* this is an interpolation zone used for strong points; */
|
||||
/* weak points are interpolated according to their strong */
|
||||
/* neighbours */
|
||||
typedef struct PSH_ZoneRec_
|
||||
{
|
||||
FT_Fixed scale;
|
||||
FT_Fixed delta;
|
||||
FT_Pos min;
|
||||
FT_Pos max;
|
||||
|
||||
} PSH_ZoneRec, *PSH_Zone;
|
||||
|
||||
|
||||
typedef struct PSH_Hint_TableRec_
|
||||
{
|
||||
FT_UInt max_hints;
|
||||
FT_UInt num_hints;
|
||||
PSH_Hint hints;
|
||||
PSH_Hint* sort;
|
||||
PSH_Hint* sort_global;
|
||||
FT_UInt num_zones;
|
||||
PSH_ZoneRec* zones;
|
||||
PSH_Zone zone;
|
||||
PS_Mask_Table hint_masks;
|
||||
PS_Mask_Table counter_masks;
|
||||
|
||||
} PSH_Hint_TableRec, *PSH_Hint_Table;
|
||||
|
||||
|
||||
typedef struct PSH_PointRec_* PSH_Point;
|
||||
typedef struct PSH_ContourRec_* PSH_Contour;
|
||||
|
||||
enum
|
||||
{
|
||||
PSH_DIR_NONE = 4,
|
||||
PSH_DIR_UP = -1,
|
||||
PSH_DIR_DOWN = 1,
|
||||
PSH_DIR_LEFT = -2,
|
||||
PSH_DIR_RIGHT = 2
|
||||
};
|
||||
|
||||
#define PSH_DIR_HORIZONTAL 2
|
||||
#define PSH_DIR_VERTICAL 1
|
||||
|
||||
#define PSH_DIR_COMPARE( d1, d2 ) ( (d1) == (d2) || (d1) == -(d2) )
|
||||
#define PSH_DIR_IS_HORIZONTAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_HORIZONTAL )
|
||||
#define PSH_DIR_IS_VERTICAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL )
|
||||
|
||||
|
||||
/* the following bit-flags are computed once by the glyph */
|
||||
/* analyzer, for both dimensions */
|
||||
#define PSH_POINT_OFF 1U /* point is off the curve */
|
||||
#define PSH_POINT_SMOOTH 2U /* point is smooth */
|
||||
#define PSH_POINT_INFLEX 4U /* point is inflection */
|
||||
|
||||
|
||||
#define psh_point_is_smooth( p ) ( (p)->flags & PSH_POINT_SMOOTH )
|
||||
#define psh_point_is_off( p ) ( (p)->flags & PSH_POINT_OFF )
|
||||
#define psh_point_is_inflex( p ) ( (p)->flags & PSH_POINT_INFLEX )
|
||||
|
||||
#define psh_point_set_smooth( p ) (p)->flags |= PSH_POINT_SMOOTH
|
||||
#define psh_point_set_off( p ) (p)->flags |= PSH_POINT_OFF
|
||||
#define psh_point_set_inflex( p ) (p)->flags |= PSH_POINT_INFLEX
|
||||
|
||||
|
||||
/* the following bit-flags are re-computed for each dimension */
|
||||
#define PSH_POINT_STRONG 16U /* point is strong */
|
||||
#define PSH_POINT_FITTED 32U /* point is already fitted */
|
||||
#define PSH_POINT_EXTREMUM 64U /* point is local extremum */
|
||||
#define PSH_POINT_POSITIVE 128U /* extremum has positive contour flow */
|
||||
#define PSH_POINT_NEGATIVE 256U /* extremum has negative contour flow */
|
||||
#define PSH_POINT_EDGE_MIN 512U /* point is aligned to left/bottom stem edge */
|
||||
#define PSH_POINT_EDGE_MAX 1024U /* point is aligned to top/right stem edge */
|
||||
|
||||
|
||||
#define psh_point_is_strong( p ) ( (p)->flags2 & PSH_POINT_STRONG )
|
||||
#define psh_point_is_fitted( p ) ( (p)->flags2 & PSH_POINT_FITTED )
|
||||
#define psh_point_is_extremum( p ) ( (p)->flags2 & PSH_POINT_EXTREMUM )
|
||||
#define psh_point_is_positive( p ) ( (p)->flags2 & PSH_POINT_POSITIVE )
|
||||
#define psh_point_is_negative( p ) ( (p)->flags2 & PSH_POINT_NEGATIVE )
|
||||
#define psh_point_is_edge_min( p ) ( (p)->flags2 & PSH_POINT_EDGE_MIN )
|
||||
#define psh_point_is_edge_max( p ) ( (p)->flags2 & PSH_POINT_EDGE_MAX )
|
||||
|
||||
#define psh_point_set_strong( p ) (p)->flags2 |= PSH_POINT_STRONG
|
||||
#define psh_point_set_fitted( p ) (p)->flags2 |= PSH_POINT_FITTED
|
||||
#define psh_point_set_extremum( p ) (p)->flags2 |= PSH_POINT_EXTREMUM
|
||||
#define psh_point_set_positive( p ) (p)->flags2 |= PSH_POINT_POSITIVE
|
||||
#define psh_point_set_negative( p ) (p)->flags2 |= PSH_POINT_NEGATIVE
|
||||
#define psh_point_set_edge_min( p ) (p)->flags2 |= PSH_POINT_EDGE_MIN
|
||||
#define psh_point_set_edge_max( p ) (p)->flags2 |= PSH_POINT_EDGE_MAX
|
||||
|
||||
|
||||
typedef struct PSH_PointRec_
|
||||
{
|
||||
PSH_Point prev;
|
||||
PSH_Point next;
|
||||
PSH_Contour contour;
|
||||
FT_UInt flags;
|
||||
FT_UInt flags2;
|
||||
FT_Char dir_in;
|
||||
FT_Char dir_out;
|
||||
PSH_Hint hint;
|
||||
FT_Pos org_u;
|
||||
FT_Pos org_v;
|
||||
FT_Pos cur_u;
|
||||
#ifdef DEBUG_HINTER
|
||||
FT_Pos org_x;
|
||||
FT_Pos cur_x;
|
||||
FT_Pos org_y;
|
||||
FT_Pos cur_y;
|
||||
FT_UInt flags_x;
|
||||
FT_UInt flags_y;
|
||||
#endif
|
||||
|
||||
} PSH_PointRec;
|
||||
|
||||
|
||||
typedef struct PSH_ContourRec_
|
||||
{
|
||||
PSH_Point start;
|
||||
FT_UInt count;
|
||||
|
||||
} PSH_ContourRec;
|
||||
|
||||
|
||||
typedef struct PSH_GlyphRec_
|
||||
{
|
||||
FT_UInt num_points;
|
||||
FT_UInt num_contours;
|
||||
|
||||
PSH_Point points;
|
||||
PSH_Contour contours;
|
||||
|
||||
FT_Memory memory;
|
||||
FT_Outline* outline;
|
||||
PSH_Globals globals;
|
||||
PSH_Hint_TableRec hint_tables[2];
|
||||
|
||||
FT_Bool vertical;
|
||||
FT_Int major_dir;
|
||||
FT_Int minor_dir;
|
||||
|
||||
FT_Bool do_horz_hints;
|
||||
FT_Bool do_vert_hints;
|
||||
FT_Bool do_horz_snapping;
|
||||
FT_Bool do_vert_snapping;
|
||||
FT_Bool do_stem_adjust;
|
||||
|
||||
} PSH_GlyphRec, *PSH_Glyph;
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PSH_Hint_Table ps_debug_hint_table;
|
||||
|
||||
typedef void
|
||||
(*PSH_HintFunc)( PSH_Hint hint,
|
||||
FT_Bool vertical );
|
||||
|
||||
extern PSH_HintFunc ps_debug_hint_func;
|
||||
|
||||
extern PSH_Glyph ps_debug_glyph;
|
||||
#endif
|
||||
|
||||
|
||||
extern FT_Error
|
||||
ps_hints_apply( PS_Hints ps_hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals,
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHALGO_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshalgo.h */
|
||||
/* */
|
||||
/* PostScript hinting algorithm (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHALGO_H_
|
||||
#define PSHALGO_H_
|
||||
|
||||
|
||||
#include "pshrec.h"
|
||||
#include "pshglob.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* handle to Hint structure */
|
||||
typedef struct PSH_HintRec_* PSH_Hint;
|
||||
|
||||
|
||||
/* hint bit-flags */
|
||||
#define PSH_HINT_GHOST PS_HINT_FLAG_GHOST
|
||||
#define PSH_HINT_BOTTOM PS_HINT_FLAG_BOTTOM
|
||||
#define PSH_HINT_ACTIVE 4U
|
||||
#define PSH_HINT_FITTED 8U
|
||||
|
||||
|
||||
#define psh_hint_is_active( x ) ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 )
|
||||
#define psh_hint_is_ghost( x ) ( ( (x)->flags & PSH_HINT_GHOST ) != 0 )
|
||||
#define psh_hint_is_fitted( x ) ( ( (x)->flags & PSH_HINT_FITTED ) != 0 )
|
||||
|
||||
#define psh_hint_activate( x ) (x)->flags |= PSH_HINT_ACTIVE
|
||||
#define psh_hint_deactivate( x ) (x)->flags &= ~PSH_HINT_ACTIVE
|
||||
#define psh_hint_set_fitted( x ) (x)->flags |= PSH_HINT_FITTED
|
||||
|
||||
|
||||
/* hint structure */
|
||||
typedef struct PSH_HintRec_
|
||||
{
|
||||
FT_Int org_pos;
|
||||
FT_Int org_len;
|
||||
FT_Pos cur_pos;
|
||||
FT_Pos cur_len;
|
||||
FT_UInt flags;
|
||||
PSH_Hint parent;
|
||||
FT_Int order;
|
||||
|
||||
} PSH_HintRec;
|
||||
|
||||
|
||||
/* this is an interpolation zone used for strong points; */
|
||||
/* weak points are interpolated according to their strong */
|
||||
/* neighbours */
|
||||
typedef struct PSH_ZoneRec_
|
||||
{
|
||||
FT_Fixed scale;
|
||||
FT_Fixed delta;
|
||||
FT_Pos min;
|
||||
FT_Pos max;
|
||||
|
||||
} PSH_ZoneRec, *PSH_Zone;
|
||||
|
||||
|
||||
typedef struct PSH_Hint_TableRec_
|
||||
{
|
||||
FT_UInt max_hints;
|
||||
FT_UInt num_hints;
|
||||
PSH_Hint hints;
|
||||
PSH_Hint* sort;
|
||||
PSH_Hint* sort_global;
|
||||
FT_UInt num_zones;
|
||||
PSH_ZoneRec* zones;
|
||||
PSH_Zone zone;
|
||||
PS_Mask_Table hint_masks;
|
||||
PS_Mask_Table counter_masks;
|
||||
|
||||
} PSH_Hint_TableRec, *PSH_Hint_Table;
|
||||
|
||||
|
||||
typedef struct PSH_PointRec_* PSH_Point;
|
||||
typedef struct PSH_ContourRec_* PSH_Contour;
|
||||
|
||||
enum
|
||||
{
|
||||
PSH_DIR_NONE = 4,
|
||||
PSH_DIR_UP = -1,
|
||||
PSH_DIR_DOWN = 1,
|
||||
PSH_DIR_LEFT = -2,
|
||||
PSH_DIR_RIGHT = 2
|
||||
};
|
||||
|
||||
#define PSH_DIR_HORIZONTAL 2
|
||||
#define PSH_DIR_VERTICAL 1
|
||||
|
||||
#define PSH_DIR_COMPARE( d1, d2 ) ( (d1) == (d2) || (d1) == -(d2) )
|
||||
#define PSH_DIR_IS_HORIZONTAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_HORIZONTAL )
|
||||
#define PSH_DIR_IS_VERTICAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL )
|
||||
|
||||
|
||||
/* the following bit-flags are computed once by the glyph */
|
||||
/* analyzer, for both dimensions */
|
||||
#define PSH_POINT_OFF 1U /* point is off the curve */
|
||||
#define PSH_POINT_SMOOTH 2U /* point is smooth */
|
||||
#define PSH_POINT_INFLEX 4U /* point is inflection */
|
||||
|
||||
|
||||
#define psh_point_is_smooth( p ) ( (p)->flags & PSH_POINT_SMOOTH )
|
||||
#define psh_point_is_off( p ) ( (p)->flags & PSH_POINT_OFF )
|
||||
#define psh_point_is_inflex( p ) ( (p)->flags & PSH_POINT_INFLEX )
|
||||
|
||||
#define psh_point_set_smooth( p ) (p)->flags |= PSH_POINT_SMOOTH
|
||||
#define psh_point_set_off( p ) (p)->flags |= PSH_POINT_OFF
|
||||
#define psh_point_set_inflex( p ) (p)->flags |= PSH_POINT_INFLEX
|
||||
|
||||
|
||||
/* the following bit-flags are re-computed for each dimension */
|
||||
#define PSH_POINT_STRONG 16U /* point is strong */
|
||||
#define PSH_POINT_FITTED 32U /* point is already fitted */
|
||||
#define PSH_POINT_EXTREMUM 64U /* point is local extremum */
|
||||
#define PSH_POINT_POSITIVE 128U /* extremum has positive contour flow */
|
||||
#define PSH_POINT_NEGATIVE 256U /* extremum has negative contour flow */
|
||||
#define PSH_POINT_EDGE_MIN 512U /* point is aligned to left/bottom stem edge */
|
||||
#define PSH_POINT_EDGE_MAX 1024U /* point is aligned to top/right stem edge */
|
||||
|
||||
|
||||
#define psh_point_is_strong( p ) ( (p)->flags2 & PSH_POINT_STRONG )
|
||||
#define psh_point_is_fitted( p ) ( (p)->flags2 & PSH_POINT_FITTED )
|
||||
#define psh_point_is_extremum( p ) ( (p)->flags2 & PSH_POINT_EXTREMUM )
|
||||
#define psh_point_is_positive( p ) ( (p)->flags2 & PSH_POINT_POSITIVE )
|
||||
#define psh_point_is_negative( p ) ( (p)->flags2 & PSH_POINT_NEGATIVE )
|
||||
#define psh_point_is_edge_min( p ) ( (p)->flags2 & PSH_POINT_EDGE_MIN )
|
||||
#define psh_point_is_edge_max( p ) ( (p)->flags2 & PSH_POINT_EDGE_MAX )
|
||||
|
||||
#define psh_point_set_strong( p ) (p)->flags2 |= PSH_POINT_STRONG
|
||||
#define psh_point_set_fitted( p ) (p)->flags2 |= PSH_POINT_FITTED
|
||||
#define psh_point_set_extremum( p ) (p)->flags2 |= PSH_POINT_EXTREMUM
|
||||
#define psh_point_set_positive( p ) (p)->flags2 |= PSH_POINT_POSITIVE
|
||||
#define psh_point_set_negative( p ) (p)->flags2 |= PSH_POINT_NEGATIVE
|
||||
#define psh_point_set_edge_min( p ) (p)->flags2 |= PSH_POINT_EDGE_MIN
|
||||
#define psh_point_set_edge_max( p ) (p)->flags2 |= PSH_POINT_EDGE_MAX
|
||||
|
||||
|
||||
typedef struct PSH_PointRec_
|
||||
{
|
||||
PSH_Point prev;
|
||||
PSH_Point next;
|
||||
PSH_Contour contour;
|
||||
FT_UInt flags;
|
||||
FT_UInt flags2;
|
||||
FT_Char dir_in;
|
||||
FT_Char dir_out;
|
||||
PSH_Hint hint;
|
||||
FT_Pos org_u;
|
||||
FT_Pos org_v;
|
||||
FT_Pos cur_u;
|
||||
#ifdef DEBUG_HINTER
|
||||
FT_Pos org_x;
|
||||
FT_Pos cur_x;
|
||||
FT_Pos org_y;
|
||||
FT_Pos cur_y;
|
||||
FT_UInt flags_x;
|
||||
FT_UInt flags_y;
|
||||
#endif
|
||||
|
||||
} PSH_PointRec;
|
||||
|
||||
|
||||
typedef struct PSH_ContourRec_
|
||||
{
|
||||
PSH_Point start;
|
||||
FT_UInt count;
|
||||
|
||||
} PSH_ContourRec;
|
||||
|
||||
|
||||
typedef struct PSH_GlyphRec_
|
||||
{
|
||||
FT_UInt num_points;
|
||||
FT_UInt num_contours;
|
||||
|
||||
PSH_Point points;
|
||||
PSH_Contour contours;
|
||||
|
||||
FT_Memory memory;
|
||||
FT_Outline* outline;
|
||||
PSH_Globals globals;
|
||||
PSH_Hint_TableRec hint_tables[2];
|
||||
|
||||
FT_Bool vertical;
|
||||
FT_Int major_dir;
|
||||
FT_Int minor_dir;
|
||||
|
||||
FT_Bool do_horz_hints;
|
||||
FT_Bool do_vert_hints;
|
||||
FT_Bool do_horz_snapping;
|
||||
FT_Bool do_vert_snapping;
|
||||
FT_Bool do_stem_adjust;
|
||||
|
||||
} PSH_GlyphRec, *PSH_Glyph;
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PSH_Hint_Table ps_debug_hint_table;
|
||||
|
||||
typedef void
|
||||
(*PSH_HintFunc)( PSH_Hint hint,
|
||||
FT_Bool vertical );
|
||||
|
||||
extern PSH_HintFunc ps_debug_hint_func;
|
||||
|
||||
extern PSH_Glyph ps_debug_glyph;
|
||||
#endif
|
||||
|
||||
|
||||
extern FT_Error
|
||||
ps_hints_apply( PS_Hints ps_hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals,
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHALGO_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,196 +1,196 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshglob.h */
|
||||
/* */
|
||||
/* PostScript hinter global hinting management. */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHGLOB_H_
|
||||
#define PSHGLOB_H_
|
||||
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLOBAL HINTS INTERNALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_BLUE_ZONES */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of blue zones in a font global hints structure. */
|
||||
/* See @PS_Globals_BluesRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_BLUE_ZONES 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_STD_WIDTHS */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of standard and snap widths in either the */
|
||||
/* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_STD_WIDTHS 16
|
||||
|
||||
|
||||
/* standard and snap width */
|
||||
typedef struct PSH_WidthRec_
|
||||
{
|
||||
FT_Int org;
|
||||
FT_Pos cur;
|
||||
FT_Pos fit;
|
||||
|
||||
} PSH_WidthRec, *PSH_Width;
|
||||
|
||||
|
||||
/* standard and snap widths table */
|
||||
typedef struct PSH_WidthsRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
|
||||
|
||||
} PSH_WidthsRec, *PSH_Widths;
|
||||
|
||||
|
||||
typedef struct PSH_DimensionRec_
|
||||
{
|
||||
PSH_WidthsRec stdw;
|
||||
FT_Fixed scale_mult;
|
||||
FT_Fixed scale_delta;
|
||||
|
||||
} PSH_DimensionRec, *PSH_Dimension;
|
||||
|
||||
|
||||
/* blue zone descriptor */
|
||||
typedef struct PSH_Blue_ZoneRec_
|
||||
{
|
||||
FT_Int org_ref;
|
||||
FT_Int org_delta;
|
||||
FT_Int org_top;
|
||||
FT_Int org_bottom;
|
||||
|
||||
FT_Pos cur_ref;
|
||||
FT_Pos cur_delta;
|
||||
FT_Pos cur_bottom;
|
||||
FT_Pos cur_top;
|
||||
|
||||
} PSH_Blue_ZoneRec, *PSH_Blue_Zone;
|
||||
|
||||
|
||||
typedef struct PSH_Blue_TableRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
|
||||
|
||||
} PSH_Blue_TableRec, *PSH_Blue_Table;
|
||||
|
||||
|
||||
/* blue zones table */
|
||||
typedef struct PSH_BluesRec_
|
||||
{
|
||||
PSH_Blue_TableRec normal_top;
|
||||
PSH_Blue_TableRec normal_bottom;
|
||||
PSH_Blue_TableRec family_top;
|
||||
PSH_Blue_TableRec family_bottom;
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Int blue_shift;
|
||||
FT_Int blue_threshold;
|
||||
FT_Int blue_fuzz;
|
||||
FT_Bool no_overshoots;
|
||||
|
||||
} PSH_BluesRec, *PSH_Blues;
|
||||
|
||||
|
||||
/* font globals. */
|
||||
/* dimension 0 => X coordinates + vertical hints/stems */
|
||||
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
||||
typedef struct PSH_GlobalsRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
PSH_DimensionRec dimension[2];
|
||||
PSH_BluesRec blues;
|
||||
|
||||
} PSH_GlobalsRec;
|
||||
|
||||
|
||||
#define PSH_BLUE_ALIGN_NONE 0
|
||||
#define PSH_BLUE_ALIGN_TOP 1
|
||||
#define PSH_BLUE_ALIGN_BOT 2
|
||||
|
||||
|
||||
typedef struct PSH_AlignmentRec_
|
||||
{
|
||||
int align;
|
||||
FT_Pos align_top;
|
||||
FT_Pos align_bot;
|
||||
|
||||
} PSH_AlignmentRec, *PSH_Alignment;
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
|
||||
|
||||
|
||||
#if 0
|
||||
/* snap a stem width to fitter coordinates. `org_width' is in font */
|
||||
/* units. The result is in device pixels (26.6 format). */
|
||||
FT_LOCAL( FT_Pos )
|
||||
psh_dimension_snap_width( PSH_Dimension dimension,
|
||||
FT_Int org_width );
|
||||
#endif
|
||||
|
||||
FT_LOCAL( void )
|
||||
psh_globals_set_scale( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Fixed x_delta,
|
||||
FT_Fixed y_delta );
|
||||
|
||||
/* snap a stem to one or two blue zones */
|
||||
FT_LOCAL( void )
|
||||
psh_blues_snap_stem( PSH_Blues blues,
|
||||
FT_Int stem_top,
|
||||
FT_Int stem_bot,
|
||||
PSH_Alignment alignment );
|
||||
/* */
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PSH_Globals ps_debug_globals;
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHGLOB_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshglob.h */
|
||||
/* */
|
||||
/* PostScript hinter global hinting management. */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHGLOB_H_
|
||||
#define PSHGLOB_H_
|
||||
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLOBAL HINTS INTERNALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_BLUE_ZONES */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of blue zones in a font global hints structure. */
|
||||
/* See @PS_Globals_BluesRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_BLUE_ZONES 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_STD_WIDTHS */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of standard and snap widths in either the */
|
||||
/* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_STD_WIDTHS 16
|
||||
|
||||
|
||||
/* standard and snap width */
|
||||
typedef struct PSH_WidthRec_
|
||||
{
|
||||
FT_Int org;
|
||||
FT_Pos cur;
|
||||
FT_Pos fit;
|
||||
|
||||
} PSH_WidthRec, *PSH_Width;
|
||||
|
||||
|
||||
/* standard and snap widths table */
|
||||
typedef struct PSH_WidthsRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
|
||||
|
||||
} PSH_WidthsRec, *PSH_Widths;
|
||||
|
||||
|
||||
typedef struct PSH_DimensionRec_
|
||||
{
|
||||
PSH_WidthsRec stdw;
|
||||
FT_Fixed scale_mult;
|
||||
FT_Fixed scale_delta;
|
||||
|
||||
} PSH_DimensionRec, *PSH_Dimension;
|
||||
|
||||
|
||||
/* blue zone descriptor */
|
||||
typedef struct PSH_Blue_ZoneRec_
|
||||
{
|
||||
FT_Int org_ref;
|
||||
FT_Int org_delta;
|
||||
FT_Int org_top;
|
||||
FT_Int org_bottom;
|
||||
|
||||
FT_Pos cur_ref;
|
||||
FT_Pos cur_delta;
|
||||
FT_Pos cur_bottom;
|
||||
FT_Pos cur_top;
|
||||
|
||||
} PSH_Blue_ZoneRec, *PSH_Blue_Zone;
|
||||
|
||||
|
||||
typedef struct PSH_Blue_TableRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
|
||||
|
||||
} PSH_Blue_TableRec, *PSH_Blue_Table;
|
||||
|
||||
|
||||
/* blue zones table */
|
||||
typedef struct PSH_BluesRec_
|
||||
{
|
||||
PSH_Blue_TableRec normal_top;
|
||||
PSH_Blue_TableRec normal_bottom;
|
||||
PSH_Blue_TableRec family_top;
|
||||
PSH_Blue_TableRec family_bottom;
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Int blue_shift;
|
||||
FT_Int blue_threshold;
|
||||
FT_Int blue_fuzz;
|
||||
FT_Bool no_overshoots;
|
||||
|
||||
} PSH_BluesRec, *PSH_Blues;
|
||||
|
||||
|
||||
/* font globals. */
|
||||
/* dimension 0 => X coordinates + vertical hints/stems */
|
||||
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
||||
typedef struct PSH_GlobalsRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
PSH_DimensionRec dimension[2];
|
||||
PSH_BluesRec blues;
|
||||
|
||||
} PSH_GlobalsRec;
|
||||
|
||||
|
||||
#define PSH_BLUE_ALIGN_NONE 0
|
||||
#define PSH_BLUE_ALIGN_TOP 1
|
||||
#define PSH_BLUE_ALIGN_BOT 2
|
||||
|
||||
|
||||
typedef struct PSH_AlignmentRec_
|
||||
{
|
||||
int align;
|
||||
FT_Pos align_top;
|
||||
FT_Pos align_bot;
|
||||
|
||||
} PSH_AlignmentRec, *PSH_Alignment;
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
|
||||
|
||||
|
||||
#if 0
|
||||
/* snap a stem width to fitter coordinates. `org_width' is in font */
|
||||
/* units. The result is in device pixels (26.6 format). */
|
||||
FT_LOCAL( FT_Pos )
|
||||
psh_dimension_snap_width( PSH_Dimension dimension,
|
||||
FT_Int org_width );
|
||||
#endif
|
||||
|
||||
FT_LOCAL( void )
|
||||
psh_globals_set_scale( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Fixed x_delta,
|
||||
FT_Fixed y_delta );
|
||||
|
||||
/* snap a stem to one or two blue zones */
|
||||
FT_LOCAL( void )
|
||||
psh_blues_snap_stem( PSH_Blues blues,
|
||||
FT_Int stem_top,
|
||||
FT_Int stem_bot,
|
||||
PSH_Alignment alignment );
|
||||
/* */
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PSH_Globals ps_debug_globals;
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHGLOB_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshinter.c */
|
||||
/* */
|
||||
/* FreeType PostScript Hinting module */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "pshpic.c"
|
||||
#include "pshrec.c"
|
||||
#include "pshglob.c"
|
||||
#include "pshalgo.c"
|
||||
#include "pshmod.c"
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshinter.c */
|
||||
/* */
|
||||
/* FreeType PostScript Hinting module */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "pshpic.c"
|
||||
#include "pshrec.c"
|
||||
#include "pshglob.c"
|
||||
#include "pshalgo.c"
|
||||
#include "pshmod.c"
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,119 +1,119 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshmod.c */
|
||||
/* */
|
||||
/* FreeType PostScript hinter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "pshrec.h"
|
||||
#include "pshalgo.h"
|
||||
#include "pshpic.h"
|
||||
|
||||
|
||||
/* the Postscript Hinter module structure */
|
||||
typedef struct PS_Hinter_Module_Rec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
PS_HintsRec ps_hints;
|
||||
|
||||
PSH_Globals_FuncsRec globals_funcs;
|
||||
T1_Hints_FuncsRec t1_funcs;
|
||||
T2_Hints_FuncsRec t2_funcs;
|
||||
|
||||
} PS_Hinter_ModuleRec, *PS_Hinter_Module;
|
||||
|
||||
|
||||
/* finalize module */
|
||||
FT_CALLBACK_DEF( void )
|
||||
ps_hinter_done( PS_Hinter_Module module )
|
||||
{
|
||||
module->t1_funcs.hints = NULL;
|
||||
module->t2_funcs.hints = NULL;
|
||||
|
||||
ps_hints_done( &module->ps_hints );
|
||||
}
|
||||
|
||||
|
||||
/* initialize module, create hints recorder and the interface */
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ps_hinter_init( PS_Hinter_Module module )
|
||||
{
|
||||
FT_Memory memory = module->root.memory;
|
||||
void* ph = &module->ps_hints;
|
||||
|
||||
|
||||
ps_hints_init( &module->ps_hints, memory );
|
||||
|
||||
psh_globals_funcs_init( &module->globals_funcs );
|
||||
|
||||
t1_hints_funcs_init( &module->t1_funcs );
|
||||
module->t1_funcs.hints = (T1_Hints)ph;
|
||||
|
||||
t2_hints_funcs_init( &module->t2_funcs );
|
||||
module->t2_funcs.hints = (T2_Hints)ph;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* returns global hints interface */
|
||||
FT_CALLBACK_DEF( PSH_Globals_Funcs )
|
||||
pshinter_get_globals_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->globals_funcs;
|
||||
}
|
||||
|
||||
|
||||
/* return Type 1 hints interface */
|
||||
FT_CALLBACK_DEF( T1_Hints_Funcs )
|
||||
pshinter_get_t1_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->t1_funcs;
|
||||
}
|
||||
|
||||
|
||||
/* return Type 2 hints interface */
|
||||
FT_CALLBACK_DEF( T2_Hints_Funcs )
|
||||
pshinter_get_t2_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->t2_funcs;
|
||||
}
|
||||
|
||||
|
||||
FT_DEFINE_PSHINTER_INTERFACE(
|
||||
pshinter_interface,
|
||||
pshinter_get_globals_funcs,
|
||||
pshinter_get_t1_funcs,
|
||||
pshinter_get_t2_funcs )
|
||||
|
||||
|
||||
FT_DEFINE_MODULE(
|
||||
pshinter_module_class,
|
||||
|
||||
0,
|
||||
sizeof ( PS_Hinter_ModuleRec ),
|
||||
"pshinter",
|
||||
0x10000L,
|
||||
0x20000L,
|
||||
|
||||
&PSHINTER_INTERFACE_GET, /* module-specific interface */
|
||||
|
||||
(FT_Module_Constructor)ps_hinter_init,
|
||||
(FT_Module_Destructor) ps_hinter_done,
|
||||
(FT_Module_Requester) NULL ) /* no additional interface for now */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshmod.c */
|
||||
/* */
|
||||
/* FreeType PostScript hinter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "pshrec.h"
|
||||
#include "pshalgo.h"
|
||||
#include "pshpic.h"
|
||||
|
||||
|
||||
/* the Postscript Hinter module structure */
|
||||
typedef struct PS_Hinter_Module_Rec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
PS_HintsRec ps_hints;
|
||||
|
||||
PSH_Globals_FuncsRec globals_funcs;
|
||||
T1_Hints_FuncsRec t1_funcs;
|
||||
T2_Hints_FuncsRec t2_funcs;
|
||||
|
||||
} PS_Hinter_ModuleRec, *PS_Hinter_Module;
|
||||
|
||||
|
||||
/* finalize module */
|
||||
FT_CALLBACK_DEF( void )
|
||||
ps_hinter_done( PS_Hinter_Module module )
|
||||
{
|
||||
module->t1_funcs.hints = NULL;
|
||||
module->t2_funcs.hints = NULL;
|
||||
|
||||
ps_hints_done( &module->ps_hints );
|
||||
}
|
||||
|
||||
|
||||
/* initialize module, create hints recorder and the interface */
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ps_hinter_init( PS_Hinter_Module module )
|
||||
{
|
||||
FT_Memory memory = module->root.memory;
|
||||
void* ph = &module->ps_hints;
|
||||
|
||||
|
||||
ps_hints_init( &module->ps_hints, memory );
|
||||
|
||||
psh_globals_funcs_init( &module->globals_funcs );
|
||||
|
||||
t1_hints_funcs_init( &module->t1_funcs );
|
||||
module->t1_funcs.hints = (T1_Hints)ph;
|
||||
|
||||
t2_hints_funcs_init( &module->t2_funcs );
|
||||
module->t2_funcs.hints = (T2_Hints)ph;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* returns global hints interface */
|
||||
FT_CALLBACK_DEF( PSH_Globals_Funcs )
|
||||
pshinter_get_globals_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->globals_funcs;
|
||||
}
|
||||
|
||||
|
||||
/* return Type 1 hints interface */
|
||||
FT_CALLBACK_DEF( T1_Hints_Funcs )
|
||||
pshinter_get_t1_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->t1_funcs;
|
||||
}
|
||||
|
||||
|
||||
/* return Type 2 hints interface */
|
||||
FT_CALLBACK_DEF( T2_Hints_Funcs )
|
||||
pshinter_get_t2_funcs( FT_Module module )
|
||||
{
|
||||
return &((PS_Hinter_Module)module)->t2_funcs;
|
||||
}
|
||||
|
||||
|
||||
FT_DEFINE_PSHINTER_INTERFACE(
|
||||
pshinter_interface,
|
||||
pshinter_get_globals_funcs,
|
||||
pshinter_get_t1_funcs,
|
||||
pshinter_get_t2_funcs )
|
||||
|
||||
|
||||
FT_DEFINE_MODULE(
|
||||
pshinter_module_class,
|
||||
|
||||
0,
|
||||
sizeof ( PS_Hinter_ModuleRec ),
|
||||
"pshinter",
|
||||
0x10000L,
|
||||
0x20000L,
|
||||
|
||||
&PSHINTER_INTERFACE_GET, /* module-specific interface */
|
||||
|
||||
(FT_Module_Constructor)ps_hinter_init,
|
||||
(FT_Module_Destructor) ps_hinter_done,
|
||||
(FT_Module_Requester) NULL ) /* no additional interface for now */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshmod.h */
|
||||
/* */
|
||||
/* PostScript hinter module interface (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHMOD_H_
|
||||
#define PSHMOD_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_DECLARE_MODULE( pshinter_module_class )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHMOD_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshmod.h */
|
||||
/* */
|
||||
/* PostScript hinter module interface (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHMOD_H_
|
||||
#define PSHMOD_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_DECLARE_MODULE( pshinter_module_class )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHMOD_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshnterr.h */
|
||||
/* */
|
||||
/* PS Hinter error codes (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is used to define the PSHinter error enumeration constants. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef PSHNTERR_H_
|
||||
#define PSHNTERR_H_
|
||||
|
||||
#include FT_MODULE_ERRORS_H
|
||||
|
||||
#undef FTERRORS_H_
|
||||
|
||||
#undef FT_ERR_PREFIX
|
||||
#define FT_ERR_PREFIX PSH_Err_
|
||||
#define FT_ERR_BASE FT_Mod_Err_PShinter
|
||||
|
||||
#include FT_ERRORS_H
|
||||
|
||||
#endif /* PSHNTERR_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshnterr.h */
|
||||
/* */
|
||||
/* PS Hinter error codes (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is used to define the PSHinter error enumeration constants. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef PSHNTERR_H_
|
||||
#define PSHNTERR_H_
|
||||
|
||||
#include FT_MODULE_ERRORS_H
|
||||
|
||||
#undef FTERRORS_H_
|
||||
|
||||
#undef FT_ERR_PREFIX
|
||||
#define FT_ERR_PREFIX PSH_Err_
|
||||
#define FT_ERR_BASE FT_Mod_Err_PShinter
|
||||
|
||||
#include FT_ERRORS_H
|
||||
|
||||
#endif /* PSHNTERR_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,76 +1,76 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshpic.c */
|
||||
/* */
|
||||
/* The FreeType position independent code services for pshinter module. */
|
||||
/* */
|
||||
/* Copyright 2009-2016 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "pshpic.h"
|
||||
#include "pshnterr.h"
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
|
||||
/* forward declaration of PIC init functions from pshmod.c */
|
||||
void
|
||||
FT_Init_Class_pshinter_interface( FT_Library library,
|
||||
PSHinter_Interface* clazz );
|
||||
|
||||
void
|
||||
pshinter_module_class_pic_free( FT_Library library )
|
||||
{
|
||||
FT_PIC_Container* pic_container = &library->pic_container;
|
||||
FT_Memory memory = library->memory;
|
||||
|
||||
|
||||
if ( pic_container->pshinter )
|
||||
{
|
||||
FT_FREE( pic_container->pshinter );
|
||||
pic_container->pshinter = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
pshinter_module_class_pic_init( FT_Library library )
|
||||
{
|
||||
FT_PIC_Container* pic_container = &library->pic_container;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
PSHinterPIC* container = NULL;
|
||||
FT_Memory memory = library->memory;
|
||||
|
||||
|
||||
/* allocate pointer, clear and set global container pointer */
|
||||
if ( FT_ALLOC( container, sizeof ( *container ) ) )
|
||||
return error;
|
||||
FT_MEM_SET( container, 0, sizeof ( *container ) );
|
||||
pic_container->pshinter = container;
|
||||
|
||||
/* add call to initialization function when you add new scripts */
|
||||
FT_Init_Class_pshinter_interface(
|
||||
library, &container->pshinter_interface );
|
||||
|
||||
if ( error )
|
||||
pshinter_module_class_pic_free( library );
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshpic.c */
|
||||
/* */
|
||||
/* The FreeType position independent code services for pshinter module. */
|
||||
/* */
|
||||
/* Copyright 2009-2016 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "pshpic.h"
|
||||
#include "pshnterr.h"
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
|
||||
/* forward declaration of PIC init functions from pshmod.c */
|
||||
void
|
||||
FT_Init_Class_pshinter_interface( FT_Library library,
|
||||
PSHinter_Interface* clazz );
|
||||
|
||||
void
|
||||
pshinter_module_class_pic_free( FT_Library library )
|
||||
{
|
||||
FT_PIC_Container* pic_container = &library->pic_container;
|
||||
FT_Memory memory = library->memory;
|
||||
|
||||
|
||||
if ( pic_container->pshinter )
|
||||
{
|
||||
FT_FREE( pic_container->pshinter );
|
||||
pic_container->pshinter = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
pshinter_module_class_pic_init( FT_Library library )
|
||||
{
|
||||
FT_PIC_Container* pic_container = &library->pic_container;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
PSHinterPIC* container = NULL;
|
||||
FT_Memory memory = library->memory;
|
||||
|
||||
|
||||
/* allocate pointer, clear and set global container pointer */
|
||||
if ( FT_ALLOC( container, sizeof ( *container ) ) )
|
||||
return error;
|
||||
FT_MEM_SET( container, 0, sizeof ( *container ) );
|
||||
pic_container->pshinter = container;
|
||||
|
||||
/* add call to initialization function when you add new scripts */
|
||||
FT_Init_Class_pshinter_interface(
|
||||
library, &container->pshinter_interface );
|
||||
|
||||
if ( error )
|
||||
pshinter_module_class_pic_free( library );
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshpic.h */
|
||||
/* */
|
||||
/* The FreeType position independent code services for pshinter module. */
|
||||
/* */
|
||||
/* Copyright 2009-2016 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHPIC_H_
|
||||
#define PSHPIC_H_
|
||||
|
||||
|
||||
#include FT_INTERNAL_PIC_H
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#define PSHINTER_INTERFACE_GET pshinter_interface
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
typedef struct PSHinterPIC_
|
||||
{
|
||||
PSHinter_Interface pshinter_interface;
|
||||
|
||||
} PSHinterPIC;
|
||||
|
||||
|
||||
#define GET_PIC( lib ) ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )
|
||||
|
||||
#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface )
|
||||
|
||||
/* see pshpic.c for the implementation */
|
||||
void
|
||||
pshinter_module_class_pic_free( FT_Library library );
|
||||
|
||||
FT_Error
|
||||
pshinter_module_class_pic_init( FT_Library library );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
/* */
|
||||
|
||||
#endif /* PSHPIC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshpic.h */
|
||||
/* */
|
||||
/* The FreeType position independent code services for pshinter module. */
|
||||
/* */
|
||||
/* Copyright 2009-2016 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHPIC_H_
|
||||
#define PSHPIC_H_
|
||||
|
||||
|
||||
#include FT_INTERNAL_PIC_H
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#define PSHINTER_INTERFACE_GET pshinter_interface
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
typedef struct PSHinterPIC_
|
||||
{
|
||||
PSHinter_Interface pshinter_interface;
|
||||
|
||||
} PSHinterPIC;
|
||||
|
||||
|
||||
#define GET_PIC( lib ) ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )
|
||||
|
||||
#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface )
|
||||
|
||||
/* see pshpic.c for the implementation */
|
||||
void
|
||||
pshinter_module_class_pic_free( FT_Library library );
|
||||
|
||||
FT_Error
|
||||
pshinter_module_class_pic_init( FT_Library library );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
/* */
|
||||
|
||||
#endif /* PSHPIC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,172 +1,172 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshrec.h */
|
||||
/* */
|
||||
/* Postscript (Type1/Type2) hints recorder (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* The functions defined here are called from the Type 1, CID and CFF */
|
||||
/* font drivers to record the hints of a given character/glyph. */
|
||||
/* */
|
||||
/* The hints are recorded in a unified format, and are later processed */
|
||||
/* by the `optimizer' and `fitter' to adjust the outlines to the pixel */
|
||||
/* grid. */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHREC_H_
|
||||
#define PSHREC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
#include "pshglob.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLYPH HINTS RECORDER INTERNALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* handle to hint record */
|
||||
typedef struct PS_HintRec_* PS_Hint;
|
||||
|
||||
/* hint types */
|
||||
typedef enum PS_Hint_Type_
|
||||
{
|
||||
PS_HINT_TYPE_1 = 1,
|
||||
PS_HINT_TYPE_2 = 2
|
||||
|
||||
} PS_Hint_Type;
|
||||
|
||||
|
||||
/* hint flags */
|
||||
#define PS_HINT_FLAG_GHOST 1U
|
||||
#define PS_HINT_FLAG_BOTTOM 2U
|
||||
|
||||
|
||||
/* hint descriptor */
|
||||
typedef struct PS_HintRec_
|
||||
{
|
||||
FT_Int pos;
|
||||
FT_Int len;
|
||||
FT_UInt flags;
|
||||
|
||||
} PS_HintRec;
|
||||
|
||||
|
||||
#define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE )
|
||||
#define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST )
|
||||
#define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM )
|
||||
|
||||
|
||||
/* hints table descriptor */
|
||||
typedef struct PS_Hint_TableRec_
|
||||
{
|
||||
FT_UInt num_hints;
|
||||
FT_UInt max_hints;
|
||||
PS_Hint hints;
|
||||
|
||||
} PS_Hint_TableRec, *PS_Hint_Table;
|
||||
|
||||
|
||||
/* hint and counter mask descriptor */
|
||||
typedef struct PS_MaskRec_
|
||||
{
|
||||
FT_UInt num_bits;
|
||||
FT_UInt max_bits;
|
||||
FT_Byte* bytes;
|
||||
FT_UInt end_point;
|
||||
|
||||
} PS_MaskRec, *PS_Mask;
|
||||
|
||||
|
||||
/* masks and counters table descriptor */
|
||||
typedef struct PS_Mask_TableRec_
|
||||
{
|
||||
FT_UInt num_masks;
|
||||
FT_UInt max_masks;
|
||||
PS_Mask masks;
|
||||
|
||||
} PS_Mask_TableRec, *PS_Mask_Table;
|
||||
|
||||
|
||||
/* dimension-specific hints descriptor */
|
||||
typedef struct PS_DimensionRec_
|
||||
{
|
||||
PS_Hint_TableRec hints;
|
||||
PS_Mask_TableRec masks;
|
||||
PS_Mask_TableRec counters;
|
||||
|
||||
} PS_DimensionRec, *PS_Dimension;
|
||||
|
||||
|
||||
/* glyph hints descriptor */
|
||||
/* dimension 0 => X coordinates + vertical hints/stems */
|
||||
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
||||
typedef struct PS_HintsRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_Error error;
|
||||
FT_UInt32 magic;
|
||||
PS_Hint_Type hint_type;
|
||||
PS_DimensionRec dimension[2];
|
||||
|
||||
} PS_HintsRec, *PS_Hints;
|
||||
|
||||
/* */
|
||||
|
||||
/* initialize hints recorder */
|
||||
FT_LOCAL( void )
|
||||
ps_hints_init( PS_Hints hints,
|
||||
FT_Memory memory );
|
||||
|
||||
/* finalize hints recorder */
|
||||
FT_LOCAL( void )
|
||||
ps_hints_done( PS_Hints hints );
|
||||
|
||||
/* initialize Type1 hints recorder interface */
|
||||
FT_LOCAL( void )
|
||||
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
|
||||
|
||||
/* initialize Type2 hints recorder interface */
|
||||
FT_LOCAL( void )
|
||||
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PS_Hints ps_debug_hints;
|
||||
extern int ps_debug_no_horz_hints;
|
||||
extern int ps_debug_no_vert_hints;
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHREC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshrec.h */
|
||||
/* */
|
||||
/* Postscript (Type1/Type2) hints recorder (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* The functions defined here are called from the Type 1, CID and CFF */
|
||||
/* font drivers to record the hints of a given character/glyph. */
|
||||
/* */
|
||||
/* The hints are recorded in a unified format, and are later processed */
|
||||
/* by the `optimizer' and `fitter' to adjust the outlines to the pixel */
|
||||
/* grid. */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSHREC_H_
|
||||
#define PSHREC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
#include "pshglob.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLYPH HINTS RECORDER INTERNALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* handle to hint record */
|
||||
typedef struct PS_HintRec_* PS_Hint;
|
||||
|
||||
/* hint types */
|
||||
typedef enum PS_Hint_Type_
|
||||
{
|
||||
PS_HINT_TYPE_1 = 1,
|
||||
PS_HINT_TYPE_2 = 2
|
||||
|
||||
} PS_Hint_Type;
|
||||
|
||||
|
||||
/* hint flags */
|
||||
#define PS_HINT_FLAG_GHOST 1U
|
||||
#define PS_HINT_FLAG_BOTTOM 2U
|
||||
|
||||
|
||||
/* hint descriptor */
|
||||
typedef struct PS_HintRec_
|
||||
{
|
||||
FT_Int pos;
|
||||
FT_Int len;
|
||||
FT_UInt flags;
|
||||
|
||||
} PS_HintRec;
|
||||
|
||||
|
||||
#define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE )
|
||||
#define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST )
|
||||
#define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM )
|
||||
|
||||
|
||||
/* hints table descriptor */
|
||||
typedef struct PS_Hint_TableRec_
|
||||
{
|
||||
FT_UInt num_hints;
|
||||
FT_UInt max_hints;
|
||||
PS_Hint hints;
|
||||
|
||||
} PS_Hint_TableRec, *PS_Hint_Table;
|
||||
|
||||
|
||||
/* hint and counter mask descriptor */
|
||||
typedef struct PS_MaskRec_
|
||||
{
|
||||
FT_UInt num_bits;
|
||||
FT_UInt max_bits;
|
||||
FT_Byte* bytes;
|
||||
FT_UInt end_point;
|
||||
|
||||
} PS_MaskRec, *PS_Mask;
|
||||
|
||||
|
||||
/* masks and counters table descriptor */
|
||||
typedef struct PS_Mask_TableRec_
|
||||
{
|
||||
FT_UInt num_masks;
|
||||
FT_UInt max_masks;
|
||||
PS_Mask masks;
|
||||
|
||||
} PS_Mask_TableRec, *PS_Mask_Table;
|
||||
|
||||
|
||||
/* dimension-specific hints descriptor */
|
||||
typedef struct PS_DimensionRec_
|
||||
{
|
||||
PS_Hint_TableRec hints;
|
||||
PS_Mask_TableRec masks;
|
||||
PS_Mask_TableRec counters;
|
||||
|
||||
} PS_DimensionRec, *PS_Dimension;
|
||||
|
||||
|
||||
/* glyph hints descriptor */
|
||||
/* dimension 0 => X coordinates + vertical hints/stems */
|
||||
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
||||
typedef struct PS_HintsRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_Error error;
|
||||
FT_UInt32 magic;
|
||||
PS_Hint_Type hint_type;
|
||||
PS_DimensionRec dimension[2];
|
||||
|
||||
} PS_HintsRec, *PS_Hints;
|
||||
|
||||
/* */
|
||||
|
||||
/* initialize hints recorder */
|
||||
FT_LOCAL( void )
|
||||
ps_hints_init( PS_Hints hints,
|
||||
FT_Memory memory );
|
||||
|
||||
/* finalize hints recorder */
|
||||
FT_LOCAL( void )
|
||||
ps_hints_done( PS_Hints hints );
|
||||
|
||||
/* initialize Type1 hints recorder interface */
|
||||
FT_LOCAL( void )
|
||||
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
|
||||
|
||||
/* initialize Type2 hints recorder interface */
|
||||
FT_LOCAL( void )
|
||||
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PS_Hints ps_debug_hints;
|
||||
extern int ps_debug_no_horz_hints;
|
||||
extern int ps_debug_no_vert_hints;
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* PSHREC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
Reference in New Issue
Block a user