Commit Graph

347 Commits

Author SHA1 Message Date
Priyeshkkumar 968d484cc0 Fixed `-Wformat' warnings.
* src/*: Fixed format specifiers.

	*  src/bdf/bdflib.c (ACMSG3, ACMSG7): Fixed `-Wformat' warnings.
2020-08-28 09:56:38 +05:30
Priyesh Kumar 53be1753de Fix `-Wformat' compiler warnings.
* src/*: Fix format specifiers.

* builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
2020-07-28 07:33:40 +02:00
Werner Lemberg 96fb73efd5 Fix clang warnings.
* include/freetype/internal/autohint.h
(FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
* src/autofit/afmodule.h: Use it to declare
`af_autofitter_interface'.

* include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
* src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
`ft_outline_glyph_class'.

* src/base/ftglyph.c: Include `ftbase.h'.

* src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.

* src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.

* src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
* src/psaux/psauxmod.h: Declare `afm_parser_funcs',
`t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.

* src/pshinter/pshmod.c: Include `pshmod.h'.

* src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
conversion.
(compute_ULong_sum): Fix return type.
Fix implicit sign conversion.
(store_points): Fix type of `last_flag', `repeat_count', and `flag'.
Use casts to avoid warnings.
(reconstruct_glyf): Fix implicit sign conversion.
Use cast to avoid warning.
(get_x_mins): Fix implicit sign conversion.
* src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
* src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
declare cmap classes.

* src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.

* src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
2020-07-07 16:58:14 +02: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
Jakub Alba a45da25349 * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#58319).
The font that exceeds the old limit is Icono Regular, version
1.00000.
2020-05-08 10:59:37 +02:00
Werner Lemberg 4a19a53d5a * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#57732).
The font that exceeds the old limit is Constantine, version 1.001.
2020-02-04 13:37:19 +01:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Dominik Röttsches 10d8de7541 [truetype] Fix UBSan warning on offset to nullptr (#57501).
* src/truetype/ttinterp.c (Ins_CALL): Fail if `exc->FDefs' is null.
2020-01-02 11:14:01 +01:00
Dominik Röttsches 8cee1dde4e Fix more UBSan warnings on adding offset to nullptr (#57432).
* src/truetype/ttinterp.c (Ins_LOOPCALL), src/psaux/psft.c
(cf2_initLocalRegionBuffer): Use `FT_OFFSET'.
2019-12-21 19:03:48 +01:00
Werner Lemberg 7e1b39f6cd [truetype] Fix UBSan warnings on adding offsets to nullptr.
Reported as

  https://bugs.chromium.org/p/chromium/issues/detail?id=1032152

* src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Use `FT_OFFSET'.
2019-12-16 11:07:58 +01:00
Werner Lemberg 0c14a3adb0 [truetype] Fix integer overflow.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19305

* src/truetype/ttinterp.c (Ins_MIRP): Use `ADD_LONG'.
2019-12-14 00:04:01 +01:00
Werner Lemberg dfc9a049de * src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'.
Reported as

  https://bugs.chromium.org/p/chromium/issues/detail?id=1030614
2019-12-05 08:44:30 +01:00
Werner Lemberg 551bd3a90e More nullptr offset UBSan warnings (#57331, #57347).
* src/autofit/afcjk.c (af_cjk_hints_compute_segments),
src/psaux/psft.c (cf2_getSeacComponent), src/truetype/ttinterp.c
(Ins_UNKNOWN): Use `FT_OFFSET'.
2019-12-03 11:52:48 +01:00
Werner Lemberg c3be6f06b7 src/truetype/ttinterp.c: Give order of operations for some instructions. 2019-05-21 11:23:36 +02:00
Werner Lemberg 262fce445a * src/truetype/ttinterp.c (opcode_name): Improve mnemonics. 2019-05-21 09:58:51 +02:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Armin Hasitzka b77826e139 Triage 8ea854bfe9. 2019-02-21 10:23:15 +00:00
Armin Hasitzka 8ea854bfe9 [truetype] Mask numeric overflows.
* src/truetype/ttinterp.c (Move_CVT, Move_CVT_Stretched, Ins_MIRP):
Mask numeric overflows.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11681
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11734
2019-02-21 10:14:57 +00:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg 2b4e61e4d6 Minor documentation fixes. 2018-12-12 09:36:39 +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 1d7b034cd8 Use formatting string in FT_TRACEX calls for non-simple arguments.
* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
<cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>:
Do it.

* src/psaux/pshints.c (cf2_hintmap_build): Ditto.

* src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR,
cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto.

* src/truetype/ttinterp.c (TT_RunIns): Ditto.
2018-08-14 15:56:28 +02:00
Werner Lemberg ced9c311f6 Ditto. 2018-08-04 07:03:57 +02:00
Werner Lemberg be81acc4bf * src/truetype/ttinterp.c (opcode_name): Fix typos. 2018-08-04 07:01:04 +02:00
Hin-Tak Leung 71e29fe1c9 [truetype] Match ttdebug's naming of instruction mnemonics.
* src/truetype/ttinterp.c: The form used in ttdebug,
"MDRP[G,B,W,?]", etc., is slightly more readable than
"MDRP[00,01,02,03]".
2018-07-24 10:04:23 +02:00
Nikhil Ramakrishnan 78d85b9c84 Restore missing comment lines and other minor fixes 2018-06-04 20:33:56 +05:30
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 67994e8221 * src/truetype/ttinterp.c (Ins_MIRP): Use SUB_LONG; avoid FT_ABS.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8706
2018-06-02 19:51:03 +02:00
Werner Lemberg 2a1597826a [truetype] Integer overflow issues.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7739

* src/truetype/ttinterp.c (Ins_CEILING): Use FT_PIX_CEIL_LONG.
2018-04-17 12:25:17 +02:00
Werner Lemberg 70ac167c47 [truetype] Integer overflow issues.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7718

* src/truetype/ttinterp.c (Ins_MIRP): Use ADD_LONG.
2018-04-16 10:39:10 +02:00
Werner Lemberg 235b1e2fe6 [truetype]: Limit `SLOOP' bytecode argument to 16 bits.
This fixes

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7707

* src/truetype/ttinterp.c (Ins_SLOOP): Do it.
2018-04-15 21:55:04 +02:00
Werner Lemberg 827ca3bcf2 [truetype] Integer overflow issues.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7652

* src/truetype/ttinterp.c (Ins_MDAP): Use SUB_LONG.
2018-04-14 07:20:31 +02:00
Werner Lemberg bd9400bd46 [truetype] Integer overflow issues.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7453

* src/truetype/ttinterp.c (Round_Super, Round_Super_45): Use
ADD_LONG and SUB_LONG.
2018-04-09 21:28:37 +02:00
Werner Lemberg efd13c5d1b * src/truetype/ttinterp.c (TT_RunIns): Fix tracing arguments. 2018-03-01 22:17:54 +01:00
Werner Lemberg 4a03f17449 [truetype] Integer overflow issues.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6027

* src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIAP, Ins_MIRP): Use
SUB_LONG; avoid FT_ABS.
2018-02-06 02:23:19 +01:00
Werner Lemberg 29c759284e * src/truetype/ttinterp.c (Ins_GETVARIATION): Avoid NULL reference.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5736
2018-01-27 14:43:43 +01:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 98ba0c4a37 New `ftdriver.h' file, covering all driver modules.
This reduces redundancy and increases synergy; it also reduces the
number of header files.

* include/freetype/config/ftheader.h (FT_DRIVER_H): New macro.
(FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H,
FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to
FT_DRIVER_H.

* include/freetype/ftautoh.h, include/freetype/ftcffdrv.h,
include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h,
include/freetype/ftttdrv.h: Replaced with...
* include/freetype/ftdriver.h: ...this new file.
(FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to...
(FT_HINTING_ADOBE): ... this new macro.
(FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to...
(FT_HINTING_FREETYPE): ... this new macro.

* src/*/*: Updated accordingly.
2017-12-08 18:41:49 +01:00
Werner Lemberg 71fecc539e Improve tracing messages by using singular and plural forms.
* src/*/*.c: Implement it.
2017-12-05 12:06:29 +01:00
Ben Wagner c06b9cf56d [truetype] Really, really fix #52082.
* src/truetype/ttinterp.c (Ins_MDRP): Correct conditional.
2017-09-28 19:08:38 +02:00
Ben Wagner 63be40bccf [truetype] Really fix #52082.
* src/truetype/ttinterp.c (Ins_MDRP): Correct conditional.
2017-09-23 00:44:59 +02:00
Werner Lemberg 6d04bd991b [truetype] Integer overflow (#52082).
* src/truetype/ttinterp.c (Ins_MDRP): Avoid FT_ABS.
2017-09-21 21:22:51 +02:00
Werner Lemberg eaa9adf325 [truetype] Integer overflows.
Changes triggered by

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3429

* src/truetype/ttinterp.c (Ins_SHPIX, Ins_DELTAP): Use NEG_LONG.
(Ins_MIAP): Use SUB_LONG.
2017-09-20 08:00:05 +02:00
Werner Lemberg 0aca17cf53 [truetype] Integer overflow.
Changes triggered by

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3107

* src/truetype/ttinterp.c (Ins_MDRP, Ins_MIRP, Ins_ALIGNPTS): Use
NEG_LONG.
2017-08-22 08:25:14 +02:00
Werner Lemberg 17196b7c74 [truetype] Integer overflow.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2868

* src/truetype/ttinterp.c (Ins_ALIGNRP): Use NEG_LONG.
2017-08-05 18:58:34 +02:00
Nikolaus Waxweiler 7f44c2db24 [truetype] Do not set any ClearType flags in v40 monochrome mode.
This fixes weird behavior of instructions that resulted in rendering
differences between v35 and v40 in monochrome mode, e.g., in
`timesbi.ttf'.

* src/truetype/ttinterp.c (Ins_GETINFO)
[TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Check
`subpixel_hinting_lean'.
2017-08-03 06:15:30 +02:00
Werner Lemberg ca799e9be5 [truetype] Integer overflow.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2455

* src/truetype/ttinterp.c (Ins_SCFS): Use SUB_LONG.
2017-07-03 06:27:52 +02:00
Werner Lemberg dde8f5abbe [truetype] Integer overflows.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2384
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2391

* src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix): Use
NEG_LONG.

* src/truetype/ttinterp.c (Ins_SxVTL): Use NEG_LONG.
2017-06-27 06:16:04 +02:00
Werner Lemberg b27cef27ff [truetype] Integer overflows.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2364

* src/truetype/ttinterp.c (Ins_ISECT): Use NEG_LONG.
2017-06-24 20:17:46 +02:00