1
/***************************************************************************/
5
/* High-level interface for the `PSNames' module (in charge of */
6
/* various functions related to Postscript glyph names conversion). */
8
/* Copyright 1996-2001, 2002 by */
9
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
11
/* This file is part of the FreeType project, and may only be used, */
12
/* modified, and distributed under the terms of the FreeType project */
13
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14
/* this file you indicate that you have read the license and */
15
/* understand and accept it fully. */
17
/***************************************************************************/
25
#include FT_FREETYPE_H
31
/*************************************************************************/
34
/* PS_Unicode_Value_Func */
37
/* A function used to return the Unicode index corresponding to a */
38
/* given glyph name. */
41
/* glyph_name :: The glyph name. */
44
/* The Unicode character index resp. the non-Unicode value 0xFFFF if */
45
/* the glyph name has no known Unicode meaning. */
48
/* This function is able to map several different glyph names to the */
49
/* same Unicode value, according to the rules defined in the Adobe */
50
/* Glyph List table. */
52
/* This function will not be compiled if the configuration macro */
53
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
56
(*PS_Unicode_Value_Func)( const char* glyph_name );
59
/*************************************************************************/
62
/* PS_Unicode_Index_Func */
65
/* A function used to return the glyph index corresponding to a given */
69
/* num_glyphs :: The number of glyphs in the face. */
71
/* glyph_names :: An array of glyph name pointers. */
73
/* unicode :: The Unicode value. */
76
/* The glyph index resp. 0xFFFF if no glyph corresponds to this */
80
/* This function is able to recognize several glyph names per Unicode */
81
/* value, according to the Adobe Glyph List. */
83
/* This function will not be compiled if the configuration macro */
84
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
87
(*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
88
const char** glyph_names,
92
/*************************************************************************/
95
/* PS_Macintosh_Name_Func */
98
/* A function used to return the glyph name corresponding to an Apple */
99
/* glyph name index. */
102
/* name_index :: The index of the Mac name. */
105
/* The glyph name, or 0 if the index is invalid. */
108
/* This function will not be compiled if the configuration macro */
109
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
112
(*PS_Macintosh_Name_Func)( FT_UInt name_index );
116
(*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
119
typedef struct PS_UniMap_
127
/*************************************************************************/
133
/* A simple table used to map Unicode values to glyph indices. It is */
134
/* built by the PS_Build_Unicodes table according to the glyphs */
135
/* present in a font file. */
138
/* num_codes :: The number of glyphs in the font that match a given */
141
/* unicodes :: An array of unicode values, sorted in increasing */
144
/* gindex :: An array of glyph indices, corresponding to each */
148
/* Use the function PS_Lookup_Unicode() to retrieve the glyph index */
149
/* corresponding to a given Unicode character code. */
151
typedef struct PS_Unicodes_
160
(*PS_Build_Unicodes_Func)( FT_Memory memory,
162
const char** glyph_names,
163
PS_Unicodes* unicodes );
166
(*PS_Lookup_Unicode_Func)( PS_Unicodes* unicodes,
170
(*PS_Next_Unicode_Func)( PS_Unicodes* unicodes,
174
/*************************************************************************/
177
/* PSNames_Interface */
180
/* This structure defines the PSNames interface. */
183
/* unicode_value :: A function used to convert a glyph name */
184
/* into a Unicode character code. */
186
/* build_unicodes :: A function which builds up the Unicode */
189
/* lookup_unicode :: A function used to return the glyph index */
190
/* corresponding to a given Unicode */
193
/* macintosh_name :: A function used to return the standard */
194
/* Apple glyph Postscript name corresponding */
195
/* to a given string index (used by the */
196
/* TrueType `post' table). */
198
/* adobe_std_strings :: A function that returns a pointer to a */
199
/* Adobe Standard String for a given SID. */
201
/* adobe_std_encoding :: A table of 256 unsigned shorts that maps */
202
/* character codes in the Adobe Standard */
203
/* Encoding to SIDs. */
205
/* adobe_expert_encoding :: A table of 256 unsigned shorts that maps */
206
/* character codes in the Adobe Expert */
207
/* Encoding to SIDs. */
210
/* `unicode_value' and `unicode_index' will be set to 0 if the */
211
/* configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is */
214
/* `macintosh_name' will be set to 0 if the configuration macro */
215
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
217
typedef struct PSNames_Interface_
219
PS_Unicode_Value_Func unicode_value;
220
PS_Build_Unicodes_Func build_unicodes;
221
PS_Lookup_Unicode_Func lookup_unicode;
222
PS_Macintosh_Name_Func macintosh_name;
224
PS_Adobe_Std_Strings_Func adobe_std_strings;
225
const unsigned short* adobe_std_encoding;
226
const unsigned short* adobe_expert_encoding;
228
PS_Next_Unicode_Func next_unicode;
233
typedef PSNames_Interface* PSNames_Service;
238
#endif /* __PSNAMES_H__ */