Commit Graph

18 Commits

Author SHA1 Message Date
Alexei Podtelezhnikov 81b81feb62 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing. 2022-01-14 18:22:23 +00: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 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 e411d38e71 * src/base/fthash.c: Include FT_INTERNAL_MEMORY_H. 2016-02-14 20:48:59 +01:00
Werner Lemberg fc11af1ea2 Various minor clang fixes.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
`ch'.

* src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast.

* src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast.

* src/base/fthash.c (hash_num_lookup): Add cast.

* src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast.

* src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out
redundant code.

* src/type1/t1driver.c (t1_get_ps_font_value) <PS_DICT_SUBR>: Add
cast.

* src/type1/t1load.c (parse_subrs): Fix type of `count'.
2016-01-19 19:15:54 +01:00
Werner Lemberg 7ce6c43c3e [base] Make hash interface symmetric.
Use `num' and `str' infixes everywhere.

* src/base/fthash.c (ft_hash_init): Renamed to...
(hash_init): ... This.
(ft_hash_str_init, ft_hash_num_init): New functions.
(ft_hash_free): Renamed to...
(ft_hash_str_free): ... This.

* include/freetype/internal/fthash.h: Updated.

* src/bdf/bdflib.c, src/type1/t1load.c, src/type1/t1objs.c: Updated.
2015-12-22 05:39:58 +01:00
Werner Lemberg 1caf629eef [base] Thinko: Remove free function pointer.
We don't copy keys or values while hashing.

* include/freetype/internal/fthash.h (FT_Hash_FreeFunc): Removed.
(FT_HashRec): Remove `free' field.

* src/base/fthash.c (hash_str_free): Removed.
(ft_hash_init, ft_hash_free): Updated.
2015-12-20 19:00:35 +01:00
Werner Lemberg 76e79ec9a5 [base, bdf] Don't expose `FT_Hashnode' in hash functions.
* src/base/fthash.c (hash_lookup, ft_hash_str_lookup,
ft_hash_num_lookup): Return pointer to `size_t' instead of
`FT_Hashnode'.

* include/freetype/internal/fthash.h: Updated.

* src/bdf/bdflib.c (bdf_get_property, _bdf_add_property,
bdf_get_font_property): Updated.
2015-12-20 09:03:15 +01:00
Werner Lemberg ad306eaa5e [base, bdf] Add number hashing.
* src/base/fthash.c (hash_num_lookup, hash_num_compare): New
functions.
(ft_hash_init): Add argument to select between number and string
hashing.
(ft_hash_num_insert, ft_hash_num_lookup): New functions.

* include/freetype/internal/fthash.h: Updated.

* src/bdf/bdflib.c (_bdf_parse_start): Updated.
2015-12-20 08:33:21 +01:00
Werner Lemberg 1b7549ccc7 [base] Introduce hash lookup, compare, and free function pointers.
* include/freetype/internal/fthash.c (FT_Hash_LookupFunc,
FT_Hash_CompareFunc, FT_Hash_FreeFunc): New typedefs.
(FT_HashRec): Add `lookup', `compare', and `free' fields.

* src/base/fthash.c (hash_str_lookup, hash_str_compare,
hash_str_free): New functions.
(ft_hash_init): Set function pointers.
(hash_bucket, ft_hash_free): Use them.
2015-12-20 08:00:33 +01:00
Werner Lemberg 609546c4b8 [base, bdf] Use a union as a hash key.
We want to support both an integer and a string key later on.

* include/freetype/internal/fthash.h (FT_Hashkey): New union.
(FT_HashnodeRec): Updated.
(ft_hash_insert, ft_hash_lookup): Renamed to ...
(ft_hash_str_insert, ft_hash_str_lookup): ... this.

* src/base/fthash.c (hash_bucket): Updated.
(ft_hash_insert, ft_hash_lookup): Renamed to ...
(hash_insert, hash_lookup): ... this.
(ft_hash_str_insert, ft_hash_str_lookup): New wrapper functions.

* src/bdf/bdflib.c: Updated.
2015-12-20 07:17:29 +01:00
Werner Lemberg c98a40f99d [bdf, base] Lift hash functions from bdf driver to base module.
* src/base/fthash.c, include/freetype/internal/fthash.h: New files,
containing (massaged) code from `bdflib.c' and `bdf.h'.

* include/freetype/internal/internal.h (FT_INTERNAL_HASH_H): New
macro.

* src/base/ftbase.c: Include `fthash.c'.

* src/base/Jamfile (_sources): Add `fthash'.

* src/base/rules.mk (BASE_SRC): Add `fthash.c'.

* docs/LICENSE.TXT: Updated.
2015-12-19 16:59:40 +01:00
David Turner c12ec72c2f removing obsolete files 2004-06-10 21:30:08 +00:00
David Turner 7acd73fd6a * src/sfnt/ttload.c, src/sfnt/ttload.h, src/sfnt/ttdriver.c: changing
the SFNT loader to check for SFNT-based font files differently. We now
    ignore the range "helper" fields and check the "head" table's magic
    number instead.
2002-07-11 23:41:14 +00:00
David Turner 660138753b updatinf the object sub-system and dynamic hash table implementations 2002-07-11 16:27:16 +00:00
David Turner 0d73b0c49a * include/freetype/internal/ftobject.h: updating the object sub-system
definitions (still experimental)

    * src/base/fthash.c (ft_hash_remove): fixing a small reallocation bug

    * include/freetype/fttrigon.h, src/base/fttrigon.c: adding
    FT_Vector_From_Polar and FT_Angle_Diff to the trigonometric functions

    * include/freetype/ftstroker.h, src/base/ftstroker.c: adding path stroker
    component (work in progress)
2002-06-26 23:45:21 +00:00
David Turner 1093730447 * include/freetype/internal/fthash.h, src/base/fthash.c:
adding a generic implementation of dynamic hash tables using
          linear algorithm (to get rid of 'stalls' during resizes). This
          will be used in the future in at least three parts of the
          library: the cache sub-system, the object sub-system and
          the memory debugger.

        * include/freetype/internal/ftcore.h: added this header file to
          group all new definitions related to exception handling and
          memory management. It's very likely that this file will disappear
          or be renamed in the future..

        * include/freetype/internal/ftobject.h, include/freetype/ftsysmem.h:
          adding comments to better explain the object sub-system as well
          as the new memory manager interface.
2002-05-01 08:46:56 +00:00