1 /* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Aladdin Enterprises. All rights reserved. 2 3 This software is provided AS-IS with no warranty, either express or 4 implied. 5 6 This software is distributed under license and may not be copied, 7 modified or distributed except as expressly authorized under the terms 8 of the license contained in the file LICENSE in this distribution. 9 10 For more information about licensing, please refer to 11 http://www.ghostscript.com/licensing/. For information on 12 commercial licensing, go to http://www.artifex.com/licensing/ or 13 contact Artifex Software, Inc., 101 Lucas Valley Road #110, 14 San Rafael, CA 94903, U.S.A., +1(415)492-9861. 15 */ 16 17 /* $Id: icharout.h,v 1.10 2004/09/22 13:52:33 igor Exp $ */ 18 /* Interface to zcharout.c */ 19 20 #ifndef icharout_INCLUDED 21 # define icharout_INCLUDED 22 23 /* Execute an outline defined by a PostScript procedure. */ 24 int zchar_exec_char_proc(i_ctx_t *); 25 26 /* 27 * Get the metrics for a character from the Metrics dictionary of a base 28 * font. If present, store the l.s.b. in psbw[0,1] and the width in 29 * psbw[2,3]. 30 */ 31 typedef enum { 32 metricsNone = 0, 33 metricsWidthOnly = 1, 34 metricsSideBearingAndWidth = 2 35 } metrics_present; 36 int /*metrics_present*/ 37 zchar_get_metrics(const gs_font_base * pbfont, const ref * pcnref, 38 double psbw[4]); 39 40 /* Get the vertical metrics for a character from Metrics2, if present. */ 41 int /*metrics_present*/ 42 zchar_get_metrics2(const gs_font_base * pbfont, const ref * pcnref, 43 double pwv[4]); 44 /* Get CDevProc. */ 45 bool zchar_get_CDevProc(const gs_font_base * pbfont, ref **ppcdevproc); 46 47 /* 48 * Consult Metrics2 and CDevProc, and call setcachedevice[2]. Return 49 * o_push_estack if we had to call a CDevProc, or if we are skipping the 50 * rendering process (only getting the metrics). 51 */ 52 int zchar_set_cache(i_ctx_t *i_ctx_p, const gs_font_base * pbfont, 53 const ref * pcnref, const double psb[2], 54 const double pwidth[2], const gs_rect * pbbox, 55 op_proc_t cont, op_proc_t *exec_cont, 56 const double Metrics2_sbw_default[4]); 57 58 /* 59 * Get the CharString data corresponding to a glyph. Return typecheck 60 * if it isn't a string. 61 */ 62 int zchar_charstring_data(gs_font *font, const ref *pgref, 63 gs_glyph_data_t *pgd); 64 65 /* 66 * Enumerate the next glyph from a directory. This is essentially a 67 * wrapper around dict_first/dict_next to implement the enumerate_glyph 68 * font procedure. 69 */ 70 int zchar_enumerate_glyph(const gs_memory_t *mem, const ref *prdict, int *pindex, gs_glyph *pglyph); 71 72 #endif /* icharout_INCLUDED */ 73