Commit Graph

40 Commits

Author SHA1 Message Date
Werner Lemberg fc15ebe0a6 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table.
Fixes #1141.
2022-03-21 11:17:28 +01:00
Werner Lemberg 5b26e92a0f src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
A kerning table can be handled by binary search if it has equal entries.

Fixes #1132.
2022-02-19 07:20:24 +01:00
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
David Turner e13391333f Make macros for header file names optional.
We no longer have to take care of the 8.3 file name limit; this
allows us (a) to introduce longer, meaningful file names, and (b) to
avoid macro names in `#include' lines altogether since some
compilers (most notably Visual C++) doesn't support this properly.

*/*: Replace

   #include FOO_H

with

   #include <freetype/foo.h>

or something similar.  Also update the documentation.
2020-06-08 13:31:55 +02:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg a0dd16fb3d Don't use `trace_' prefix for FT_COMPONENT arguments.
* include/freetype/internal/ftdebug.h (FT_TRACE_COMP,
FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix.
(FT_TRACE): Use `FT_TRACE_COMP'.

*/* (FT_COMPONENT): Updated.
2018-08-15 18:13:17 +02:00
Werner Lemberg 9ac9060df0 [GSoC] src/*.*: Convert block comments to `light' style.
This monster commit was created by applying Nikhil's scripts
`docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 09:08:41 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 3e4b79970e * src/sfnt/ttkern.c (tt_face_load_kern): Reject format 2 tables.
Reported by Behdad.
2017-09-11 08:51:44 +02:00
Wojciech Mamrak 565f5a7d19 [sfnt] Minor improvement for handling kern tables.
* src/sfnt/ttkern.c (tt_face_load_kern): Don't check for
cross-stream kerning tables since we reject format 2 tables later
on anyways.
Modify code for limit test...
(tt_face_get_kerning): ... to avoid a limit test here.
2017-03-27 09:19:14 +02:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 01f0842eb0 [sfnt] Signedness fixes.
* src/sfnt/pngshim.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap.c,
src/sfnt/ttkern.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,
src/sfnt/ttsbit.c: Apply.
* src/sfnt/sfdriver.c: Apply.
(sfnt_get_ps_name): Simplify.
2015-02-22 12:03:28 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg f70d9342e6 [sfnt] Fix Savannah bug #43672.
* src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for
minimum table length test.
2014-11-24 09:31:32 +01:00
Werner Lemberg e8ed2d621e Another round of cppcheck nitpicks.
The call was (from the top-level of the FreeType tree):

  cppcheck --force \
           --enable=all \
           -I /usr/include \
           -I /usr/local/include \
           -I /usr/lib/gcc/i586-suse-linux/4.7/include \
           -I include \
           -I include/freetype \
           -I include/freetype/config \
           -I include/freetype/internal \
           -DFT2_BUILD_LIBRARY \
           . &> cppcheck.log

using cppcheck git commit f7e93f99.

Note that cppcheck still can't handle `#include FOO' (with `FOO' a
macro).

*/* Improve variable scopes.
*/* Remove redundant initializations which get overwritten.

* src/gxvalid/*: Comment out redundant code or guard it with
FT_DEBUG_LEVEL_TRACE.
2013-08-01 12:20:20 +02:00
Werner Lemberg 059bc335ce */*: Use `FT_THROW'.
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.
2013-03-14 10:27:35 +01:00
Werner Lemberg 0ae6cf214f Minor optimizations by avoiding divisions.
* src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning):
Replace divisions with multiplication in comparisons.
2010-06-30 10:26:48 +02:00
suzuki toshiya 2a2beb47c4 sfnt: Extend a few local variables to load 32-bit values. 2009-08-01 00:37:57 +09:00
suzuki toshiya cad4f91555 sfnt: Insert explicit cast for LP64 system. 2009-08-01 00:32:23 +09:00
Werner Lemberg 858abbedc0 For warning messages, replace FT_ERROR with FT_TRACE0.
FT_ERROR is now used only if a function produces a non-zero `error'
value.

Formatting, improving and harmonizing debug strings.
2009-06-26 06:15:41 +02:00
Werner Lemberg 86e041b5a8 Remove redundant header inclusions.
This covers many Ghostscript Coverity issues.

* src/*: Do it.
2009-03-21 08:51:44 +01:00
Werner Lemberg 42f5c714c0 Formatting. 2009-03-03 23:34:49 +00:00
David Turner ab7e52b1c7 Fix SFNT kerning table parser against malformed tables.
Closes Savannah BUG #25750

	* src/sfnt/ttkern.c (tt_face_get_kerning): fix a bug
	where a malformed table would be succesfully loaded but
	later crash the engine during parsing.
2009-03-03 22:37:13 +00:00
Werner Lemberg 607dec79bb * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
variable.
* src/autofit/afloader.c (af_loader_load_g): Ditto.

* src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
(open_face_from_buffer): Initialize `stream'.
(FT_Request_Metrics): Remove unused variable.
Remove redundant `break' statements.
(FT_Get_Track_Kerning): Remove unused variable.

* src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
afm_parse_kern_data): Remove redundant
`break' statements.
(afm_parser_parse): Ditto.
Don't use uninitialized variables.

* src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
Use `|' operator instead of `^' to set it.
Update all users.

* src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
* src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
comparison.
(TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
(TT_Load_Glyph): Remove unused variable.
2007-05-15 06:49:37 +00:00
Werner Lemberg 6e87ed9f04 Spelling fixes from Alexei. 2007-01-26 22:18:56 +00:00
Werner Lemberg 4ea0a7f0b6 formatting, minor doc fixes, copyright years 2007-01-05 09:03:31 +00:00
David Turner 8a6c44e673 Getting rid of the FT_OPTIMIZE_MEMORY macro, since the optimization
is no longer experimental
2007-01-04 17:03:11 +00:00
Werner Lemberg fa3651e7d8 formatting, copyright year 2006-03-28 05:06:50 +00:00
David Turner 42137bc614 * src/sfnt/ttkern.c (tt_face_get_kerning): fixed a serious bug
that caused some programs to go into an infinite loop when dealing
        with fonts that don't have a properly sorted kerning sub-table
2006-03-27 20:10:26 +00:00
Werner Lemberg f13516c832 Various fixes for C and C++ compiling.
* src/autofit/*: Add copyright messages.
  Formatting.

* src/autofit/afhints.c (af_glyph_hints_done): Don't use
`AF_Dimension' but `int' for loop counter.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use
`AF_Dimension' but `int' for loop counter.
Use proper enumeration value for `render_mode'.
(af_latin_metrics_scale_dim): Don't shadow variables.
(af_latin_hints_compute_segments): Use proper cast for `major_dir'
and `segment_dir'.
(af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to
`af_latin_compute_stem_width'.
(af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop
counter.

* src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use
proper cast for memory allocation.

* src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for
initialization of `sfnt'.

* src/sfnt/sfdriver.c: Include `ttkern.h'.

* src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables.

* src/truetype/ttgload.c: Include `ttpload.h'.

* src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]:
Remove redundant variable.
2005-03-03 17:09:08 +00:00
Werner Lemberg b19b0810cd * src/autofit/afdummy.c, src/autofit/afdummy.h
(af_dummy_script_class): Fix type.

* src/autofit/aflatin.c, src/autofit/aflatin.h
(af_latin_script_class): Fix type.

* src/autofit/rules.mk (AUTOF_DRV_SRC): Fix typo.

Formatting.
2005-03-02 11:24:23 +00:00
David Turner 1e03fff62b removing compiler warnings 2005-03-01 22:57:25 +00:00
Werner Lemberg e793092d0a Formatting.
* src/truetype/ttpload.c (tt_face_load_loca): Fix typo.

* src/sfnt/ttkern.c: Include `ttkern.h'.
(FT_COMPONENT): Updated.

* include/freetype/internal/fttrace.h: Add entry for `ttkern'.

* src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
Decorate constants with `U' and `L' where necessary.

* src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
2005-03-01 02:13:50 +00:00
David Turner fa0eb0c95f * src/sfnt/ttkern.c (tt_face_load_kern): fixing a small bug which returned
invalid (random) values for the horizontal kerning
2005-02-27 21:35:50 +00:00
David Turner e5680279b2 * many, many files: several memory optimizations were implemented to
drastically reduce the heap usage of FreeType, especially in the case
  of memory-mapped files. The idea is to avoid loading and decoding tables
  in the heap, and instead access the raw data whenever possible (i.e.
  when it doesn't compromise performance).

  This had several impacts: first, opening vera.ttf uses a ridiculous amount
  of memory (when the FT_Library footprint is accounted for), until you start
  loading glyphs. Even then, you'll save at least 20 Kb compared to the non
  optimized case. performance of various operations, including open/close
  has also been dramatically improved.

  More optimisations to come. The auto-hinter eats memory like crazy? This
  must be stopped...
2005-02-26 00:12:04 +00:00