summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [builds/windows] Use native memory allocation API.win-heapAlexei Podtelezhnikov2021-09-061-12/+7
| | | | | | * builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free): Wrap HeapAlloc, HeapReAlloc, and HeapFree. (FT_New_Memory): Set the heap handle.
* Cosmetic zeros.Alexei Podtelezhnikov2021-09-032-3/+3
|
* * src/bdf/bdflib.c (_bdf_parse_start): Keep parser memory.Alexei Podtelezhnikov2021-09-031-1/+0
|
* autogen.sh: Make it work with old Solaris 10 shell.Werner Lemberg2021-09-021-2/+7
|
* [smooth, raster, sdf] Clean up initialization calls.Alexei Podtelezhnikov2021-09-024-47/+25
| | | | | | | | * src/raster/ftraster.c (ft_black_init): Removed. (ft_black_new): Clean up. * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto. * src/sdf/ftsdf.c (sdf_raster_new): Ditto. * src/smooth/ftgrays.c (gray_raster_new): Ditto.
* * src/cache/ftcmanag.c (FTC_Manager_New): Avoid some zeroing.Alexei Podtelezhnikov2021-09-021-2/+5
|
* * src/bdf/bdflib.c (bdf_load_font): Remove memory shuffling.Alexei Podtelezhnikov2021-09-021-11/+3
|
* Cosmetic zeros.Alexei Podtelezhnikov2021-09-023-3/+3
|
* [base] Clean up stream reading.Alexei Podtelezhnikov2021-09-012-48/+49
| | | | | | | | | | | * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset, FT_Stream_ReadULong and their LE variants): Remove unnecessary initialization and slightly refactor. (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned value and align with sister functions. * include/freetype/internal/ftstream.h (FT_Stream_GetByte, FT_Stream_ReadByte): Update prototypes and caller macros.
* s/0/NULL/ where appropriate.Alexei Podtelezhnikov2021-09-019-17/+17
|
* * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close.Alexei Podtelezhnikov2021-08-301-4/+1
|
* [smooth] Reduce shift in multiply-shift optimization.Alexei Podtelezhnikov2021-08-301-6/+4
| | | | | | | | | | | | | | | | * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift. Smaller shifts that keep the division operands of FT_UDIVPREP within 32 bits result in slightly faster divisions, which is noticeable in the overall performance. The loss of precision is tolerable until the divisors (the components dx and dy) approach 32 - PIXEL_BITS. With PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size that we refuse to render anyway. Using `ftbench -p -s60 -t5 -bc timesi.ttf`, Before: 8.52 us/op After: 8.32 us/op
* [truetype] Fix compilation if !TT_CONFIG_OPTION_BYTECODE_INTERPRETER.Werner Lemberg2021-08-281-0/+17
| | | | | | | | * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): Compile function conditionally. (tt_face_vary_cvt) [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Add code. Fixes #1091.
* [builds/windows] Revise SSE2 settings.Alexei Podtelezhnikov2021-08-272-2/+2
| | | | | * builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2. * builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2.
* [smooth] Detect SSE2 with MSVC for x86Ben Wagner2021-08-271-6/+13
| | | | | | | | MSVC does not set `__SSE2__`. Instead one must check whether `_M_IX86_FP` is defined and greater than or equal to 2. * src/smooth/ftgrays.c (FT_SSE2): New macro. Use it where appropriate.
* Expand comment (cont'd).Alexei Podtelezhnikov2021-08-261-0/+6
|
* Expand comment.Alexei Podtelezhnikov2021-08-251-2/+7
|
* * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy.Alexei Podtelezhnikov2021-08-241-14/+13
|
* [truetype] Fix for the family name shorter than 8 characters.suzuki toshiya2021-08-251-1/+1
| | | | | | * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): If the family name to be checked is shorter than 8 characters, do not check its syntax.
* [truetype] Simplify `trick_names'.suzuki toshiya2021-08-241-10/+14
| | | | | | | | * src/truetype/ttobjs.c (tt_check_trickyness_family): For the case that the beginning part of a long tricky family name is already registered as another tricky family name, no need to double-check the longer one. Such long tricky family names are removed from the `trick_names'.
* [truetype] Add 2 tricky font names.suzuki toshiya2021-08-241-1/+3
| | | | | | | Additional fix for the issue #1087. * src/truetype/ttobjs.c (tt_check_trickyness_family): Add 2 tricky font names reported in #1087.
* [truetype] New function to skip the randomization tag.suzuki toshiya2021-08-241-1/+27
| | | | | | | | | | | | | | * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): New function to skip the randomization tag in the names of the fonts embedded in a PDF. It is used by tt_check_trickyness_family(), to keep from mistaking "DLC" in the randomization tag as a tricky font name. See discussion in: https://lists.nongnu.org/archive/html/freetype-devel/2021-02/msg00002.html For technical detail about the randomization tag, please find PDF Reference 5.5.3 "Font Subsets". Thanks to Justyna Wawrzynska for pointing out the issue caused by the randomization tag.
* [truetype] Add checksums for 2 tricky fonts.suzuki toshiya2021-08-241-1/+19
| | | | | | | | Thanks to Ting717 for providing sample PDF. Fixes #1087. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add checksums for 2 tricky fonts `DFHei-Bd-WIN-HK-BF' and `DFMing-Md-WIN-HK-BF'.
* Whitespace formatting.Alexei Podtelezhnikov2021-08-2213-14/+14
|
* Decorate const arguments.Alexei Podtelezhnikov2021-08-222-14/+14
| | | | | | * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it. * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it.
* [smooth] Clean up the null cell usage.Alexei Podtelezhnikov2021-08-201-45/+26
| | | | | | | | | | | | | Put the null cell at the end of the pool and store it explicitly so that we can use it as both the limit and the dumpster. * src/smooth/ftgrays.c (gray_TWorker): Store the last `cell_null` and remove unnecesary fields. (NULL_CELL_PTR, CELL_IS_NULL): Remove in favor of explicit `cell_null`. (gray_dump_cells, gray_set_cell, gray_sweep{,_direct}): Update callers. (gray_convert_glyph_inner): Trace remaining cells (oh well). (gray_convert_glyph): Set up `cell_null` and slightly improve the pool management.
* [base] Restore quiet no-op rendering of bitmap glyphs.Alexei Podtelezhnikov2021-08-201-1/+6
| | | | | | | Fixes #1076. * src/base/ftobjs.c (FT_Render_Glyph_Internal): Discard an error when rendering a bitmap glyph.
* [smooth] Fortify 64-bit algorithm.Alexei Podtelezhnikov2021-08-201-6/+6
| | | | | | * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): s/long/FT_Int64/ and s/unsigned long/FT_UInt64/. (gray_render_line): Adjust a critical variable type.
* * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.Carlo Bramini2021-08-191-0/+8
|
* Determine `long long` availability based on its size.Alexei Podtelezhnikov2021-08-192-2/+24
| | | | | | | | | MSVC, for example, used `long long` even without full C99 support. * include/freetype/config/ftstdlib.h: Check if `long long` limits are defined in <limits.h>. * include/freetype/config/integer-types.h: Check `long long` size and use it to typedef FT_Int64.
* [sfnt] Fix format expectation for `COLR` v1 ClipListDominik Röttsches2021-08-191-1/+1
| | | | | | * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Change ClipList format expectation to 1 instead of 0 to make it compliant with the latest spec.
* Readily use `long long` as a 64-bit type in C99 mode.Alexei Podtelezhnikov2021-08-181-9/+8
| | | | | * include/freetype/config/integer-types.h (FT_INT64): FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`.
* Use FT_INT64 instead of FT_LONG64.Alexei Podtelezhnikov2021-08-185-23/+16
| | | | | | | | * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64. * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/. * src/base/ftcalc.c: Ditto. * src/base/fttrigon.c: Ditto. * src/smooth/ftgrays.c: Ditto.
* [builds/windows] Do not set CharacterSet for VC++.Alexei Podtelezhnikov2021-08-182-12/+12
| | | | | * builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/. * builds/windows/visualc/freetype.vcproj: s/"1"/"0"/.
* * src/sdf/ftsdf.c (get_control_box): Fix compiler warning.Werner Lemberg2021-08-181-3/+3
|
* [base] Fix ppem size overflow.Werner Lemberg2021-08-186-14/+57
| | | | | | | | | | | | | | Fixes #1086. * src/base/ftobjs.c (FT_Request_Metrics): Add return value. Check whether ppem values fit into unsigned short values. (FT_Request_Size): Updated. * include/freetype/internal/ftobjs.h: Updated. * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c (cid_size_request), src/truetype/ttdriver.c (tt_size_request), src/type1/t1objs.c (T1_Size_Request): Updated.
* * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning.Alexei Podtelezhnikov2021-08-171-2/+2
|
* * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation.Alexei Podtelezhnikov2021-08-171-2/+2
|
* * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Minor fix.Werner Lemberg2021-08-091-1/+1
|
* [sfnt] Add missing blend mode 'plus' to 'COLR' v1.Dominik Röttsches2021-08-091-16/+17
| | | | | * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode 'plus' after it was added to the spec.
* include/freetype/freetype.h (FT_Encoding): Improve documentation.Werner Lemberg2021-08-081-5/+10
| | | | Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>.
* [smooth] Avoid integer overflow.Werner Lemberg2021-08-071-10/+5
| | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36243 * src/smooth/ftgrays.c(ADD_LONG, SUB_LONG, MUL_LONG, NEG_LONG) [STANDALONE_]: Removed, unused. (ADD_INT) [STANDALONE_]: New macro. (FT_INTEGRATE): Use ADD_INT.
* [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table.Dominik Röttsches2021-08-076-16/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | The optional 'COLR' v1 glyph-specific clip box helps upstream graphics libraries allocate a sufficiently large bitmap for a glyph without having to traverse the glyph graph for that. See https://github.com/googlefonts/colr-gradients-spec/issues/251 for background on the introduction of this specification change. * include/freetype/ftcolor.h (FT_ClipBox): New structure. (FT_Get_Color_Glyph_ClipBox): New function declaration. * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func): New function type. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it. * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API with SFNT implementation. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/ttcolr.c (Colr): New field `clip_list`. (tt_face_load_colr): Parse global clip list offset. (tt_face_get_color_glyph_clipbox): New function to find the clip box for a glyph id from the clip list array. * src/sfnt/ttcolr.h: Updated.
* [smooth] Fix left shifts of negative numbers.Werner Lemberg2021-08-061-11/+16
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36241 * src/smooth/ftgrays.c (LEFT_SHIFT): New macro. (gray_render_conic) [BEZIER_USE_DDA]: Use it.
* * meson.build: Fix zlib support.Werner Lemberg2021-08-021-11/+11
| | | | | | | | | | | This commit synchronizes zlib support with both autotools and cmake: If no external zlib is found (or intentionally disabled on the command line), use the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without modifying `FT_CONFIG_OPTION_USE_ZLIB`. Also improve summary output. Problem reported by Moazin.
* [sdf] Fix out-of-range-access.Anuj Verma2021-08-021-2/+2
| | | | | | | * src/sdf/ftbsdf.c (first_pass, second_pass): Fix range during forward pass. Otherwise the index goes out of range for the last column. Fixes issue #1077.
* Fix invalid memory access in `bsdf` rasterizer.Anuj Verma2021-08-021-3/+27
| | | | | | | | | | | | | | | Do not generate SDF from bitmap if the `FT_GLYPH_OWN_BITMAP` flag is not set. In some cases the bitmap buffer is freed but still points to a valid address; to handle those cases check the flag before accessing the memory. * src/sdf/ftsdfrend.c (ft_bsdf_render): Handle the above case. Also, return an error message if the bitmap's rows/pitch is invalid, otherwise `slot->buffer` might be assigned to some invalid memory location. (ft_sdf_render): Same as above. Plus, move the outline back to original state after rasterization and not if any error occurs. Signed-off-by: Anuj Verma <anujv@iitbhilai.ac.in>
* * meson.build: Honor `--includedir` instead of hard-coding 'include'.Heiko Becker2021-07-291-6/+7
| | | | Signed-off-by: Heiko Becker <heirecka@exherbo.org>
* src/sfnt/ttcolr.c: Minor formatting.Werner Lemberg2021-07-291-5/+5
|
* [sfnt] 'COLR' v1 PaintSweepGradient spec updateDominik Röttsches2021-07-292-8/+10
| | | | | | | | * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other spec changes and now has the angles specified as F2DOT14, reflect that in the implementation. * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update documentation.