Commit Graph

5972 Commits

Author SHA1 Message Date
suzuki toshiya 237b3822c4 correct a wrong note in makefile 2017-09-13 17:11:14 +09:00
suzuki toshiya 0fcbb73fa3 replace dummy code in PIC support, from typedef to unused global variable.
Watcom C compiler does not recognize typedef-only code as something valid.
2017-09-13 17:11:14 +09:00
suzuki toshiya 2beca49584 bdf_parse_t->have[], bdf_font_t->{nmod,umod} are allocated in runtime.
Watcom C compiler refuses too huge structure type > 64k.
2017-09-13 17:11:13 +09:00
suzuki toshiya 4e41249fad cpp-conditionalize too large property value check for LP64 systems,
because it is always false on 16bit & 32bit systems.
2017-09-13 17:11:13 +09:00
suzuki toshiya 70e4141c0d [memory debug] incompatible change of internal API for 16bit & ILP64 systems.
ft_mem_primes[] is originally typed to FT_Int, it could not track the memory allocation on 16bit (I16-LP32) system.
2017-09-13 17:11:13 +09:00
suzuki toshiya c6569d4423 Insert casts to some bitshifting, to fit the types of destination variables. 2017-09-13 17:11:13 +09:00
suzuki toshiya 2dcaaad116 [md5] make some constants typed unsigned long,
and MD5_u32plus is changed from unsigned int to FT_UInt32.
2017-09-13 17:11:13 +09:00
suzuki toshiya a645228790 disable TrueTypeGX Variant for 16bit systems in temporal,
due to the limitation that internal face_index is typed int.
2017-09-13 17:11:13 +09:00
suzuki toshiya 79b806fef8 replace 32bit enumarator by cpp macro, conditionally on 16bit system. 2017-09-13 17:11:13 +09:00
suzuki toshiya 7576da1c3e [cff] internal API is changed incompatibly for 16bit & ILP64 systems.
bias calculation is expected to be ILP32, LP64 or LLP64 systems (int = 32bit).
Some internal variables and internal APIs are extended to use 32bit type for 16bit systems.
Using long type is too large on LP64 systems,
and induces the incompatible change of the internal API for 32bit systems,
it should be avoided.
2017-09-13 17:11:13 +09:00
suzuki toshiya 5d2e1ac3b6 insert explict cast to FT_UInt32 when bitshifting for 32bit value.
note: long constant is too large for LP64 platforms.
2017-09-13 17:11:13 +09:00
suzuki toshiya fbde20e94b cpp-conditionalize too large property value check for LP64 systems,
because it is always false on 16bit systems.
2017-09-13 17:11:12 +09:00
suzuki toshiya c122d3172c To make large unsigned 16bit value, temporal bit shift like (1 << 16) can induce an overflow.
Change to make 32bit value by bitshifting and cast to 16bit in later.
2017-09-13 17:11:12 +09:00
suzuki toshiya 2d4f881acd replace "<=" by "==" in the comparison of unsigned variable. 2017-09-13 17:11:12 +09:00
suzuki toshiya df9094492d cpp-conditionalize a check for int width or height > 64k, because it is always false on 16bit system. 2017-09-13 17:11:12 +09:00
suzuki toshiya 12ef16a44b insert explict cast to FT_Fixed when bitshifting for FT_Fixed value.
note: long constant is too large for LP64 platforms.
2017-09-13 17:11:12 +09:00
suzuki toshiya 8f36537406 use FT_UInt32 type to check UCS-2 codepoint overflow in cmap format 4 parser.
note: long type is too large for LP64 platforms.
2017-09-13 17:11:12 +09:00
suzuki toshiya 58dd3a1e6e insert explict cast to FT_Fixed when bitshifting for FT_Fixed value.
note: long constant is too large for LP64 platforms.
2017-09-13 17:11:11 +09:00
suzuki toshiya 776ff19d64 make numerical constant long when bitshifting for FT_Long value 2017-09-13 17:11:11 +09:00
suzuki toshiya 8938185a80 cast 16bit values in the enumarator to signed short, to fit 16bit platforms. 2017-09-13 17:11:11 +09:00
suzuki toshiya 4e28a8fc63 make numerical constant long when bitshifting for FT_Long value 2017-09-13 17:11:11 +09:00
suzuki toshiya ebaa282874 cpp-conditionalize a too long string > 64k, because it is always false on 16bit system. 2017-09-13 17:11:11 +09:00
suzuki toshiya 67219481a8 watcom16.h, watcom16.mk: Watcom 16bit C compiler support files.
unix-watcom16.mk: cross build by Watcom C compiler on Linux.
2017-09-13 17:11:11 +09:00
suzuki toshiya 782336ab31 builds/compiler/16bit.h: new generic header, to avoid greater-than-int enumarator. 2017-09-13 17:11:11 +09:00
suzuki toshiya 93e76a510c devel/ftoption.h: disable some too expensive features for 16bit platform. 2017-09-13 17:11:11 +09:00
suzuki toshiya 5ad845771a [cache] Fix a possible overflow by signed integer comparison.
Improve the code by 5d3ff05615 ,
issues are found by Behdad Esfahbod and Werner Lemberg.

* src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Replace
a subtraction to check higher bit by a bit operation,
and cpp-conditionalize for appropriate systems.  Add better
documentation to the comment.
(FTC_ImageCache_LookupScaler): Ditto.
(FTC_SBitCache_Lookup): Ditto.
(FTC_SBitCache_LookupScaler): Ditto.
2017-09-13 15:49:15 +09:00
Werner Lemberg 96dcc8ad6e [autofit] Really fix #41334 (#52000).
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
`segment->delta' everywhere.
2017-09-13 08:16:23 +02:00
suzuki toshiya 21658c31f7 [autofit, sfnt] Fix for `make multi'.
* src/autofit/afshaper.c: Include FT_ADVANCE_H, to use
FT_Get_Advance() in it.
* src/sfnt/ttcmap.c: Include FT_SERVICE_POSTSCRIPT_CMAPS_H
to use PS_Unicodes in it, also include `ttpost.h' to use
tt_face_get_ps_name() in it.
2017-09-12 15:59:18 +09:00
Azzuro babe13ec5c [build] Improve builds with different MS Visual Studio versions.
* builds/windows/vc2010/freetype.vcxproj: Switch platform toolset
according to the Visual Studio version.
2017-09-11 10:47:29 +02:00
Werner Lemberg 3e4b79970e * src/sfnt/ttkern.c (tt_face_load_kern): Reject format 2 tables.
Reported by Behdad.
2017-09-11 08:51:44 +02:00
Alexei Podtelezhnikov d1b6c6e211 Typo. 2017-09-10 22:35:21 -04:00
Alexei Podtelezhnikov 0683f0df7c Warping CHANGES. 2017-09-09 13:01:11 -04:00
Werner Lemberg 0ab2b62d3f [autofit] Improve communication with ftgrid.
* src/autofit/afhints.c (af_glyph_hints_get_segment_offset):
Provide values in font units.
2017-09-09 08:08:47 +02:00
Werner Lemberg e2e56f9dd5 Officially announce end of 16bit compiler support. 2017-09-09 06:31:03 +02:00
Alexei Podtelezhnikov 33b390a63b Warping documentation updates. 2017-09-08 21:34:47 -04:00
suzuki toshiya 3ef59e59e0 [base] Remove a check for resource ID in the resource fork driver.
LastResort.dfont has a marginal resource ID 0xFFFF for sfnt
resource.  Inside Macintosh: More Macintosh Toolbox, `Resource IDs'
(1-46), tells that some IDs are reserved and should not be used.
FreeType2 just uses resource ID to sort the fragmented resource.
To accept the marginal fonts, the checking is removed.

* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove res_id
validity check, fix a trace message format.
2017-09-09 01:28:24 +09:00
suzuki toshiya 71f661804e ChangeLog for last commit. 2017-09-09 01:05:44 +09:00
suzuki toshiya 5c4e40d7fd [sfnt, truetype] Register the tags for marginal fonts.
The first 32bit of standard TrueType variants is 0x00010000,
`OTTO', `ttcf', `true' or `typ1'.  2 marginal dfonts on legacy Mac
OS X, Keyboard.dfont and LastResort.dfont, have the sfnt resources
starting 0xA5 followed by `kbd' or `lst'.  Considering the following
data could be parsed as conventional TrueType fonts, the header
checking is updated to allow these tags.  It seems that recent Mac
OS X has already switched to normal TTF for these fonts.

See the discussion at
http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3931.0

* include/freetype/tttags.h (TTAG_0xA5kbd, TTAG_0xA5lst): New header
tags for Keyboard.dfont and LastResort.dfont.
* src/sfnt/sfobjs.c (sfnt_open_font): Accept the sfnt resource
starts with TTAG_0xA5kbd or TTAG_0xA5lst.
* src/truetype/ttobjs.c (tt_face_init): Accept the face with the
format tag is TTAG_0xA5kbd or TTAG_0xA5lst.
2017-09-09 01:03:26 +09:00
Alexei Podtelezhnikov 22a7f5b8af Branding fixes. 2017-09-07 22:36:02 -04:00
Alexei Podtelezhnikov e0b480d191 s/&nbsp;/~/ 2017-09-06 21:21:14 -04:00
Werner Lemberg a3dd6d99a4 Fix multiple calls of `FT_Bitmap_Convert'.
The documentation of `FT_Bitmap_Convert' says that multiple calls do
proper reallocation of the target FT_Bitmap object.  However, this
failed for the sequence

  non-empty bitmap
  empty bitmap
  non-empty bitmap

Reason was that `FT_Bitmap_Convert' only reallocated the bitmap
buffer if it became too small; it didn't make the buffer smaller.
For an empty bitmap following a non-empty one, only the buffer
dimension got set to zero, without deallocation.  If the next call
was a non-empty buffer again, an assertion in `ft_mem_qrealloc' was
triggered.

* src/base/ftbitmap.c (FT_Bitmap_Convert): Always reallocate target
buffer to the correct size.

* docs/CHANGES: Document it.
2017-09-05 23:02:04 +02:00
Werner Lemberg 7d017ba810 [bdf] Fix size and resolution handling.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Use `SIZE' values if
`POINT_SIZE', `RESOLUTION_X', or `RESOLUTION_Y' properties are
missing.

* docs/CHANGES: Document it.
2017-09-05 15:28:21 +02:00
Alexei Podtelezhnikov f0898b9259 Swap `ALLOC_MULT' arguments (#51833).
* src/base/ftbitmap.c (ft_bitmap_assure_buffer): Updated.
* src/winfonts/winfnt.c (FNT_Load_Glyph): Updated.
* src/raster/ftrend1.c (ft_raster1_render): Updated.
2017-08-25 21:40:01 -04:00
Werner Lemberg 587264cfd5 Typo. 2017-08-23 09:14:14 +02:00
Werner Lemberg e1d0249e5a [sfnt] Fix clang compilation (#51788).
* src/sfnt/pngshim.c (premultiply_data): Use vectors instead of
scalars.
(vector_shuffle): New macro to take of a different built-in function
name on clang.
2017-08-23 08:18:22 +02:00
Werner Lemberg bd28952e23 [base] Don't zero out allocated memory twice (#51816).
Patch applied from bug report.

* src/base/ftutil.c (ft_mem_qrealloc): Use low-level allocation to
avoid unnecessary overhead.
2017-08-22 08:41:03 +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
Alexei Podtelezhnikov 7653c76533 [sfnt] Avoid synthetic unicode for symbol fonts with PUA.
Reported as

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

* src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.
2017-08-17 21:28:32 -04:00
Werner Lemberg cadd29de08 * src/sfnt/pngshim.c (premultiply_data): Fix compiler warnings. 2017-08-16 13:32:17 +02:00
Behdad Esfahbod c9d7c03fa1 [sfnt] Speed up PNG image loading.
This reduces the overhead of `premultiply_data' by 60%.

* src/sfnt/pngshim.c (premultiply_data): Provide code which uses
gcc's (and clang's) `vector_byte' attribute to process 4 pixels at a
time.
2017-08-16 05:46:10 +02:00