Introducing new error code FT_Err_Invalid_Cache_Handle. Regrouping of error codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h
index c33ecf6..4dda516 100644
--- a/include/freetype/fterrors.h
+++ b/include/freetype/fterrors.h
@@ -18,9 +18,9 @@
/*************************************************************************/
/* */
- /* This file is used to define the FreeType error enumeration constants */
+ /* This file is used to define the FreeType error enumeration constants. */
/* It can also be used to create an error message table easily with */
- /* something like: */
+ /* something like */
/* */
/* { */
/* #undef FTERRORS_H */
@@ -62,91 +62,105 @@
FT_ERROR_START_LIST
#endif
+ /* generic errors */
+
FT_ERRORDEF( FT_Err_Ok, 0x0000, \
"no error" )
FT_ERRORDEF( FT_Err_Cannot_Open_Resource, 0x0001, \
- "can't open stream" )
+ "cannot open resource" )
FT_ERRORDEF( FT_Err_Unknown_File_Format, 0x0002, \
"unknown file format" )
FT_ERRORDEF( FT_Err_Invalid_File_Format, 0x0003, \
"broken file" )
-
- FT_ERRORDEF( FT_Err_Invalid_Argument, 0x0010, \
+ FT_ERRORDEF( FT_Err_Invalid_Version, 0x0004, \
+ "invalid FreeType version" )
+ FT_ERRORDEF( FT_Err_Lower_Module_Version, 0x0005, \
+ "module version is too low" )
+ FT_ERRORDEF( FT_Err_Invalid_Argument, 0x0006, \
"invalid argument" )
- FT_ERRORDEF( FT_Err_Invalid_Handle, 0x0011, \
- "invalid object handle" )
- FT_ERRORDEF( FT_Err_Invalid_Glyph_Index, 0x0012, \
+ FT_ERRORDEF( FT_Err_Unimplemented_Feature, 0x0007, \
+ "unimplemented feature" )
+
+ /* glyph/character errors */
+
+ FT_ERRORDEF( FT_Err_Invalid_Glyph_Index, 0x0010, \
"invalid glyph index" )
- FT_ERRORDEF( FT_Err_Invalid_Character_Code, 0x0013, \
+ FT_ERRORDEF( FT_Err_Invalid_Character_Code, 0x0011, \
"invalid character code" )
-
- FT_ERRORDEF( FT_Err_Unimplemented_Feature, 0x0020, \
- "unimplemented feature" )
- FT_ERRORDEF( FT_Err_Invalid_Glyph_Format, 0x0021, \
+ FT_ERRORDEF( FT_Err_Invalid_Glyph_Format, 0x0012, \
"unsupported glyph image format" )
- FT_ERRORDEF( FT_Err_Cannot_Render_Glyph, 0x0022, \
+ FT_ERRORDEF( FT_Err_Cannot_Render_Glyph, 0x0013, \
"cannot render this glyph format" )
+ FT_ERRORDEF( FT_Err_Invalid_Outline, 0x0014, \
+ "invalid outline" )
+ FT_ERRORDEF( FT_Err_Invalid_Composite, 0x0015, \
+ "invalid composite glyph" )
+ FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0016, \
+ "too many hints" )
- FT_ERRORDEF( FT_Err_Invalid_Library_Handle, 0x0030, \
+ /* handle errors */
+
+ FT_ERRORDEF( FT_Err_Invalid_Handle, 0x0020, \
+ "invalid object handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Library_Handle, 0x0021, \
"invalid library handle" )
- FT_ERRORDEF( FT_Err_Invalid_Driver_Handle, 0x0031, \
+ FT_ERRORDEF( FT_Err_Invalid_Driver_Handle, 0x0022, \
"invalid module handle" )
- FT_ERRORDEF( FT_Err_Invalid_Face_Handle, 0x0032, \
+ FT_ERRORDEF( FT_Err_Invalid_Face_Handle, 0x0023, \
"invalid face handle" )
- FT_ERRORDEF( FT_Err_Invalid_Size_Handle, 0x0033, \
+ FT_ERRORDEF( FT_Err_Invalid_Size_Handle, 0x0024, \
"invalid size handle" )
- FT_ERRORDEF( FT_Err_Invalid_Slot_Handle, 0x0034, \
+ FT_ERRORDEF( FT_Err_Invalid_Slot_Handle, 0x0025, \
"invalid glyph slot handle" )
- FT_ERRORDEF( FT_Err_Invalid_CharMap_Handle, 0x0035, \
+ FT_ERRORDEF( FT_Err_Invalid_CharMap_Handle, 0x0026, \
"invalid charmap handle" )
- FT_ERRORDEF( FT_Err_Invalid_Outline, 0x0036, \
- "invalid outline" )
- FT_ERRORDEF( FT_Err_Invalid_Version, 0x0037, \
- "invalid FreeType version" )
- FT_ERRORDEF( FT_Err_Lower_Module_Version, 0x0038, \
- "module version is too low" )
+ FT_ERRORDEF( FT_Err_Invalid_Cache_Handle, 0x0027, \
+ "invalid cache manager handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Handle, 0x0028, \
+ "invalid stream handle" )
- FT_ERRORDEF( FT_Err_Too_Many_Drivers, 0x0040, \
+ /* driver errors */
+
+ FT_ERRORDEF( FT_Err_Too_Many_Drivers, 0x0030, \
"too many modules" )
- FT_ERRORDEF( FT_Err_Too_Many_Extensions, 0x0041, \
+ FT_ERRORDEF( FT_Err_Too_Many_Extensions, 0x0031, \
"too many extensions" )
- FT_ERRORDEF( FT_Err_Out_Of_Memory, 0x0050, \
+ /* memory errors */
+
+ FT_ERRORDEF( FT_Err_Out_Of_Memory, 0x0040, \
"out of memory" )
- FT_ERRORDEF( FT_Err_Unlisted_Object, 0x0051, \
+ FT_ERRORDEF( FT_Err_Unlisted_Object, 0x0041, \
"unlisted object" )
- FT_ERRORDEF( FT_Err_Invalid_Stream_Handle, 0x0060, \
- "invalid stream handle" )
- FT_ERRORDEF( FT_Err_Cannot_Open_Stream, 0x0061, \
+ /* stream errors */
+
+ FT_ERRORDEF( FT_Err_Cannot_Open_Stream, 0x0051, \
"cannot open stream" )
- FT_ERRORDEF( FT_Err_Invalid_Stream_Seek, 0x0062, \
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Seek, 0x0052, \
"invalid stream seek" )
- FT_ERRORDEF( FT_Err_Invalid_Stream_Skip, 0x0063, \
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Skip, 0x0053, \
"invalid stream skip" )
- FT_ERRORDEF( FT_Err_Invalid_Stream_Read, 0x0064, \
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Read, 0x0054, \
"invalid stream read" )
- FT_ERRORDEF( FT_Err_Invalid_Stream_Operation, 0x0065, \
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Operation, 0x0055, \
"invalid stream operation" )
- FT_ERRORDEF( FT_Err_Invalid_Frame_Operation, 0x0066, \
+ FT_ERRORDEF( FT_Err_Invalid_Frame_Operation, 0x0056, \
"invalid frame operation" )
- FT_ERRORDEF( FT_Err_Nested_Frame_Access, 0x0067, \
+ FT_ERRORDEF( FT_Err_Nested_Frame_Access, 0x0057, \
"nested frame access" )
- FT_ERRORDEF( FT_Err_Invalid_Frame_Read, 0x0068, \
+ FT_ERRORDEF( FT_Err_Invalid_Frame_Read, 0x0058, \
"invalid frame read" )
- FT_ERRORDEF( FT_Err_Invalid_Composite, 0x0070, \
- "invalid composite glyph" )
- FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0071, \
- "too many hints" )
+ /* raster errors */
- FT_ERRORDEF( FT_Err_Raster_Uninitialized, 0x0080, \
+ FT_ERRORDEF( FT_Err_Raster_Uninitialized, 0x0060, \
"raster uninitialized" )
- FT_ERRORDEF( FT_Err_Raster_Corrupted, 0x0081, \
+ FT_ERRORDEF( FT_Err_Raster_Corrupted, 0x0061, \
"raster corrupted" )
- FT_ERRORDEF( FT_Err_Raster_Overflow, 0x0082, \
+ FT_ERRORDEF( FT_Err_Raster_Overflow, 0x0062, \
"raster overflow" )
- FT_ERRORDEF( FT_Err_Raster_Negative_Height, 0x0083, \
+ FT_ERRORDEF( FT_Err_Raster_Negative_Height, 0x0063, \
"negative height while rastering" )
/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index 761703e..63d0a16 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -613,7 +613,10 @@
FTC_Image_Cache cache;
- if ( !acache || !manager || !manager->library )
+ if ( !manager )
+ return FT_Err_Invalid_Cache_Handle;
+
+ if ( !acache || !manager->library )
return FT_Err_Invalid_Argument;
*acache = 0;
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index 828b637..740e71d 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -293,7 +293,7 @@
FT_Face* aface )
{
if ( !manager )
- return FT_Err_Invalid_Argument;
+ return FT_Err_Invalid_Cache_Handle;
return FT_Lru_Lookup( manager->faces_lru,
(FT_LruKey)face_id,