contrib/OWB: add correct SDL dependency, fix compilers used
[AROS-Contrib.git] / freetype1 / lib / extend / ftxerr18.c
blobac8934a01650660b9e13a69065fd14e81fb8336b
1 /****************************************************************************/
2 /* */
3 /* Erwin Dieterich, 15. 10. 1997 */
4 /* - 15. 08. 1999 */
5 /* */
6 /* TT_ErrToString: translate error codes to character strings */
7 /* */
8 /* This extension provides internationalized error strings from the */
9 /* various error messages. It uses the "gettext" package if available */
10 /* or returns English/American message strings if not. */
11 /* */
12 /* If you do not want to use it, or if you encounter some problems */
13 /* compiling this file, try to disable nls support when invoking */
14 /* ./configure (on Unix). */
15 /* */
16 /* */
17 /****************************************************************************/
19 #include "ttconfig.h"
21 #include "ftxerr18.h"
22 #include "ftxkern.h"
23 #include "ftxpost.h"
24 #include "ftxopen.h"
26 #ifdef HAVE_LOCALE_H
27 #include <locale.h>
28 #endif
30 #ifdef HAVE_LIBINTL_H
31 #include <libintl.h>
32 #undef _
33 #define _( String ) dgettext( "freetype", String )
34 #else
35 #define _( String ) ( String )
36 #endif
39 EXPORT_FUNC
40 TT_String* TT_ErrToString18( TT_Error error )
43 switch ( error )
45 /* ----- high-level API error codes ----- */
46 case TT_Err_Ok:
47 return _( "Successful function call, no error." );
49 case TT_Err_Invalid_Face_Handle:
50 return _( "Invalid face handle." );
51 case TT_Err_Invalid_Instance_Handle:
52 return _( "Invalid instance handle." );
53 case TT_Err_Invalid_Glyph_Handle:
54 return _( "Invalid glyph handle." );
55 case TT_Err_Invalid_CharMap_Handle:
56 return _( "Invalid charmap handle." );
57 case TT_Err_Invalid_Result_Address:
58 return _( "Invalid result address." );
59 case TT_Err_Invalid_Glyph_Index:
60 return _( "Invalid glyph index." );
61 case TT_Err_Invalid_Argument:
62 return _( "Invalid argument." );
63 case TT_Err_Could_Not_Open_File:
64 return _( "Could not open file." );
65 case TT_Err_File_Is_Not_Collection:
66 return _( "File is not a TrueType collection." );
68 case TT_Err_Table_Missing:
69 return _( "Mandatory table missing." );
70 case TT_Err_Invalid_Horiz_Metrics:
71 return _( "Invalid horizontal metrics (hmtx table broken)." );
72 case TT_Err_Invalid_CharMap_Format:
73 return _( "Invalid charmap format." );
74 case TT_Err_Invalid_PPem:
75 return _( "Invalid ppem value." );
76 case TT_Err_Invalid_Vert_Metrics:
77 return _( "Invalid vertical metrics (vmtx table broken)." );
79 case TT_Err_Invalid_File_Format:
80 return _( "Invalid file format." );
82 case TT_Err_Invalid_Engine:
83 return _( "Invalid engine." );
84 case TT_Err_Too_Many_Extensions:
85 return _( "Too many extensions." );
86 case TT_Err_Extensions_Unsupported:
87 return _( "Extensions unsupported." );
88 case TT_Err_Invalid_Extension_Id:
89 return _( "Invalid extension id." );
91 case TT_Err_No_Vertical_Data:
92 return _( "No vertical data in font." );
94 case TT_Err_Max_Profile_Missing:
95 return _( "Maximum Profile (maxp) table missing." );
96 case TT_Err_Header_Table_Missing:
97 return _( "Font Header (head) table missing." );
98 case TT_Err_Horiz_Header_Missing:
99 return _( "Horizontal Header (hhea) table missing." );
100 case TT_Err_Locations_Missing:
101 return _( "Index to Location (loca) table missing." );
102 case TT_Err_Name_Table_Missing:
103 return _( "Naming (name) table missing." );
104 case TT_Err_CMap_Table_Missing:
105 return _( "Character to Glyph Index Mapping (cmap) tables missing." );
106 case TT_Err_Hmtx_Table_Missing:
107 return _( "Horizontal Metrics (hmtx) table missing." );
108 case TT_Err_OS2_Table_Missing:
109 return _( "OS/2 table missing." );
110 case TT_Err_Post_Table_Missing:
111 return _( "PostScript (post) table missing." );
112 case TT_Err_Glyf_Table_Missing:
113 return _( "Glyph (glyf) table missing." );
116 /* ----- memory component error codes ----- */
117 case TT_Err_Out_Of_Memory:
118 return _( "Out of memory." );
121 /* ----- file component error codes ----- */
122 case TT_Err_Invalid_File_Offset:
123 return _( "Invalid file offset." );
124 case TT_Err_Invalid_File_Read:
125 return _( "Invalid file read." );
126 case TT_Err_Invalid_Frame_Access:
127 return _( "Invalid frame access." );
130 /* ----- glyph loader error codes ----- */
131 case TT_Err_Too_Many_Points:
132 return _( "Too many points." );
133 case TT_Err_Too_Many_Contours:
134 return _( "Too many contours." );
135 case TT_Err_Invalid_Composite:
136 return _( "Invalid composite glyph." );
137 case TT_Err_Too_Many_Ins:
138 return _( "Too many instructions." );
141 /* ----- byte-code interpreter error codes ----- */
142 case TT_Err_Invalid_Opcode:
143 return _( "Invalid opcode." );
144 case TT_Err_Too_Few_Arguments:
145 return _( "Too few arguments." );
146 case TT_Err_Stack_Overflow:
147 return _( "Stack overflow." );
148 case TT_Err_Code_Overflow:
149 return _( "Code overflow." );
150 case TT_Err_Bad_Argument:
151 return _( "Bad argument." );
152 case TT_Err_Divide_By_Zero:
153 return _( "Divide by zero." );
154 case TT_Err_Storage_Overflow:
155 return _( "Storage overflow." );
156 case TT_Err_Cvt_Overflow:
157 return _( "Control Value (cvt) table overflow." );
158 case TT_Err_Invalid_Reference:
159 return _( "Invalid reference." );
160 case TT_Err_Invalid_Distance:
161 return _( "Invalid distance." );
162 case TT_Err_Interpolate_Twilight:
163 return _( "Interpolate twilight points." );
164 case TT_Err_Debug_OpCode:
165 return _( "`DEBUG' opcode found." );
166 case TT_Err_ENDF_In_Exec_Stream:
167 return _( "`ENDF' in byte-code stream." );
168 case TT_Err_Out_Of_CodeRanges:
169 return _( "Out of code ranges." );
170 case TT_Err_Nested_DEFS:
171 return _( "Nested function definitions." );
172 case TT_Err_Invalid_CodeRange:
173 return _( "Invalid code range." );
174 case TT_Err_Invalid_Displacement:
175 return _( "Invalid displacement." );
176 case TT_Err_Execution_Too_Long:
177 return _( "Endless loop encountered while executing instructions." );
180 /* ----- internal failure error codes ----- */
181 case TT_Err_Nested_Frame_Access:
182 return _( "Nested frame access." );
183 case TT_Err_Invalid_Cache_List:
184 return _( "Invalid cache list." );
185 case TT_Err_Could_Not_Find_Context:
186 return _( "Could not find context." );
187 case TT_Err_Unlisted_Object:
188 return _( "Unlisted object." );
191 /* ----- scan-line converter error codes ----- */
192 case TT_Err_Raster_Pool_Overflow:
193 return _( "Raster pool overflow." );
194 case TT_Err_Raster_Negative_Height:
195 return _( "Raster: negative height encountered." );
196 case TT_Err_Raster_Invalid_Value:
197 return _( "Raster: invalid value." );
198 case TT_Err_Raster_Not_Initialized:
199 return _( "Raster not initialized." );
202 /* ----- engine extensions error codes ----- */
203 case TT_Err_Invalid_Kerning_Table_Format:
204 return _( "Invalid kerning (kern) table format." );
205 case TT_Err_Invalid_Kerning_Table:
206 return _( "Invalid kerning (kern) table." );
207 case TT_Err_Invalid_Post_Table_Format:
208 return _( "Invalid PostScript (post) table format." );
209 case TT_Err_Invalid_Post_Table:
210 return _( "Invalid PostScript (post) table." );
213 /* ----- TrueType Open extension error codes ----- */
215 case TTO_Err_Invalid_SubTable_Format:
216 return _( "Invalid TrueType Open subtable format." );
217 case TTO_Err_Invalid_SubTable:
218 return _( "Invalid TrueType Open subtable." );
219 case TTO_Err_Not_Covered:
220 return _( "Glyph(s) not covered by lookup." );
221 case TTO_Err_Too_Many_Nested_Contexts:
222 return _( "Too many nested context substitutions." );
223 case TTO_Err_Invalid_GSUB_SubTable_Format:
224 return _( "Invalid glyph substitution (GSUB) table format." );
225 case TTO_Err_Invalid_GSUB_SubTable:
226 return _( "Invalid glyph substitution (GSUB) table." );
227 case TTO_Err_Invalid_GPOS_SubTable_Format:
228 return _( "Invalid glyph positioning (GPOS) table format." );
229 case TTO_Err_Invalid_GPOS_SubTable:
230 return _( "Invalid glyph positioning (GPOS) table." );
233 default:
237 return _( "Invalid Error Number." );
241 /* END */