Commit Graph

21 Commits

Author SHA1 Message Date
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
Alexei Podtelezhnikov afaf3f1de9 [bdf,pcf] Use `const' for string literals.
* src/bdf/bdf.h (bdf_property_t): Updated `name'.
* src/bdf/bdflib.c (_bdf_list_split,bdf_create_property,
_bdf_add_property,_bdf_ato*): Updated.
* src/bdf/bdfdrivr.c (bdf_interpret_style): Updated.
* src/pcf/pcfread.c (pcf_intrpret_style): Ditto.
2019-06-10 22:27:39 -04:00
Alexei Podtelezhnikov efa2a3babf Revert BDF copyright years. 2018-08-15 23:49:07 -04:00
Alexei Podtelezhnikov af9662e60b Ouch. BDF copyright year. 2018-08-15 22:58:11 -04:00
Alexei Podtelezhnikov e001a17d73 [bdf] Remove unused fields.
* src/bdf/bdf.h (bdf_font_t): Remove `nmod', `umod', and `modified',
which were set but never used.
* src/bdf/bdflib.c (_bdf_parse_{glyphs,properties}, bdf_load_font):
Updated accordingly.
2018-08-14 07:10:57 -04:00
Alexei Podtelezhnikov ac2ea865f3 [bdf] Remove unused overflow storage.
* src/bdf/bdf.h (bdf_glyphlist_t): Remove this type.
(bdf_font_t): Remove `overflow' field.
* src/bdf/bdflib.c (bdf_free_font): Remove `overflow' freeing.
2018-08-13 21:33:24 -04:00
Alexei Podtelezhnikov f5fe6e2f17 [bdf] Use unsigned types.
* src/bdf/bdf.h (bdf_glyph_t): Unsign `encoding'.
(bdf_font_t): Unsign `default_char'.
* src/bdf/bdfdrivr.h (BDF_encoding_el): Unsign `enc'.

* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_glyphs,
_bdf_parse_start): Updated accordingly.
* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Ditto.
2018-08-13 09:01:53 -04: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 37412ff9f4 Don't use macro names that contain `__' [1/2].
Such macro names are reserved for both C and C++.

*/*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-12 21:37:13 +01:00
Werner Lemberg 313435657d [bdf] Use new hash functions.
* src/bdf/bdf.h: Include FT_INTERNAL_HASH_H.
(hashnode, hashtable): Removed.
(bdf_font_t): Use `FT_HashRec' type for `proptbl'.

* src/bdf/bdflib.c: Remove all hash functions.
Update code for new hash structure and function names.
2015-12-19 17:02:13 +01:00
Werner Lemberg 6343ba22a3 Fix some bugs found by clang's `-fsanitize=undefined' (#45661).
* src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Only accept
positive values from header.
Check overflow.

* src/base/ftoutln.c (SCALED): Correctly handle left-shift of
negative values.

* src/bdf/bdf.h (_bdf_glyph_modified, _bdf_set_glyph_modified,
_bdf_clear_glyph_modified): Use unsigned long constant.

* src/bdf/bdfdrivr.c (BDF_Size_Select, BDF_Glyph_Load): Don't
left-shift values that can be negative.

* src/pcf/pcfdrivr.c (PCF_Size_Select, PCF_Glyph_Load): Don't
left-shift values that can be negative.

* src/raster/ftraster.c (SCALED): Correctly handle left-shift of
negative values.

* src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Don't left-shift
values that can be negative.

* src/truetype/ttgload.c (TT_Load_Composite_Glyph,
compute_glyph_metrics, load_sbit_image): Don't left-shift values
that can be negative.
2015-08-01 07:53:48 +02:00
Werner Lemberg 3c374c8cda [bdf] Signedness fixes.
* src/bdf/bdf.h, src/bdf/bdfdrivr.c, src/bdf/bdfdrivr.h,
src/bdf/bdflib.c: Apply.
2015-02-22 09:16:53 +01:00
Werner Lemberg ed54e43aed [bdf] Fix Savannah bug #34896.
ENCODING now covers the whole Unicode range.

Note, however, that this change is quite expensive since it
increases the size of three arrays by almost 400kByte in total.  The
right fix is to replace the logic with something smarter.
Additionally, there exist very old BDFs for three-byte CCCII
encoding which exceeds the range of Unicode (another reason to have
a smarter logic).

* src/bdf/bdf.h (bdf_font_t): Increase size of `nmod' and `umod'
arrays.
* src/bdf/bdflib.c (bdf_parse_t): Increase size of `have' array.
2011-11-27 16:39:53 +01:00
suzuki toshiya 704f4d75cd [BDF] Modify hash API to take size_t value instead of void *. 2009-09-13 00:50:14 +09:00
suzuki toshiya be41d3e718 bdf: Improve bdf_property_t.value names for LP64 platforms. 2009-08-01 00:30:22 +09:00
Werner Lemberg 9b774e2822 Remove trailing whitespace. From Alexei. 2007-01-16 06:11:27 +00:00
Werner Lemberg 8ef4183690 * src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start),
src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs.
Set `default_glyph'.
(BDF_Glyph_Load): Use `default_glyph' for undefined glyph.

* docs/CHANGES: Updated.
2004-06-22 12:28:17 +00:00
Werner Lemberg 428c2e4f62 * src/bdf/bdflib.c (hash_bucket, hash_lookup): Use `const' for first
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.
2003-04-25 05:35:04 +00:00
Werner Lemberg 7cf4d377f4 * src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/.
(parse_font_matrix): Remove unnecessary code.
(parse_sfnts): Initialize some variables.
(t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use
ft_module_driver_has_hinter conditionally.
Moved some type 42 specific structure definitions to...
* include/freetype/internal/t42types.h: New file.
* include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H):
New macro.

* include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field
`num_grays' for specifying the number of used gray levels.
* src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it.

Adding a driver for BDF fonts written by Francesco Zappa Nardelli
<Francesco.Zappa.Nardelli@ens.fr>.  Heavily modified by me to
better adapt it to FreeType, removing unneeded stuff.  Additionally,
it now supports Mark Leisher's BDF extension for anti-aliased
bitmap glyphs with 2 and 4 bpp.

* src/bdf/*: New driver.
* include/freetype/internal/bdftypes.h: New file.
* include/freetype/internal/fttrace.h: Added BDF driver components.
* include/freetype/fterrdef.h: Added error codes for BDF driver.
* include/freetype/config/ftmodule.h, src/Jamfile: Updated.
* include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H):
New macro.

* include/freetype/config/ftstdlib.h (ft_sprintf): New alias for
sprintf.

* include/freetype/internal/fttrace.h: Added Type 42 driver
component.
* src/type42/t42drivr.c: Use it.

* include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H):
New macro.
2002-05-21 14:13:01 +00:00
David Turner 993a8d0445 adding BDF driver 2002-05-18 12:03:43 +00:00