-
2b1d5562
by Anuj Verma
at 2021-06-08T08:29:34+05:30
[sdf] Use 8 bits for final SDF output instead of 16bits.
Since 8-bits is enough to represent SDF data we no longer require
16-bits for this purpose. Also, we now normalize the output data
to use the entire 8-bit range efficiently. For example: if we use
3.5 format with a spread of 1 we basically only use the starting
5-bits. By normalizing we can use the entire 8-bit range.
* include/freetype/freetype.h (FT_Render_Mode): Updated description
for `FT_RENDER_MODE_SDF` regarding this change.
* include/freetype/ftimage.h (FT_Pixel_Mode): Removed
`FT_PIXEL_MODE_GRAY16` since no longer required.
* include/freetype/fttypes.h (FT_F6Dot10): Removed since no longer
required.
* src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Allocate 8-bit
bitmap instead of 16-bit buffer.
* src/sdf/ftsdfcommon.h (map_fixed_to_sdf): Added function to convert
16.16 distance value to our desired format.
* src/sdf/ftsdf.c (sdf_generate_with_overlaps,
sdf_generate_bounding_box): Use the new `map_fixed_to_sdf` function
and also use 8-bit output buffer.
* src/sdf/ftbsdf.c (finalize_sdf): Output to a 8-bit buffer instead
of 16-bit buffer.
-
36ee7171
by Werner Lemberg
at 2021-06-08T09:00:39+02:00
[sdf] Formatting and improved comments.
-
35b21c71
by Werner Lemberg
at 2021-06-08T09:06:39+02:00
[sdf] Make `make multi` work.
* src/sdf/ftsdf.c: Include `ftbitmap.h`.
* src/sdf/ftsdfcommon.h: Move function bodies to `ftsdfcommon.c`.
Include `ftobjs.h` to get definitions of `FT_LOCAL` and friends.
* src/sdf/ftsdfcommon.c: New file.
* src/sdf/rules.mk, src/sdf/sdf.c: Updated.
-
41fa19fc
by Werner Lemberg
at 2021-06-08T10:32:20+02:00
* src/sdf/ftsdfcommon.c: Fix inclusion of header files.
-
ee6d03d3
by Dominik Röttsches
at 2021-06-08T14:29:11+03:00
[sfnt] Pointer validity check when reading COLR 'v1' layers
* src/sfnt/ttcolr.c (tt_face_get_paint_layers): In addition to the
existing sanity checks, ensure that the pointer to the layer to be
read is within the 'COLR' v1 table.
-
b24cfc8d
by Werner Lemberg
at 2021-06-08T15:26:41+02:00
[sfnt] Sanitize cmap4 table better.
Fixes #1062.
* src/sfnt/ttcmap.c (tt_cmap4_validate): Handle a too-small value of
`length` gracefully.
-
640f654b
by Werner Lemberg
at 2021-06-08T16:45:04+02:00
Fix 'devel' build for COLR 'v1'.
* devel/ftoption.h: Synchronize with
`include/freetype/config/ftoption.h`.
-
d586927d
by Werner Lemberg
at 2021-06-08T17:44:53+02:00
Various documentation improvements and fixes.
-
08f66322
by Werner Lemberg
at 2021-06-08T18:23:16+02:00
More various documentation improvements and fixes.
-
8dc02fb9
by Alexei Podtelezhnikov
at 2021-06-08T22:31:11-04:00
More CHANGES.
-
7833e308
by Alexei Podtelezhnikov
at 2021-06-09T10:40:30-04:00
[sdf] Fix SDF positioning.
* src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Add padding to
`bitmap_top' and `bitmap_left'.
* sdf/sdf/ftsdf.c (sdf_generate_with_overlaps): Fix VC++ warning.
-
9bfecfd2
by Alexei Podtelezhnikov
at 2021-06-09T23:34:04-04:00
* src/truetype/ttinterp.c (TT_RunIns): Optimize tracing.
-
a34afe67
by Werner Lemberg
at 2021-06-12T08:40:16+02:00
[psaux] Fix assertions.
* src/psaux/pshints.c (cf2_hintmap_adjustHints): Check for overflow
before emitting an assertion error.
-
db0f2c44
by Werner Lemberg
at 2021-06-12T10:13:08+02:00
[psaux] Fix another assertion.
* src/psaux/psintrp.c (cf2_interpT2CharString)
<cf2_escCALLOTHERSUBR>: Convert assertion into error, since the
problem can happen with invalid user input.
Test case is file
fuzzing/corpora/legacy/oss-fuzz/5754332360212480-unknown-read
in the `freetype2-testing` repository.
-
8336d53c
by Alexei Podtelezhnikov
at 2021-06-12T22:33:08-04:00
[type42] Fix new memory leak.
We need to inverse inheritance of FT_GlyphSlot_Internal so that we
have a chance to free the rendered bitmap from the parent slot.
* src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts
of the child `ttslot' and replace it with the parent structure.
(T42_GlyphSlot_Done): Updated accordingly.
-
c6fcd612
by Alexei Podtelezhnikov
at 2021-06-15T22:49:21-04:00
Add a comment.
-
6f273f68
by David Turner
at 2021-06-16T10:28:47+02:00
[meson] Add first regression test to FreeType
* tests/README.md: documentation explaining how to
build and run the tests with the Meson build.
* tests/scripts/download-test-fonts.sh: Simple script
to download test font files to the 'tests/data/'
folder.
* meson.build, meson_options.txt, tests/meson.build:
Add 'tests' option to enable building and running the
test programs, disabled by default.
* tests/issue-1063/main.c: Simple regression test to
exhibit issue 1063.
* .gitignore: Ignore the content of the tests/data/
folder for now.
-
f8c5c546
by David Turner
at 2021-06-16T10:31:12+02:00
Fix for issue 1063
See https://gitlab.freedesktop.org/freetype/freetype/-/issues/1063
for more details on the bug.
-
482c57cc
by Werner Lemberg
at 2021-06-18T16:46:23+02:00
Add `ChangeLog` entries for last two commits.
-
61bac759
by Alexei Podtelezhnikov
at 2021-06-18T17:38:00-04:00
* src/sdf/ftsdfrend.c (ft_(b)sdf_render): Do not FT_ERROR routinely.
-
232243e7
by Werner Lemberg
at 2021-06-19T06:41:01+02:00
Prevent hinting if there are too many segments.
This speeds up handling of broken glyphs.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35309
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Implement
it.
-
b460a506
by Werner Lemberg
at 2021-06-19T07:03:40+02:00
[truetype] Fix integer overflow.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35312
* src/truetype/ttinterp.c (Ins_JMPR): Use `ADD_LONG`.
-
008e42a1
by Werner Lemberg
at 2021-06-19T15:45:46+02:00
ftver.rc: Update copyright year.
-
bcd73f7d
by Werner Lemberg
at 2021-06-20T16:23:40+02:00
freetype.h: Mark 'COLR' v1 API as experimental.
-
284eec1e
by Dominik Röttsches
at 2021-06-22T20:33:33+02:00
Move 'COLR' API to `ftcolor.h`.
* include/freetype/freetype.h: Cut section layer managament
containing 'COLR' v0 and v1 API and move it to `ftcolor.h` as
requested by Werner on freetype-devel.
* include/freetype/ftcolor.h: Paste that section.
-
4cb21b9a
by Dominik Röttsches
at 2021-06-22T20:50:48+02:00
[sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/.
* include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat,
FT_COLR_Paint): Do it to make it harmonize with other names such as
'PaintTranslate'.
* src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
-
1e65e605
by Werner Lemberg
at 2021-06-23T08:14:42+02:00
fterrors.h: Fix documentation extraction of `FT_Error_String`.
-
d8ac180c
by Alexei Podtelezhnikov
at 2021-06-23T23:32:02-04:00
[smooth, raster] Remove synonymous error macros.
* src/smooth/ftgays.c [STANDALONE_]: s/ErrRaster_/Smooth_Err_/.
(gray_convert_glyph_inner): Updated accordingly.
* src/raster/ftraster.c [STANDALONE_]: Do not abbreviate error macros.
(New_Profile, End_Profile, Insert_Y_Turn, Line_Up, Bezier_Up,
Decompose_Curve, Draw_Sweep, Render_Single_Pass, ft_black_render):
Updated accordingly.
-
1e0cef9e
by Alexei Podtelezhnikov
at 2021-06-24T00:19:50-04:00
[smooth, raster] Fix up and align error codes.
FT_Render_Glyph picked up FAILURE or 1 returned from the raster
function, which became a confusing error code. Instead, return
Raster_Overflow in the unlikely event that banding does not help or
another meaningful error.
* src/smooth/ftgrays.c (gray_convert_glyph_inner, gray_convert_glyph):
Use Raster_Overflow when the rendering pool is exhausted and return it
if banding does not help.
(gray_raster_render): Use Smooth_Err_Ok.
* src/raster/ftraster.c (Render_Single_Pass): Return Raster_Overflow
if banding does not help or another error code.
-
ff407765
by Werner Lemberg
at 2021-06-25T09:24:07+02:00
[base] Add trace level to logging output.
Some practical debugging work has shown that displaying level X of
an `FT_TRACEX` macro in the output of `FT2_DEBUG="... -v"` would be
very helpful to find out which trace level should be selected. As
an example, we now get output like
```
[ttobjs:2] TTF driver
[ttobjs:2] SFNT driver
[sfobjs:2] not a font using the SFNT container format
[t1objs:2] Type 1 driver
[stream:7] FT_Stream_EnterFrame: 14 bytes
```
* include/freetype/internal/ftdebug.h (FT_LOGGING_TAGX): New macro.
(FT_LOG): Use it to add the trace level to the logging tag.
* include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
Adjust.
* docs/DEBUG: Updated.
-
bc1029b9
by Alexei Podtelezhnikov
at 2021-06-25T18:20:57-04:00
* src/raster/ftraster.c (Render_Single_Pass): Remove dead code.
-
f6370e2f
by Alexei Podtelezhnikov
at 2021-06-25T22:59:39-04:00
[raster] Adjust sub-band bisecting limits.
We can bisect a band until it is just a single scan line. This might
be slow and cause time-outs but if we need to impose limits it should
be elsewhere.
* src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.
-
fb4511eb
by Alexei Podtelezhnikov
at 2021-06-26T08:49:20-04:00
[raster] Make `band_top' local variable.
* src/raster/ftraster.c (black_TWorker): Move `band_top' from here...
(Render_Single_Pass): ... to here, and refactor.
(Render_Glyph): Updated.
-
3a278381
by Alexei Podtelezhnikov
at 2021-06-28T10:22:03-04:00
[raster] Clean up vertical sweep.
* src/raster/ftraster.c (black_TWorker): Replace the current line
offset with the pointer and drop the increment.
(Function_Sweep_Init): Take values as arguments instead of pointers.
(Vertical_Sweep_*, Horizontal_Sweep_Init, Draw_Sweep): Updated.
-
7d4e55c3
by Dominik Röttsches
at 2021-06-28T18:02:55+02:00
[sfnt] Improve paint limit checks
Paint tables can appear before the `base_glyphs_v1` offset if the
font is produced with the layer list before the base glyph list. In
this case paint tables can occur after the layer list but before the
base glyph list. Checks in the 'COLR' v1 code were rejecting fonts
with this layout. Improve these checks by calculating a minimum
offset after which paint tables can occur and use that in safety
checks.
* src/sfnt/ttcolr.c (Colr, tt_face_load_colr): Declare
`paint_start_v1` and calculate that as the minimum of the end of
layer list and base glyph list.
(get_child_table_pointer, read_paint, tt_face_get_paint_layers):
Use that in safety checks.
-
c852388d
by Alexei Podtelezhnikov
at 2021-06-28T23:26:10-04:00
[raster] Handle Bézier stack locally.
* src/raster/ftraster.c (black_TWorker): Move `arcs' from here...
(Conic_To, Cubic_To): ... to here to tighten their scope.
(Bezier_Up, Bezier_Down): ... Take the current `arc' argument.
-
e1b1b542
by Werner Lemberg
at 2021-06-29T06:07:00+02:00
ftcolor.h: Minor grammar fix.
-
7be47010
by Anurag Thakur
at 2021-06-29T08:43:30+02:00
[CI] Introduce linux CI and refactor job names
* .gitlab-ci.yml: Added jobs for building freetype on linux.
-
3696ac5a
by Alexei Podtelezhnikov
at 2021-06-29T23:27:10-04:00
[raster] Handle sub-band stack locally.
* src/raster/ftraster.c (black_TWorker): Move `band_stack' from here..
(Render_Single_Pass): ... to here and accept limit arguments.
(Render_Glyph): Updated.
-
69c3516c
by Alexei Podtelezhnikov
at 2021-06-29T23:51:23-04:00
[raster] Do not skip the second pass without dropout control.
The second pass also fixes horizontal lines through the pixel centers.
* src/raster/ftraster.c (black_TWorker): Do not use `second_pass'.
(Render_Glyph): Skip the second pass only with the appropriate flag.
-
90ecac41
by Werner Lemberg
at 2021-06-30T10:23:42+02:00
Update `CHANGES` file; other minor doc fixes.
-
f27b4834
by Alexei Podtelezhnikov
at 2021-06-30T10:54:59-04:00
* src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'.
-
0348c627
by Dominik Röttsches
at 2021-07-01T06:15:22+02:00
[sfnt] Handle fonts without layer list in 'COLR' v1.
'COLR' v1 fonts do not necessarily need to have a layer list; for
this reason, 'fontTools' recently started generating fonts in a way
that drops the layer list if there are no layers in it. This
results in the layer list offset becoming zero, which FreeType
treated as an invalid table. Fix that and handle the case for layer
list offset being 0. This slightly changes how we need to calculate
the starting offset for paints.
* src/sfnt/ttcolr.c (tt_face_load_colr): Handle case of layer list
offset being zero without outright rejecting table.
-
286da6c5
by Dominik Röttsches
at 2021-07-01T06:49:03+02:00
[sfnt] Support PaintScale in 'COLR' v1 parsing.
* include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add
`FT_COLR_PAINTFORMAT_SCALE`.
(FT_PaintScale): New structure to represent 'PaintScale*' tables.
(FT_COLR_Paint): Updated.
* src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration.
(read_paint): Parse 'PaintScale' and friends.
-
d3dc2da9
by Ben Wagner
at 2021-07-01T07:02:04+02:00
* src/truetype/ttgxvar.c (tt_set_mm_blend): Test `coords`.
It is undefined behavior to pass `NULL` to `memcpy`. `coords' is
passed to `memcpy` but `TT_Get_MM_Blend` and `TT_Get_Var_Design`
explictly call `tt_set_mm_blend` with `coords` as `NULL`. In
addition, `TT_Set_MM_Blend` has a similar possible issue.
-
4cb8a88a
by Werner Lemberg
at 2021-07-03T13:25:23+02:00
* meson_options.txt: Sort alphabetically; no final full stops.
-
a399fb89
by Werner Lemberg
at 2021-07-03T16:34:01+02:00
meson.build: Minor doc improvements.
-
5e32a034
by Werner Lemberg
at 2021-07-03T20:24:16+02:00
README.git: Revised.
-
89c60eca
by Werner Lemberg
at 2021-07-05T05:41:53+02:00
* src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix argument.
Reported by Hin-Tak.
-
50d0033f
by Werner Lemberg
at 2021-07-05T05:44:13+02:00
meson.build: Minor doc fix.
-
b53e85ea
by David Turner
at 2021-07-12T09:15:25+02:00
Remove experimental "Latin2" writing system (FT_OPTION_AUTOFIT2)
This code has always been experimental and was never compiled
anyway (FT_OPTION_AUTOFIT2 does not appear in ftoption.h or even
any of our build files).
-
06fc6ad6
by David Turner
at 2021-07-12T09:18:11+02:00
Remove experimental auto-hinting 'warp' mode.
This feature was always experimental, and probably nevery worked
properly. This patch completely removes it from the source code,
except for a documentation block describing it for historical
purpose.
-
667b0539
by David Turner
at 2021-07-12T09:19:37+02:00
Remove obsolete AF_Angle type and related sources.
Move the af_sort_xxx() functions from afangles.c to afhints.c
in order to get rid of the obsolete angle-related types,
macros and function definitions.