1 /* Copyright (C) 1992, 1995, 1997, 1999 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: gxttfb.h,v 1.10 2004/01/28 09:05:05 igor Exp $ */ 18 /* A bridge to True Type interpreter. */ 19 20 #ifndef gxttfb_INCLUDED 21 # define gxttfb_INCLUDED 22 23 #include "ttfoutl.h" 24 25 #ifndef gx_ttfReader_DEFINED 26 # define gx_ttfReader_DEFINED 27 typedef struct gx_ttfReader_s gx_ttfReader; 28 #endif 29 30 #ifndef gs_font_type42_DEFINED 31 # define gs_font_type42_DEFINED 32 typedef struct gs_font_type42_s gs_font_type42; 33 #endif 34 35 struct gx_ttfReader_s { 36 ttfReader super; 37 int pos; 38 bool error; 39 int extra_glyph_index; 40 gs_font_type42 *pfont; 41 gs_memory_t *memory; 42 gs_glyph_data_t glyph_data; 43 /* When TT interpreter is invoked, a font and the TT interpreter instance 44 may use different memory allocators (local and global correspondingly). 45 Since we don't want to change Free Type function prototypes, 46 we place the gx_ttfReader instance into the global memory, 47 to provide an access to it through TExecution_Context. 48 Due to that, the fields 'pfont' and 'glyph_data' may contain pointers from global 49 to local memory. They must be NULL when a garbager is invoked. 50 We reset them whan the TT interpreter exits. 51 */ 52 }; 53 54 gx_ttfReader *gx_ttfReader__create(gs_memory_t *mem); 55 void gx_ttfReader__destroy(gx_ttfReader *this); 56 void gx_ttfReader__set_font(gx_ttfReader *this, gs_font_type42 *pfont); 57 ttfFont *ttfFont__create(gs_font_dir *dir); 58 void ttfFont__destroy(ttfFont *this, gs_font_dir *dir); 59 int ttfFont__Open_aux(ttfFont *this, ttfInterpreter *tti, gx_ttfReader *r, gs_font_type42 *pfont, 60 const gs_matrix * char_tm, const gs_log2_scale_point *log2_scale, 61 bool design_grid); 62 int gx_ttf_outline(ttfFont *ttf, gx_ttfReader *r, gs_font_type42 *pfont, int glyph_index, 63 const gs_matrix *m, const gs_log2_scale_point * pscale, 64 gx_path *path, bool grid_fit); 65 66 #endif /* gxttfb_INCLUDED */ 67