Commit Graph

31 Commits

Author SHA1 Message Date
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg d31bafcb9c Fix clang warnings.
* src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block.
* src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto.

* src/smooth/ftgrays.c (gray_convert_glyph): Add cast.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast.
* src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter.
(parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts.
2021-11-14 11:02:54 +01:00
Werner Lemberg b86f96bce6 * src/gxvalid.*, src/otvalid.*: Fix `-Wformat` warnings. 2021-11-08 11:44:02 +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 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 3295039107 Whitespace. 2016-02-15 12:54:40 +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 17b6291d26 [gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:56:11 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg f796cf6c6b Normalize copyright notice format. 2015-01-17 20:11:10 +01:00
suzuki toshiya 9bd1e55850 [gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.

* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-10 00:59:09 +09:00
suzuki toshiya 2b59282b2d [ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros.
Original patch is designed by Werner Lemberg.  Extra part
for otvalid and gxvalid are added by suzuki toshiya, see
discussion:
http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html
http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html

* include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_().
* src/gxvalid/gxvcommn.h: Ditto.
* src/otvalid/otvcommn.h: Ditto.
2014-12-10 00:27:41 +09:00
Werner Lemberg 0098d5502d Uppercase all hex digits for orthogonality. 2014-12-07 11:03:57 +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
Alexei Podtelezhnikov b25265c5e4 Avoid modulo operators against a power-of-two denominator.
* src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c
(ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings)
<cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>,
src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE),
src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with
`&' operator.
2012-02-29 13:45:24 +01:00
suzuki toshiya 75b91a49aa [gxvalid] Cleanup.
Some invalid, overrunning, unrecommended non-zero values
are cared in paranoid validation mode only.  There are
many lines looking like:

  if ( valid->root->level >= FT_VALIDATE_PARANOID )
    FT_INVALID_xxx;

To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is
introduced for more paranoid validation in future.

* src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION):
New macro to assure valid->root->level is more or
equal to FT_VALIDATE_PARANOID.  (GXV_SET_ERR_IF_PARANOID):
New macro to raise an error if in paranoid validation.
* src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID().
* src/gxvalid/gxvfeat.c: Ditto.
* src/gxvalid/gxvjust.c: Ditto.
* src/gxvalid/gxvkern.c: Ditto.
* src/gxvalid/gxvmort.c: Ditto.
* src/gxvalid/gxvmort0.c: Ditto.
* src/gxvalid/gxvmort1.c: Ditto.
* src/gxvalid/gxvmort2.c: Ditto.
* src/gxvalid/gxvmorx1.c: Ditto.
* src/gxvalid/gxvmorx2.c: Ditto.
2011-06-15 01:12:04 +09:00
suzuki toshiya 248aa63973 [gxvalid] Preparation to fix gcc4.6 compiler warnings.
* src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to
conditionalize the variable which is only used for trace messages.
Automatically set by FT_DEBUG_LEVEL_TRACE.
(GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of
unvalidated variables.  Undefined by default to calm gcc4.6 warning.
(GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined
GID ranges, for the comparison of GID ranges in different subtables.
2011-06-14 23:47:21 +09:00
suzuki toshiya 62aa9ec647 gxvalid: Pass the union by the pointer instead of the value. 2009-08-01 00:29:29 +09:00
Werner Lemberg f47acf2b5f Avoid compiler warnings.
* */*: s/do ; while ( 0 )/do { } while ( 0 )/.
Reported by Sean McBride <sean@rogue-research.com>.
2009-01-12 20:11:14 +00:00
Werner Lemberg 936346413f Remove tabs from source files. 2007-06-01 06:56:17 +00:00
Werner Lemberg 99aa14c226 Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.

* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.

* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.

* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.

* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.

* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.

* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.

* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.

* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.

* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.

* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.

* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.

* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.

* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.

* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.

* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.

* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.

* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.

* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.

* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.

* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.

* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter.  Update all callers.
(gxv_trak_validate): Improve trace message.

* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 19:31:27 +00:00
Werner Lemberg a4aa1c5bee * src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix tracing message.
* src/gxvalid/gxvcommn.c (gxv_odtect_add_range): Use `const'.

* src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmod.c,
src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve tracing
messages.
Decorate constants with `U' and `L' where appropriate.
Fix compiler warnings.
2005-08-31 22:39:23 +00:00
Suzuki, Toshiya (鈴木俊哉) a438621451 Add gxvalid module to validate TrueType GX/AAT tables.
Modifications on existing files:

	* Jamfile: Register gxvalid module.
	* src/base/Jamfile: Register ftgxval.c.
	* src/base/rule.mk: Register ftgxval.c.
	* docs/INSTALL.ANY: Register gxvalid/gxvalid.c.

	* include/freetype/config/ftheader.h: Add macro to include gxvalid
	header file, FT_GX_VALIDATE_H.
	* include/freetype/config/ftmodule.h: Register gxv_module_class.

	* include/freetype/ftchapters.h: Add comment about gx_validation.
	* include/freetype/ftotval.h: Change keyword FT_VALIDATE_XXX
	to FT_VALIDATE_OTXXX to co-exist gxvalid.
	* include/freetype/tttags.h: Add tag for TrueType GX/AAT tables.

	* include/freetype/internal/ftserv.h: Add macro to use gxvalid
	service, FT_SERVICE_GX_VALIDATE_H
	* include/freetype/internal/fttrace.h: Add trace facilities
	for gxvalid.

	New files on existing directories:

	* include/freetype/internal/services/svgxval.h: Registration of
	validation service for TrueType GX/AAT and classic kern table.
	* include/freetype/ftgxval.h: Public API definition to use gxvalid.
	* src/base/ftgxval.c: Public API of gxvalid.

	New files under src/gxvalid/:

	* src/gxvalid/Jamfile src/gxvalid/README src/gxvalid/module.mk
	src/gxvalid/rules.mk src/gxvalid/gxvalid.c src/gxvalid/gxvalid.h
	src/gxvalid/gxvbsln.c src/gxvalid/gxvcommn.c src/gxvalid/gxvcommn.h
	src/gxvalid/gxverror.h src/gxvalid/gxvfeat.c src/gxvalid/gxvfgen.c
	src/gxvalid/gxvjust.c src/gxvalid/gxvkern.c src/gxvalid/gxvlcar.c
	src/gxvalid/gxvmod.c src/gxvalid/gxvmod.h src/gxvalid/gxvmort.c
	src/gxvalid/gxvmort.h src/gxvalid/gxvmort0.c src/gxvalid/gxvmort1.c
	src/gxvalid/gxvmort2.c src/gxvalid/gxvmort4.c src/gxvalid/gxvmort5.c
	src/gxvalid/gxvmorx.c src/gxvalid/gxvmorx.h src/gxvalid/gxvmorx0.c
	src/gxvalid/gxvmorx1.c src/gxvalid/gxvmorx2.c src/gxvalid/gxvmorx4.c
	src/gxvalid/gxvmorx5.c src/gxvalid/gxvopbd.c src/gxvalid/gxvprop.c
	src/gxvalid/gxvtrak.c: New files, gxvalid body.
2005-08-24 04:31:31 +00:00