2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* pshrec.h
|
|
|
|
*
|
|
|
|
* Postscript (Type1/Type2) hints recorder (specification).
|
|
|
|
*
|
2023-01-17 09:18:25 +01:00
|
|
|
* Copyright (C) 2001-2023 by
|
2018-06-03 09:01:17 +02: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.
|
|
|
|
*
|
|
|
|
*/
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef PSHREC_H_
|
|
|
|
#define PSHREC_H_
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/pshints.h>
|
2001-10-18 13:38:43 +02:00
|
|
|
#include "pshglob.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
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** GLYPH HINTS RECORDER INTERNALS *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/* handle to hint record */
|
|
|
|
typedef struct PS_HintRec_* PS_Hint;
|
|
|
|
|
|
|
|
/* hint types */
|
2008-05-29 00:17:28 +02:00
|
|
|
typedef enum PS_Hint_Type_
|
2001-12-05 02:22:05 +01:00
|
|
|
{
|
|
|
|
PS_HINT_TYPE_1 = 1,
|
|
|
|
PS_HINT_TYPE_2 = 2
|
|
|
|
|
|
|
|
} PS_Hint_Type;
|
|
|
|
|
|
|
|
|
|
|
|
/* hint flags */
|
2015-02-22 15:57:47 +01:00
|
|
|
#define PS_HINT_FLAG_GHOST 1U
|
|
|
|
#define PS_HINT_FLAG_BOTTOM 2U
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* hint descriptor */
|
|
|
|
typedef struct PS_HintRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_Int pos;
|
|
|
|
FT_Int len;
|
|
|
|
FT_UInt flags;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PS_HintRec;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
#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 )
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* hints table descriptor */
|
|
|
|
typedef struct PS_Hint_TableRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_UInt num_hints;
|
|
|
|
FT_UInt max_hints;
|
|
|
|
PS_Hint hints;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PS_Hint_TableRec, *PS_Hint_Table;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* hint and counter mask descriptor */
|
|
|
|
typedef struct PS_MaskRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_UInt num_bits;
|
|
|
|
FT_UInt max_bits;
|
|
|
|
FT_Byte* bytes;
|
|
|
|
FT_UInt end_point;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PS_MaskRec, *PS_Mask;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* masks and counters table descriptor */
|
|
|
|
typedef struct PS_Mask_TableRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_UInt num_masks;
|
|
|
|
FT_UInt max_masks;
|
|
|
|
PS_Mask masks;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PS_Mask_TableRec, *PS_Mask_Table;
|
|
|
|
|
|
|
|
|
|
|
|
/* dimension-specific hints descriptor */
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PS_DimensionRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
|
|
|
PS_Hint_TableRec hints;
|
|
|
|
PS_Mask_TableRec masks;
|
|
|
|
PS_Mask_TableRec counters;
|
|
|
|
|
|
|
|
} PS_DimensionRec, *PS_Dimension;
|
|
|
|
|
|
|
|
|
2001-12-21 16:59:43 +01:00
|
|
|
/* glyph hints descriptor */
|
|
|
|
/* dimension 0 => X coordinates + vertical hints/stems */
|
|
|
|
/* dimension 1 => Y coordinates + horizontal hints/stems */
|
2001-12-05 02:22:05 +01:00
|
|
|
typedef struct PS_HintsRec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_Memory memory;
|
|
|
|
FT_Error error;
|
|
|
|
FT_UInt32 magic;
|
|
|
|
PS_Hint_Type hint_type;
|
|
|
|
PS_DimensionRec dimension[2];
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
} PS_HintsRec, *PS_Hints;
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* */
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* initialize hints recorder */
|
[Savannah bug #43682] Change some signatures to `void' return type.
* include/internal/pshints.h (PSH_Globals_SetScaleFunc),
include/internal/sfnt.h (TT_Get_Metrics_Func),
src/pshinter/pshglob.c (psh_globals_set_scale),
src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c
(tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange,
TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context,
TT_Save_Context): Do it.
* src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h,
src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c
(TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c
(tt_size_run_fpgm, tt_size_run_prep): Updated.
2014-11-25 08:14:15 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
ps_hints_init( PS_Hints hints,
|
|
|
|
FT_Memory memory );
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* finalize hints recorder */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
ps_hints_done( PS_Hints hints );
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* initialize Type1 hints recorder interface */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
/* initialize Type2 hints recorder interface */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_HINTER
|
2001-12-05 02:22:05 +01:00
|
|
|
extern PS_Hints ps_debug_hints;
|
|
|
|
extern int ps_debug_no_horz_hints;
|
|
|
|
extern int ps_debug_no_vert_hints;
|
2001-10-18 13:38:43 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
FT_END_HEADER
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* PSHREC_H_ */
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|