2002-03-29 08:43:04 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* fterrdef.h */
|
|
|
|
/* */
|
|
|
|
/* FreeType error codes (specification). */
|
|
|
|
/* */
|
2006-03-26 09:19:07 +02:00
|
|
|
/* Copyright 2002, 2004, 2006 by */
|
2002-03-29 08:43:04 +01: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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************/
|
|
|
|
/*******************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** LIST OF ERROR CODES/MESSAGES *****/
|
|
|
|
/***** *****/
|
|
|
|
/*******************************************************************/
|
|
|
|
/*******************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
|
|
|
|
/* including this file. */
|
|
|
|
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* generic errors */
|
|
|
|
|
|
|
|
FT_NOERRORDEF_( Ok, 0x00, \
|
|
|
|
"no error" )
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"cannot open resource" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"unknown file format" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"broken file" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Version, 0x04, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid FreeType version" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"module version is too low" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Argument, 0x06, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid argument" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"unimplemented feature" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Table, 0x08, \
|
|
|
|
"broken table" )
|
|
|
|
FT_ERRORDEF_( Invalid_Offset, 0x09, \
|
|
|
|
"broken offset within table" )
|
* include/freetype/fterrdef.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c,
src/base/ftutil.c: udpating the memory management functions and
macros to safely deal with array size buffer overflows, this
corresponds to attemps to allocate arrays that are too large. For
an example, consider the following code:
count = read_uint32_from_file();
array = malloc( sizeof(Item) * count );
for ( nn = 0; nn < count; nn++ )
array[nn] = read_item_from_file();
if 'count' is larger than FT_UINT_MAX/sizeof(Item), the multiplication
will overflow and the array allocated will be smaller than the data
read from the file. In this case, the heap will be trashed, and this
can be used as a denial-of-service, or make the engine crash later.
the FT_ARRAY_NEW and FT_ARRAY_RENEW macro now check that the new
count is no more than FT_INT_MAX/item_size, otherwise, a new error,
named 'FT_Err_Array_Too_Large' will be returned.
note that the memory debugger now works again when FT_DEBUG_MEMORY
is defined, and FT_STRICT_ALIASING has disappeared, the corresponding
code being now the default.
2006-05-02 08:34:27 +02:00
|
|
|
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
|
|
|
|
"array allocation size too large" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* glyph/character errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid glyph index" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid character code" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"unsupported glyph image format" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"cannot render this glyph format" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Outline, 0x14, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid outline" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Composite, 0x15, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid composite glyph" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many hints" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid pixel size" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* handle errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Invalid_Handle, 0x20, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid object handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid library handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid module handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid face handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid size handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid glyph slot handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid charmap handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid cache manager handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid stream handle" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* driver errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many modules" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many extensions" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* memory errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"out of memory" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Unlisted_Object, 0x41, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"unlisted object" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* stream errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"cannot open stream" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid stream seek" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid stream skip" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid stream read" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid stream operation" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid frame operation" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"nested frame access" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid frame read" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* raster errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"raster uninitialized" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"raster corrupted" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Raster_Overflow, 0x62, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"raster overflow" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"negative height while rastering" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* cache errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many registered caches" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* TrueType and SFNT errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid opcode" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too few arguments" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Stack_Overflow, 0x82, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"stack overflow" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Code_Overflow, 0x83, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"code overflow" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Bad_Argument, 0x84, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"bad argument" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"division by zero" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Reference, 0x86, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid reference" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Debug_OpCode, 0x87, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"found debug opcode" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"found ENDF opcode in execution stream" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Nested_DEFS, 0x89, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"nested DEFS" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid code range" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"execution context too long" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many function definitions" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"too many instruction definitions" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Table_Missing, 0x8E, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"SFNT font table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"horizontal header (hhea) table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Locations_Missing, 0x90, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"locations (loca) table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"name table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"character map (cmap) table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"horizontal metrics (hmtx) table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"PostScript (post) table missing" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid horizontal metrics" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid character map (cmap) format" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_PPem, 0x97, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid ppem value" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid vertical metrics" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"could not find context" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid PostScript (post) table format" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"invalid PostScript (post) table" )
|
2002-02-22 18:57:05 +01:00
|
|
|
|
|
|
|
/* CFF, CID, and Type 1 errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Syntax_Error, 0xA0, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"opcode syntax error" )
|
2002-02-22 18:57:05 +01:00
|
|
|
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
|
2002-05-21 16:13:01 +02:00
|
|
|
"argument stack underflow" )
|
2004-02-12 09:33:20 +01:00
|
|
|
FT_ERRORDEF_( Ignore, 0xA2, \
|
|
|
|
"ignore" )
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
/* BDF errors */
|
|
|
|
|
|
|
|
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
|
|
|
|
"`STARTFONT' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
|
|
|
|
"`FONT' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
|
|
|
|
"`SIZE' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \
|
|
|
|
"`CHARS' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \
|
|
|
|
"`STARTCHAR' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \
|
|
|
|
"`ENCODING' field missing" )
|
|
|
|
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
|
|
|
|
"`BBX' field missing" )
|
2006-03-26 09:19:07 +02:00
|
|
|
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \
|
|
|
|
"`BBX' too big" )
|
2002-03-29 08:43:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|