summaryrefslogtreecommitdiff
path: root/src/smooth
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2001-10-10 19:56:42 +0000
committerWerner Lemberg <wl@gnu.org>2001-10-10 19:56:42 +0000
commit80b8d77024768b6cc5921173d963c01207818106 (patch)
tree825efb2c1e8a82fd86b9b3b56377eabb1096d752 /src/smooth
parent1cd4f85e14fa769725047d83bc16d54217062525 (diff)
downloadfreetype2-80b8d77024768b6cc5921173d963c01207818106.tar.gz
Fixed a bug in `glnames.py' that prevented it from generating
correct glyph names tables. This resulted in the unavailability of certain glyphs like `Cacute', `cacute' and `lslash' in Unicode charmaps, even if these were present in the font (causing problems for Polish users). * src/tools/glnames.py (mac_standard_names): Fixed. (t1_standard_strings): Some fixes and renamed to ... (sid_standard_names): This. (t1_expert_encoding): Fixed. (the_adobe_glyph_list): Renamed to ... (adobe_glyph_names): This. (the_adobe_glyphs): Renamed to ... (adobe_glyph_values): This. (dump_mac_indices, dump_glyph_list, dump_unicode_values, main): Updated. * src/psnames/pstables.h: Regenerated. * src/psnames/psmodule.c (PS_Unicode_Value): Fix offset. Fix return value. Use `sid_standard_table' and `ps_names_to_unicode' instead of `t1_standard_glyphs' and `names_to_unicode'. (PS_Macintosh_Name): Use `ps_glyph_names' instead of `standard_glyph_names'. (PS_Standard_Strings): Use `sid_standard_names' instead of `t1_standard_glyphs'. * doc/BUGS, doc/TODO: New documents. * src/cache/ftlru.c (FT_Lru_Lookup_Node): Fixed a bug that prevented correct LRU behaviour. setjmp() and longjmp() are now used for rollback (i.e. when memory pool overflow occurs). Function names are now all uniformly prefixed with `gray_'. * src/smooth/ftgrays.c: Include <setjmp.h>. (ErrRaster_MemoryOverflow): New macro. (TArea): New type to store area values in each cell (using `int' was too small on 16-bit systems). <limits.h> is included to properly get the needed data type. (TCell, TRaster): Use it. (TRaster): New element `jump_buffer'. (gray_compute_cbox): Use `RAS_ARG' as the only parameter and get `outline' from it. (gray_record_cell): Use longjmp(). (gray_set_cell): Use gray_record_cell() for error handling. (gray_render_line, gray_render_conic, gray_render_cubic): Simplify. (gray_convert_glyph_inner): New function, using setjmp(). (gray_convert_glyph): Use it. Provide a public API to manage multiple size objects for a given FT_Face in the new header file `ftsizes.h'. * include/freetype/ftsizes.h: New header file, * include/freetype/internal/ftobjs.h: Use it. Remove declarations of FT_New_Size and FT_Done_Size (moved to ftsizes.h). * include/freetype/config/ftheader.h (FT_SIZES_H): New macro. * src/base/ftobjs.c (FT_Activate_Size): New function. * src/cache/ftcmanag.c: Include ftsizes.h. (ftc_manager_init_size, ftc_manager_flush_size): Use FT_Activate_Size.
Diffstat (limited to 'src/smooth')
-rw-r--r--src/smooth/ftgrays.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 41dcb89b1..3b8fa7029 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000 by */
+/* Copyright 2000-2001 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -32,8 +32,8 @@
/* cc -c -D_STANDALONE_ ftgrays.c */
/* */
/* The renderer can be initialized with a call to */
- /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */
- /* generated with a call to `ft_gray_raster.gray_raster_render'. */
+ /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */
+ /* generated with a call to `ft_gray_raster.gray_raster_render'. */
/* */
/* See the comments and documentation in the file `ftimage.h' for */
/* more details on how the raster works. */
@@ -202,16 +202,16 @@
/* TYPE DEFINITIONS */
/* */
- /* don't change the following types to FT_Int or FT_Pos, since we might */
- /* need to define them to "float" or "double" when experimenting with */
- /* new algorithms.. */
+ /* don't change the following types to FT_Int or FT_Pos, since we might */
+ /* need to define them to "float" or "double" when experimenting with */
+ /* new algorithms */
typedef int TScan; /* integer scanline/pixel coordinate */
typedef long TPos; /* sub-pixel coordinate */
- /* determine the type used to store cell areas. This normally takes at */
- /* least PIXEL_BYTES*2 + 1, on 16-bit systems, we need to use 'longs' */
- /* instead of 'ints'.. otherwise bad things happen.. */
+ /* determine the type used to store cell areas. This normally takes at */
+ /* least PIXEL_BYTES*2 + 1. On 16-bit systems, we need to use `long' */
+ /* instead of `int', otherwise bad things happen */
#if PIXEL_BITS <= 7
@@ -219,13 +219,14 @@
#else /* PIXEL_BITS >= 8 */
- /* approximately determine the size of integers using an ANSI-C header */
-# include <limits.h>
-# if UINT_MAX == 0xFFFFU
+ /* approximately determine the size of integers using an ANSI-C header */
+#include <limits.h>
+
+#if UINT_MAX == 0xFFFFU
typedef long TArea;
-# else
- typedef int TArea;
-# endif
+#else
+ typedef int TArea;
+#endif
#endif /* PIXEL_BITS >= 8 */
@@ -292,12 +293,12 @@
void* render_span_data;
int span_y;
- int band_size;
- int band_shoot;
- int conic_level;
- int cubic_level;
+ int band_size;
+ int band_shoot;
+ int conic_level;
+ int cubic_level;
- void* memory;
+ void* memory;
jmp_buf jump_buffer;
} TRaster, *PRaster;
@@ -739,7 +740,7 @@
if ( level <= 1 )
{
/* we compute the mid-point directly in order to avoid */
- /* calling gray_split_conic() */
+ /* calling gray_split_conic() */
TPos to_x, to_y, mid_x, mid_y;
@@ -1182,7 +1183,7 @@
FT_Raster raster )
{
gray_render_line( (PRaster)raster,
- UPSCALE( to->x ), UPSCALE( to->y ) );
+ UPSCALE( to->x ), UPSCALE( to->y ) );
return 0;
}
@@ -1505,9 +1506,9 @@
{
#undef SCALED
#if 0
-# define SCALED( x ) ( ( (x) << shift ) - delta )
+#define SCALED( x ) ( ( (x) << shift ) - delta )
#else
-# define SCALED( x) (x)
+#define SCALED( x ) (x)
#endif
FT_Vector v_last;
@@ -1720,10 +1721,10 @@
static
const FT_Outline_Funcs interface =
{
- (FT_Outline_MoveTo_Func) gray_move_to,
- (FT_Outline_LineTo_Func) gray_line_to,
- (FT_Outline_ConicTo_Func) gray_conic_to,
- (FT_Outline_CubicTo_Func) gray_cubic_to,
+ (FT_Outline_MoveTo_Func) gray_move_to,
+ (FT_Outline_LineTo_Func) gray_line_to,
+ (FT_Outline_ConicTo_Func)gray_conic_to,
+ (FT_Outline_CubicTo_Func)gray_cubic_to,
0,
0
};
@@ -1770,7 +1771,8 @@
if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax;
/* simple heuristic used to speed-up the bezier decomposition -- see */
- /* the code in gray_render_conic() and gray_render_cubic() for more details */
+ /* the code in gray_render_conic() and gray_render_cubic() for more */
+ /* details */
ras.conic_level = 32;
ras.cubic_level = 16;