2001-10-18 13:38:43 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* pshglob.h */
|
|
|
|
/* */
|
2001-12-05 02:22:05 +01:00
|
|
|
/* PostScript hinter global hinting management. */
|
2001-10-18 13:38:43 +02:00
|
|
|
/* */
|
|
|
|
/* Copyright 2001 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
#ifndef __PSHGLOB_H__
|
|
|
|
#define __PSHGLOB_H__
|
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
#include FT_INTERNAL_POSTSCRIPT_GLOBALS_H
|
|
|
|
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** 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_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
FT_Int org;
|
|
|
|
FT_Pos cur;
|
|
|
|
FT_Pos fit;
|
|
|
|
|
|
|
|
} PSH_WidthRec, *PSH_Width;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* standard and snap widths table */
|
|
|
|
typedef struct PSH_WidthsRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
FT_UInt count;
|
2001-12-05 02:22:05 +01:00
|
|
|
PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PSH_WidthsRec, *PSH_Widths;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PSH_DimensionRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
PSH_WidthsRec std;
|
|
|
|
FT_Fixed scale_mult;
|
|
|
|
FT_Fixed scale_delta;
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
} PSH_DimensionRec, *PSH_Dimension;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* blue zone descriptor */
|
|
|
|
typedef struct PSH_Blue_ZoneRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
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;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PSH_Blue_ZoneRec, *PSH_Blue_Zone;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PSH_Blue_TableRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
FT_UInt count;
|
2001-12-05 02:22:05 +01:00
|
|
|
PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
|
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
} PSH_Blue_TableRec, *PSH_Blue_Table;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* blue zones table */
|
|
|
|
typedef struct PSH_BluesRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
PSH_Blue_TableRec normal_top;
|
|
|
|
PSH_Blue_TableRec normal_bottom;
|
|
|
|
PSH_Blue_TableRec family_top;
|
|
|
|
PSH_Blue_TableRec family_bottom;
|
2001-12-12 17:07:29 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
FT_Fixed blue_scale;
|
2001-12-12 17:07:29 +01:00
|
|
|
FT_Int blue_shift;
|
|
|
|
FT_Int blue_threshold;
|
|
|
|
FT_Bool no_overshoots;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PSH_BluesRec, *PSH_Blues;
|
|
|
|
|
|
|
|
|
2001-12-21 16:59:43 +01:00
|
|
|
/* font globals. */
|
|
|
|
/* dimension 0 => X coordinates + vertical hints/stems */
|
|
|
|
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PSH_GlobalsRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
FT_Memory memory;
|
|
|
|
PSH_DimensionRec dimension[2];
|
|
|
|
PSH_BluesRec blues;
|
|
|
|
|
|
|
|
} PSH_GlobalsRec;
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2002-02-19 02:12:23 +01:00
|
|
|
PSH_BLUE_ALIGN_NONE = 0,
|
2001-10-18 13:38:43 +02:00
|
|
|
PSH_BLUE_ALIGN_TOP = 1,
|
|
|
|
PSH_BLUE_ALIGN_BOT = 2
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
} PSH_Blue_Align;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PSH_AlignmentRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
PSH_Blue_Align align;
|
|
|
|
FT_Pos align_top;
|
|
|
|
FT_Pos align_bot;
|
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
} PSH_AlignmentRec, *PSH_Alignment;
|
|
|
|
|
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* snap a stem width to fitter coordinates. `org_width' is in font */
|
|
|
|
/* units. The result is in device pixels (26.6 format). */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Pos )
|
2001-10-18 13:38:43 +02:00
|
|
|
psh_dimension_snap_width( PSH_Dimension dimension,
|
|
|
|
FT_Int org_width );
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* snap a stem to one or two blue zones */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
psh_blues_snap_stem( PSH_Blues blues,
|
|
|
|
FT_Int stem_top,
|
|
|
|
FT_Int stem_bot,
|
|
|
|
PSH_Alignment alignment );
|
|
|
|
/* */
|
|
|
|
|
|
|
|
#ifdef DEBUG_HINTER
|
2001-12-05 02:22:05 +01:00
|
|
|
extern PSH_Globals ps_debug_globals;
|
|
|
|
#endif
|
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
#endif /* __PSHGLOB_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|