* src/smooth/ftgrays.c (gray_raster_render): Check `outline' correctly. Whitespace.
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
diff --git a/ChangeLog b/ChangeLog
index 2f0f31c..d4051d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,20 +1,24 @@
+2007-12-30 Werner Lemberg <wl@gnu.org>
+
+ * src/smooth/ftgrays.c (gray_raster_render): Check `outline'
+ correctly.
+
2007-12-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Improvement of POSIX resource-fork accessor to load unsorted
- references in a resource. In HelveLTMM (resource-fork
- PostScript Type1 font bundled to Mac OS X since 10.3.x),
- the appearance order of PFB chunks is not sorted.
- Sorting the chunks by reference IDs is required.
+ references in a resource. In HelveLTMM (resource-fork PostScript
+ Type1 font bundled with Mac OS X since 10.3.x), the appearance order
+ of PFB chunks is not sorted; sorting the chunks by reference IDs is
+ required.
- * include/freetype/internal/ftrfork.h (FT_RFork_Ref):
- New structure type to store a pair of reference ID and offset
- to the chunk.
+ * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure
+ type to store a pair of reference ID and offset to the chunk.
- * src/base/ftrfork.c (ft_raccess_sort_ref_by_id):
- New function to sort FT_RFork_Ref by their reference ID.
+ * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to
+ sort FT_RFork_Ref by their reference IDs.
- (FT_Raccess_Get_DataOffsets): Returns an array of offsets
- that is sorted by reference ID.
+ (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is
+ sorted by reference ID.
2007-12-14 Werner Lemberg <wl@gnu.org>
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 1c428f1..4f3a6d2 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -28,7 +28,7 @@
#define __FTIMAGE_H__
-/* _STANDALONE_ is from ftgrays.c */
+ /* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
#include <ft2build.h>
#endif
@@ -1075,6 +1075,7 @@ FT_BEGIN_HEADER
#define FT_Raster_New_Func FT_Raster_NewFunc
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -1091,6 +1092,7 @@ FT_BEGIN_HEADER
#define FT_Raster_Done_Func FT_Raster_DoneFunc
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -1125,6 +1127,7 @@ FT_BEGIN_HEADER
#define FT_Raster_Reset_Func FT_Raster_ResetFunc
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -1150,6 +1153,7 @@ FT_BEGIN_HEADER
#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -1190,6 +1194,7 @@ FT_BEGIN_HEADER
#define FT_Raster_Render_Func FT_Raster_RenderFunc
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -1211,12 +1216,12 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Raster_Funcs_
{
- FT_Glyph_Format glyph_format;
- FT_Raster_NewFunc raster_new;
- FT_Raster_ResetFunc raster_reset;
- FT_Raster_SetModeFunc raster_set_mode;
- FT_Raster_RenderFunc raster_render;
- FT_Raster_DoneFunc raster_done;
+ FT_Glyph_Format glyph_format;
+ FT_Raster_NewFunc raster_new;
+ FT_Raster_ResetFunc raster_reset;
+ FT_Raster_SetModeFunc raster_set_mode;
+ FT_Raster_RenderFunc raster_render;
+ FT_Raster_DoneFunc raster_done;
} FT_Raster_Funcs;
diff --git a/include/freetype/internal/ftrfork.h b/include/freetype/internal/ftrfork.h
index 7f1a3f4..aa573c8 100644
--- a/include/freetype/internal/ftrfork.h
+++ b/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (specification). */
/* */
-/* Copyright 2004, 2006 by */
+/* Copyright 2004, 2006, 2007 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -36,14 +36,19 @@ FT_BEGIN_HEADER
/* Don't forget to increment the number if you add a new guessing rule. */
#define FT_RACCESS_N_RULES 9
- /* Structure to describe a reference in resource, by its resource id */
- /* and internal offset. `POST' resource expects to be concatenated by */
- /* the order of resource id, instead of its appearance in the file. */
- typedef struct FT_RFork_Ref_ {
- FT_UShort res_id;
- FT_ULong offset;
+
+ /* A structure to describe a reference in a resource by its resource ID */
+ /* and internal offset. The `POST' resource expects to be concatenated */
+ /* by the order of resource IDs instead of its appearance in the file. */
+
+ typedef struct FT_RFork_Ref_
+ {
+ FT_UShort res_id;
+ FT_ULong offset;
+
} FT_RFork_Ref;
+
/*************************************************************************/
/* */
/* <Function> */
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index ac6602f..5a835ee 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
-/* Copyright 2004, 2005, 2006 by */
+/* Copyright 2004, 2005, 2006, 2007 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -137,11 +137,11 @@
FT_RFork_Ref* b )
{
if ( a->res_id < b->res_id )
- return ( -1 );
+ return -1;
else if ( a->res_id > b->res_id )
- return ( 1 );
+ return 1;
else
- return ( 0 );
+ return 0;
}
@@ -154,12 +154,12 @@
FT_Long **offsets,
FT_Long *count )
{
- FT_Error error;
- int i, j, cnt, subcnt;
- FT_Long tag_internal, rpos;
- FT_Memory memory = library->memory;
- FT_Long temp;
- FT_Long *offsets_internal;
+ FT_Error error;
+ int i, j, cnt, subcnt;
+ FT_Long tag_internal, rpos;
+ FT_Memory memory = library->memory;
+ FT_Long temp;
+ FT_Long *offsets_internal;
FT_RFork_Ref *ref;
@@ -210,7 +210,7 @@
ref[j].offset = temp & 0xFFFFFFL;
}
- ft_qsort( ref, *count, sizeof( FT_RFork_Ref ),
+ ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
( int(*)(const void*, const void*) )
ft_raccess_sort_ref_by_id );
@@ -225,8 +225,9 @@
offsets_internal[j] = rdata_pos + ref[j].offset;
*offsets = offsets_internal;
- error = FT_Err_Ok;
-Exit:
+ error = FT_Err_Ok;
+
+ Exit:
FT_FREE( ref );
return error;
}
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 5a4a544..add1dd2 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -144,10 +144,10 @@
#include "ftsmerrs.h"
-#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
-#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline
-#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory
-#define ErrRaster_Invalid_Argument Smooth_Err_Bad_Argument
+#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
+#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline
+#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory
+#define ErrRaster_Invalid_Argument Smooth_Err_Bad_Argument
#endif /* !_STANDALONE_ */
@@ -1659,7 +1659,7 @@
ras.count_ex = ras.max_ex - ras.min_ex;
ras.count_ey = ras.max_ey - ras.min_ey;
- /* simple heuristic used to speed-up the bezier decomposition -- see */
+ /* simple heuristic used to speed up the bezier decomposition -- see */
/* the code in gray_render_conic() and gray_render_cubic() for more */
/* details */
ras.conic_level = 32;
@@ -1796,11 +1796,14 @@
if ( !raster || !raster->buffer || !raster->buffer_size )
return ErrRaster_Invalid_Argument;
+ if ( !outline )
+ return ErrRaster_Invalid_Outline;
+
/* return immediately if the outline is empty */
if ( outline->n_points == 0 || outline->n_contours <= 0 )
return 0;
- if ( !outline || !outline->contours || !outline->points )
+ if ( !outline->contours || !outline->points )
return ErrRaster_Invalid_Outline;
if ( outline->n_points !=
@@ -1850,10 +1853,10 @@
gray_init_cells( worker, raster->buffer, raster->buffer_size );
- ras.outline = *outline;
- ras.num_cells = 0;
- ras.invalid = 1;
- ras.band_size = raster->band_size;
+ ras.outline = *outline;
+ ras.num_cells = 0;
+ ras.invalid = 1;
+ ras.band_size = raster->band_size;
ras.num_gray_spans = 0;
if ( target_map )