Commit Graph

36 Commits

Author SHA1 Message Date
Alexei Podtelezhnikov 22befeef82 Signedness revisions.
This eliminates explicit casting by switching to unsigned fields.
The revisions mostly impact the handling of CID fonts.

* include/freetype/fttypes.h (FT_Data): Change to unsigned `length`.
* include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`.
(CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`.
* include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for
`byte_len`.

* src/cid/cidgload.c (cid_load_glyph): Updated.
* src/cid/cidload.h (cid_get_offset): Update argument.
* src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open):
Updated.
* src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data):
Updated.
* src/psaux/psft.c (cf2_getT1SeacComponent): Updated.
* src/truetype/ttgload.c (TT_Process_Composite_Glyph,
load_truetype_glyph): Updated.
2021-10-07 22:41:56 -04: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 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 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 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 2bf03eb729 [cid] Fix signedness issues and emit some better error codes.
* src/cid/cidgload.c, src/cid/cidload.h, src/cid/cidobjs.c,
src/cid/cidparse.h: Apply.
* src/cid/cidload.c: Apply.
(parse_fd_array): Reject negative values for number of dictionaries.
* src/cid/cidparse.c: Apply.
(cid_parser_new): Reject negative values for hex data length.
2015-02-20 20:14:11 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg ef512e3ec6 Add support for the hexadicimal representation of binary data
started with `StartData' in CID-keyed Type 1 fonts.

* include/freetype/internal/t1types.h (CID_FaceRec): Add new
members `binary_data' and `cid_stream'.

* src/cid/cidload.c (cid_read_subrs): Use `face->cid_stream'.
(cid_hex_to_binary): New auxiliary function.
(cid_face_open): Add new argument `face_index' to return quickly
if less than zero.  Updated all callers.
Call `cid_hex_to_binary', then open and assign memory stream to
`face->cid_stream' if `parser->binary_length' is non-zero.
* src/cid/cidload.h: Updated.

* src/cid/cidobjs.c (cid_face_done): Free `binary_data' and
`cid_stream'.

* src/cid/cidparse.c (cid_parser_new): Check arguments to
`StartData' and set parser->binary_length accordingly.
* src/cid/cidparse.h (CID_Parser): New member `binary_length'.

* src/cid/cidgload.c (cid_load_glyph): Use `face->cid_stream'.

* docs/CHANGES: Updated.


include/freetype/config/ftstdlib.h (ft_atoi): Replaced with...
(ft_atol): This.
* src/base/ftdbgmem.c: s/atol/ft_atol/.
* src/type42/t42drivr.c: s/ft_atoi/ft_atol/.
2004-01-23 19:52:40 +00:00
Werner Lemberg 75aae7db17 * src/cid/cidload.c (cid_decrypt): Removed.
(cid_read_subrs): Use t1_decrypt from psaux module.
* src/cid/cidload.h: Updated.
* src/cid/cidgload.c (cid_load_glyph): Use t1_decrypt from psaux
module.
2003-06-12 07:11:05 +00:00
David Turner b08fe2dc7a * massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
    transformations of the sources:

      - trying to convert all enums and constants to CAPITALIZED_STYLE, with
        #define definitions like

          #define  my_old_constants   MY_NEW_CONSTANT

      - big, big update of the documentation comments

    * include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
    include/freetype/ftimage.h: adding support for LCD-optimized rendering
    though the new constants/enums:

      FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
      FT_PIXEL_MODE_LCD,  FT_PIXEL_MODE_LCD_V

    this is still work in progress, don't expect everything to work correctly
    though most of the features have been implemented.

    * adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
    targets:

      FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
      FT_LOAD_TARGET_MONO   :: monochrome bitmaps
      FT_LOAD_TARGET_LCD    :: horizontal RGB/BGR decimated hinting & rendering
      FT_LOAD_TARGET_LCD_V  :: vertical RGB/BGR decimated hinting & rendering

    note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
    behaviour of the font engine is _unchanged_.
2002-08-27 20:20:29 +00:00
Werner Lemberg 44be4d56fc formatting, copyright 2002-03-30 17:08:04 +00:00
David Turner bc82f1bbef * include/freetype/ftconfig.h: changed FT_LOCAL xxxx to FT_LOCAL( xxxx )
everywhere in the source. Sames goes for FT_LOCAL_DEF xxxx translated
        into FT_LOCAL_DEF( xxxxx )
2002-03-01 02:26:22 +00:00
Werner Lemberg 415235df1b finishing function header formatting
updating copyrights
2001-06-28 17:49:10 +00:00
Werner Lemberg 93616ecb66 next round in function header formatting 2001-06-27 19:46:12 +00:00
Werner Lemberg 99b744164d * src/cid/cidload.c, src/cid/cidload.h (cid_decrypt): Use FT_Offset
instead of FT_Int as type for `length' parameter.
* include/freetype/internal/psaux.h (PSAux_Interface): Updated.


* src/psaux/psobjs.c, src/psaux/psobjs.h (T1_Decrypt): Use FT_Offset
instead of FT_Int as type for `length' parameter.
2001-06-27 17:06:28 +00:00
David Turner 8d3a401fa8 * builds/*/*-def.mk: changed the objects directory from "obj" to "objs"
* include/freetype/config/ftheader.h: removed obsolete macros like
	FT_SOURCE_FILE, etc.. and added cache-specific macro definitions that
	were previously defined in <freetype/ftcache.h>. Added comments to be
	included in a new API Reference section.

	* src/*/*: removed the use of FT_SOURCE_FILE, etc.. now, each component
	needs to added its own directory to the include path at compile time.
	Modified all "rules.mk" and "descrip.mms" accordingly..
2001-03-20 11:14:24 +00:00
David Turner 170c0d4c0d * include/freetype/config/ft2build.h,
include/freetype/internal/internal.h: fixed header inclusion macros
	to use direct definitions. This is the only way to do these things
	in a portable way :-( The rest of the code should follow shortly
	though everything compiles now..

	* builds/compiler/intelc.mk, builds/compiler/watcom.mk,
	builds/win32/detect.mk: added support for the Intel C/C++ compiler,
	as well as _preliminary_ (read: doesn't work !!) support for Watcom.
	Also added a new setup target. Type "make setup list" for a list
	of supported command-line compilers on Win32..
2000-12-13 19:55:11 +00:00
Werner Lemberg d5c1b27d58 * include/freetype/config/ft2build.h (FT2_ROOT, FT2_CONFIG_ROOT):
Removed.  ANSI C doesn't (explicitly) allow macro expansion in
arguments using `##'.
(FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE): Use directory
names directly.  Make them configurable.  Use `##' to strip leading
and trailing spaces from arguments.

* builds/unix/ft2unix.h: Adapted.

* src/base/ftsystem.c (ft_alloc, ft_realloc, ft_free, ft_io_stream,
ft_close_stream): Use FT_CALLBACK_DEF.

* builds/unix/ftsystem.c: Use new header scheme.
(FT_Done_Memory): Use free() from FT_Memory structure.

* src/base/ftinit.c, src/base/ftmac.c: Header scheme fixes.

* include/freetype/config/ft2build.h (FT2_CONFIG_ROOT,
FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE,
FT_SOURCE_FILE): Use `##' operator to be really ANSI C compliant.
2000-12-12 22:28:12 +00:00
Werner Lemberg 90d9964ec9 * */*.h: Changed body inclusion macro names to start and end with
`__' (those which haven't converted yet).  Fixed minor conversion
issues.

* src/winfonts/winfnt.c: Updated to new header inclusion scheme.

* */*.[ch]: Changed source files to adhere to the new
* src/cff/cff.c, src/cff/rules.mk: Updated.

* */*.[ch]: Now using <ft2build.h> as the default build and setup
2000-12-09 00:45:38 +00:00
Werner Lemberg cc069beb2d cleanups 2000-12-08 16:17:16 +00:00
David Turner 19ed8afe60 - updated all source files to adhere to the new inclusion scheme
- the CFF loader now loads the encodings and charset tables
  though doesn't use them for now
2000-12-08 02:42:29 +00:00
David Turner 76a5f62323 major reformatting of the sources:
FT_EXPORT_DEF    => FT_EXPORT
  FT_EXPORT_FUNC => FT_EXPORT_DEF
  BASE_DEF               => FT_BASE
  BASE_FUNC            => FT_BASE_DEF
  LOCAL_DEF             => FT_LOCAL
  LOCAL_FUNC          => FT_LOCAL_DEF
  LOCAL_FUNC_X     => FT_CALLBACK_DEF
  LOCAL_DEF_X       => FT_CALLBACK_TABLE
  FT_CPLUSPLUS     => FT_CALLBACK_TABLE_DEF
2000-11-04 01:55:49 +00:00
David Turner 34f1c2f5f4 finally, the CID and Type1z driver are finished !!
Werner, please have a look at the code and start
re-formatting it :-)
2000-08-23 22:47:44 +00:00
Werner Lemberg 7fa51b5535 Formatting.
Adding some trivial error checking.

Adding/Fixing tracing levels.
2000-07-08 19:51:42 +00:00
David Turner a90663f591 vast clean-up of the sources in order to allow flat
directory compilation (by defining the FT_FLAT_COMPILE
macro at compile time..)

moved "freetype2/BUILD" to "freetype2/docs/BUILD"
2000-07-08 00:41:13 +00:00
David Turner f9b8dec437 major reformatting of the modules source code in order to get
rid of most of the basic types redefinitions (i.e. FT_Int instead
of "FT_Int", etc..)

The format-specific prefixs like "TT_", "T1_", "T2_" & 'CID_"
are now only used in relevant structures..

fixed Werner's fix to t2gload.c :-)
other small bug fixes
2000-06-16 19:34:52 +00:00
Werner Lemberg e3c11d7f00 A new round of formatting, adding/fixing documentation etc. 2000-06-16 06:49:56 +00:00
Werner Lemberg e35cac66c6 A complete revision of FreeType 2's GNU makefiles (of the library):
Tons of unnecessary stuff have been removed; only the essential rules
  have been retained.

  The source files now depend on all header files in include/freetype,
  include/freetype/config, and include/freetype/internal.  This is not
  optimal, I know, and I'll try to improve this, but it is better than
  before (namely no dependencies on `internal').

  FTDEBUG_SRC has been added (similar to FTSYS_SRC) -- I don't know
  exactly whether this is really useful, but it doesn't harm.

  There is now more documentation in the makefiles itself.

io-frames.html: Use of <th>, <code>, and <var> for better tagging.

Reactivating of FT_DEBUG_LEVEL_xxx macros.

Added a lot of #include directives to make `multi' builds possible -- note
that currently the modules cid, t1, and t1z have clashing structures and
functions which means that you can only use one of these three modules for a
multi build.

Added some missing function declarations to (local) header files.

Renamed some T1_Open_Face() to CID_Open_Face() in the cid module -- a lot
of other functions should be renamed also...

Replaced many FT_xxx stuff with T1_xxx in t1z driver -- this isn't finished
yet...

Fixed FT_Free() to allow a NULL pointer without an assertion (this has
always been a valid assumption in FreeType, at least in FT 1.x).

A lot of other, minor fixes (mostly documentation).
2000-06-11 03:46:57 +00:00
David Turner 04aa800ce9 added a CID-keyed font driver in "src/cid"
fixed two bugs in the smooth renderer
2000-06-01 03:27:48 +00:00