* src/bzip2/ftbzip2.c (ft_bzip2_file_fill_input), src/gzip/ftgzip.c
(ft_gzip_file_fill_input): In case of an error, adjust the limit to
avoid copying uninitialized memory.
* src/bzip2/ftbzip2.c (ft_bzip2_file_fill_output), src/gzip/ftgzip.c
(ft_gzip_file_fill_output): In case of an error, adjust the limit to
avoid copying uninitialized memory.
Suggested by Hin-Tak Leung.
* src/bzip2/ftbzip2.c (ft_bzip2_stream_io), src/gzip/ftgzip.c
(ft_gzip_stream_io), src/lzw/ftlzw.c (ft_lzw_stream_io): Do it.
* src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak.
(ft_gzip_get_uncompressed_file): Correct byte order while reading
unsigned long value. Without this change, the whole optimization of
accessing small files in `FT_Stream_OpenGzip' is never executed! As
a consequence, access to PCF files in general (which are normally
small files) should be much improved now as originally intended.
`API functions' are functions tagged with `FT_EXPORT_DEF'.
Besides trivial fixes, the following changes are included, too.
* src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set
error code if no service is available.
* src/base/ftinit.c (FT_Done_FreeType): Change return value for
invalid `library' parameter to `Invalid_Library_Handle'.
* src/base/ftobjs.c (FT_New_Size): Change return value for invalid
`asize' parameter to `Invalid_Argument'.
* src/base/ftoutln.c (FT_Outline_Copy): Change return value for
invalid `source' and `target' parameters to `Invalid_Outline'.
(FT_Outline_Done_Internal): Change return value for invalid
`outline' parameter to `Invalid_Outline'.
This is modeled after zlib's `uncompress' function. We need this
for WOFF support.
* include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress):
New function.
* src/gzip/rules.mk: Rewrite to better reflect dependencies.
* include/freetype/internal/ftdebug.h: Remove pragmas.
* include/freetype/internal/ftserv.h: Use push and pop for pragmas.
* include/freetype/internal/ftvalid.h: Handle warning C4324.
* src/base/ftobjs.c: Use push and pop for pragmas.
* src/gzip/ftgzip.c: Handle warning C4244.
This is essentially a mechanical conversion, adding inclusion of
`FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
stand-alone compiling modes of the rasterizer modules.
To convert the remaining occurrences of FT_Err_XXX and friends it is
necessary to rewrite the code. Note, however, that it doesn't harm
if some cases are not handled since FT_THROW is a no-op.
Previously, signed integers were converted to unsigned integers, but
this can fail because of sign extension. For example, 0xa344a1eb
becomes 0xffffffffa344a1eb.
We now do the reverse which is always correct because the integer
size is the same during the cast from unsigned to signed.
* include/freetype/internal/ftstream.h, src/base/ftstream.c
(FT_Stream_Get*): Replace with...
(FT_Stream_GetU*): Functions which read unsigned integers.
Update all macros accordingly.
* src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
src/autofit/aftypes.h, src/base/ftcalc.c, src/base/ftoutln.c,
src/gzip/ftgzip.c, src/psaux/psconv.c, src/truetype/ttgload.c,
src/type1/t1gload.c:
this is a major patch used to drastically improve the performance
of loading glyphs. This both speeds up loading the glypn vector
themselves and the auto-fitter.
note that we've started using inline assembler with GCC to
implement FT_MulFix, given that this function is so damn
important for the engine's performance.
the resulting speed-up is about 25%.
the warp hinter isn't active (it shouldn't, still experimental)
* Jamfile, include/freetype/config/ftmodule.h: removed "gxvalid"
and "otvalid" from the list of modules that are linked statically
to a given FreeType library. Functionality has been moved to the
"ftvalid" CVS module.
note also that current Make-based build system still compiles the
modules though...
* include/freetype/config/ftoption.h: added FT_STRICT_ALIASING,
which controls the definitions of the memory management functions
to avoid warnings with recent versions of GCC. this macro is
only here to be disabled, in case we detect problems with the
new scheme.
NOTE: disable macro to use the memory debugger. this will be fixed
later !!
used to reduce the amount of heap size required to only test wether
we're dealing with a BDF font (the old code allocated 64 Kb right
before any test).
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): modified the function to check
the LZW header before doing anything else. This helps avoid un-necessary
heap allocations (400 Kb of heap memory for the LZW decoder ! Oh my !)
* src/gzip/ftgzip.c (FT_Stream_OpenGZip): ditto for the .gz decoder,
though the code savings is smaller.
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.
* src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
(FT_Set_Pixel_Size): Assign value to `metrics' after validation of
arguments.
Synchronize computation of height and width for bitmap strikes. The
`width' field in the FT_Bitmap_Size structure is now only useful to
enumerate different strikes. The `max_advance' field of the
FT_Size_Metrics structure should be used to get the (maximum) width
of a strike.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.
* src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.
* src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
argument to function.
* src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
`uniXXXX' and `uXXXX[X[X]]'.
* src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
* src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
s/FT_Err_/FTC_Err_/.
* src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
* src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
* src/psaux/t1cmap.c: Include psauxerr.h.
s/FT_Err_/PSaux_Err_/.
* src/pshinter/pshnterr.h: New file.
* src/pshinter/rules.mk: Updated.
* src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
s/FT_Err_/PSH_Err_/.
* src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
s/FT_Err_/PFR_Err_/.
* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
* src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
* src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
FT_ERR_PREFIX and FT_ERR_BASE.
s/FT_Err_/Gzip_Err_/.
correctly.
* src/pshinter/pshglob.c (psh_globals_new): Change calculation of
dim->stdw.count to avoid compiler problem.
* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Move the block
variables to the beginning of the function to avoid compiler
problems.
Add casts necessary for 16bit compilers.
* src/pfr/rules.mk (PFR_DRV_SRC): Add pfrsbit.c.
(PFR_DRV_H): Add pfrtypes.h.
* include/freetype/config/ftconfig.h: s/__MWKS__/__MWERKS__/.
* src/pfr/pfrsbit.c (pfr_bitwriter_init): Change type of third
argument to FT_Bool.
(pfr_lookup_bitmap_data): Change type of third and fourth argument
to FT_UInt. Updated caller.
(pfr_load_bitmap_bits): Change type of fourth argument to FT_Bool.
make it compile.
* include/freetype/internal/psaux.h, src/truetype/ttgload.h:
s/index/idx/ to fix compiler warnings.
* src/sfnt/ttcmap0.c (tt_face_build_cmaps): Use more `volatile' to
fix compiler warning.
* src/gzip/ftgzip.c (BUILDFIXED): Removed.
* src/gzip/inftrees.c (inflate_trees_fixed) [!BUILDFIXED]: Use
FT_UNUSED to remove compiler warning.
* src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
to prevent infinite loop.
* docs/VERSION.DLL: Provide better autoconf snippet to check
FreeType version.
* src/base/ftobjs.c (open_face): Free `internal' not
`face->internal' in case of error to avoid possible segfault.
* src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
actually have an outline.
argument.
(bdf_get_font_property): Use `const' for third argument.
Updated all callers.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Set pixel width and height
similar to the PCF driver.
* src/bdf/bdf.h (_hashnode): Use `const' for `key'.
Updated.
* src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
is declared twice. It is perhaps better to modify the zlip source
files directly instead of this hack.
(zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
to make build with g++ successful.
when trying to read certain compressed gzip files. The following test
could be used to reveal the bug:
touch 0123456789 ; gzip 0123456789 ; ftdump 0123456789.gz
* src/pfr/pfrobjs.c, src/pfr/pfrload.c, src/pfr/pfrtypes.h: several
fixes to the PFR font driver:
- the list of available embedded bitmaps was not correctly set
in the root FT_FaceRec structure describing the face
- the glyph loader always tried to load the outlines when
FT_LOAD_SBITS_ONLY was specified
- the table loaded now scans for *undocumented* elements of a
physical font's auxiliary data record, this is necessary to
retrieve the "real" family and style names.
NOTE THAT THIS CHANGES THE FAMILY NAME OF MANY PFR FONTS !!
* docs/VERSION.DLL: updating document to better explain the differences between
the three version numbers being used on Unix, as well as provide the AutoConf
fragment provided by Lars Clausen
* src/smooth/ftgrays.c (gray_render_conic): fixed small bug that
prevented bezier arcs with negative vertical coordinates to be rendered
appropriately
2002-11-27 Vincent Caron <v.caron@zerodeux.net>
* builds/unix/unix-def.in, builds/unix/freetype-config.in,
builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c:
adding support for system zlib installations when available on the
target platform (Unix only)
* include/freetype/config/ftoption.h, src/gzip/ftgzip.c: added
support for the FT_CONFIG_OPTION_SYSTEM_ZLIB option, used to specify
the use of system-wide zlib.
Note that this macro, as well as FT_CONFIG_OPTION_BYTECODE_INTERPRETER,
is not #undef-ed anymore. This allows the build system to define them
depending on the configuration (typically by adding -D flags at
compile time).
* src/sfnt/ttcmap0.c (tt_face_build_cmaps): removed compiler warnings
in optimized mode relative to the "volatile" local variables. This was
not a compiler bug after all, but the fact that a pointer to a volatile
variable is not the same than a volatile pointer to a variable :-)
the fix was to change "volatile FT_Byte* p"
into "FT_Byte* volatile p"
* src/pfr/pfrload.c, src/pfr/pfrdrivr.c, src/gzip/inftrees.c: removed
compiler warnings in optimized modes
* src/gzip/*.[hc]: modified our ZLib copy in order to prevent exporting
any zlib function names outside of the component. This prevents linking
problems on some platforms, when applications want to link FreeType
_and_ ZLib together.
2002-11-05 Juliusz <jch@pps.jussieu.fr>
* src/psaux/psobjs.c (ps_table_add): modified increment loop in
order to implement exponential behaviour