|
e592982a
|
2021-07-13T10:00:22
|
|
[sdf] Improve documentation.
|
|
90ecac41
|
2021-06-30T10:23:42
|
|
Update `CHANGES` file; other minor doc fixes.
|
|
61bac759
|
2021-06-18T17:38:00
|
|
* src/sdf/ftsdfrend.c (ft_(b)sdf_render): Do not FT_ERROR routinely.
|
|
7833e308
|
2021-06-09T10:40:30
|
|
[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.
|
|
41fa19fc
|
2021-06-08T10:32:20
|
|
* src/sdf/ftsdfcommon.c: Fix inclusion of header files.
|
|
35b21c71
|
2021-06-08T09:06:39
|
|
[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.
|
|
36ee7171
|
2021-06-08T09:00:39
|
|
[sdf] Formatting and improved comments.
|
|
2b1d5562
|
2021-06-08T08:29:34
|
|
[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.
|
|
6e253b26
|
2021-05-29T11:05:41
|
|
Typos in previous commit.
|
|
a50c39aa
|
2021-05-29T09:50:29
|
|
Fix compilation errors and (some) warnings for clang++.
* src/autofit/afmodule.c (AF_GlyphHintsRec): Make it static.
* src/cache/ftcache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
(ftc_snode_compare): Remove semicolon.
* src/cff/cffparse.c (cff_parser_run): Add `break` statement.
* src/cid/cidload.c (cid_hex_to_binary): Add cast.
* src/sdf/ftbsdf.c (CHECK_NEIGHBOR): Use `do {} while(0)` loop.
(bsdf_init_distance_map, finalize_sdf, bsdf_raster_render): Add
casts.
* src/sdf/ftsdf.c (sdf_generate_bounding_box,
sdf_generate_with_overlaps): Ditto.
* src/sdf/ftsdfcommon.h (square_root): Ditto.
* src/sdf/ftsdfrend.c (sdf_property_get, ft_sdf_render,
ft_bsdf_render): Ditto.
* src/sfnt/ttcolr.c (find_base_glyph_record,
find_base_glyph_v1_record): Fix variable signedness.
(read_color_line): Add cast.
(read_paint): Add casts.
Fix signedness issue.
(tt_face_get_colorline_stops) Fix signedness issues.
* src/sfnt/ttpost.c (load_format_20): Add casts.
* src/truetype/ttsubpix.c (TWEAK_RULES, TWEAK_RULES_EXCEPTIONS):
Remove final semicolons.
|
|
e6e5b67d
|
2021-04-23T21:33:03
|
|
* src/sdf/ftsdf.c (sdf_{edge,contour,shape}_new): Use FT_QALLOC.
|
|
2149b51f
|
2021-03-13T19:08:09
|
|
Handle various VC++ compiler warnings.
Fixes #1039.
* src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside):
Initialize `sigma`.
* src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if
function arguments are invalid.
* src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast.
* src/sfnt/sfwoff2.c (woff2_decompress)
[!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`.
|
|
b6e8a712
|
2021-01-17T07:18:48
|
|
Update all copyright notices.
|
|
c6ff2556
|
2020-12-26T10:50:21
|
|
[sdf] Use 'counter-clockwise', not 'anti-clockwise'.
We prefer US nomenclature.
* src/sdf/ftsdf.c (SDF_Contour_Orientation):
s/SDF_ORIENTATION-ACW/SDF_ORIENTATION_CCW/.
Update all users.
|
|
10a5dfec
|
2020-12-26T08:34:38
|
|
[sdf] Remove custom memory tracker.
The internal FreeType memory tracker is sufficient.
* src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER, SDF_MemoryUser,
sdf_alloc, sdf_free, SDF_ALLOC, SDF_FREE,
SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP,
SDF_MEMORY_TRACKER_DONE): Removed.
s/SDF_ALLOC/FT_ALLOC/.
s/SDF_FREE/FT_FREE/.
Other updates.
|
|
286e9e0d
|
2020-12-24T08:41:12
|
|
[sdf] Two more copyright notices.
|
|
3c983eb8
|
2020-12-24T08:36:09
|
|
[sdf] Fix `make multi`.
* src/sdf/ftsdf.c: Include `ftoutln.h`.
|
|
aa1b5362
|
2020-12-24T08:32:04
|
|
[sdf] Fix tracing.
* include/freetype/internal.fttrace.h: Add 'bsdf' component.
* src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.
|
|
04a64432
|
2020-12-24T08:29:05
|
|
[sdf] Add copyright notices.
|
|
b298a644
|
2020-08-21T04:59:08
|
|
[sdf] Add debugging function.
* src/sdf/ftsdf.c (sdf_shape_dump): New function.
|
|
6444875f
|
2020-08-21T03:59:23
|
|
[sdf] Add brief technical overview of both rasterizers.
|
|
6cd6df55
|
2020-08-20T21:57:43
|
|
[sdf] Add 'bsdf' renderer to 'sdf' module.
* src/sdf/ftsdfrend.c (ft_bsdf_render): New function.
(ft_bitmap_sdf_renderer_class): New structure.
|
|
d27d107f
|
2020-08-20T21:25:46
|
|
[sdf] Add interface functions for the 'bsdf' rasterizer.
* src/sdf/ftsdf.c (bsdf_raster_new, bsdf_raster_reset,
bsdf_raster_set_mode, bsdf_raster_render, bsdf_raster_done): New
functions.
(ft_bitmap_sdf_raster): New variable.
* src/sdf/ftsdf.h: Updated.
|
|
a2113475
|
2020-08-20T21:21:33
|
|
[sdf] Add function to copy SDF data into output bitmap.
* src/sdf/ftbsdf.c (finalize_sdf): New function.
|
|
e2ae96b9
|
2020-08-20T21:19:32
|
|
[sdf] Add '8-point sequential Euclidean distance mapping' algorithm.
* src/sdf/ftbsdf.c (compare_neighbor, first_pass, second_pass,
edt8): New functions.
|
|
6b9a8044
|
2020-08-20T21:09:23
|
|
[sdf] Add function to copy source bitmap to distance map.
* src/sdf/ftbsdf.c (bsdf_init_distance_map): New function.
|
|
0f644f38
|
2020-08-20T09:25:15
|
|
[sdf] Add functions to compute pixel edge distances.
* src/sdf/ftbsdf.c (compute_edge_distance, bsdf_approximate_edge):
New functions.
|
|
c5761764
|
2020-08-20T09:20:26
|
|
[sdf] Add function to find edge pixels in a grid of alpha values.
* src/sdf/ftbsdf.c (bsdf_is_edge): New function.
|
|
9bbb3611
|
2020-08-20T09:17:38
|
|
[sdf] Add essential structures for the 'bsdf' rasterizer.
* src/sdf/ftbsdf.c (ONE): New macro.
(BSDF_TRaster, ED, BSDF_Worker): New structures.
(zero_ed): New constant.
|
|
05f6088d
|
2020-08-20T07:54:13
|
|
[sdf] Added basic overlapping contour support.
* src/sdf/ftsdf.c (sdf_generate_with_overlaps): New function.
(sdf_raster_render): Enable it.
|
|
879ca87f
|
2020-08-19T16:57:38
|
|
[sdf] Add build infrastructure.
* src/sdf/module.mk, src/sfd/rules.mk: New files.
* src/sdf/ftsdf.h (ft_sdf_raster): New forward declaration.
* include/freetype/ftmoderr.h (FT_MODERRDEF): Add error definition
for the 'sdf' module.
* include/freetype/internal/fttrace.h (FT_TRACE_DEF): Add trace
definition for the `sdf' module.
* modules.cfg (RASTER_MODULES): Add the `sdf' module to the list of
rasterizers.
|
|
665ac967
|
2020-08-19T16:29:51
|
|
[sdf] Add interface functions for the 'sdf' rasterizer.
* src/sdf/ftsdf.c (sdf_raster_new, sdf_raster_reset,
sdf_raster_set_mode, sdf_raster_render, sdf_raster_done): New
functions.
(ft_sdf_raster): New structure.
|
|
1010f2c3
|
2020-08-19T16:25:08
|
|
[sdf] Add subdivision and bounding box optimization.
* src/sdf/ftsdf.c (sdf_generate_bounding_box): New function, which
is an optimized version of `sdf_generate`.
(sdf_generate_subdivision): New function.
|
|
986d3108
|
2020-08-19T12:56:58
|
|
[sdf] Add function to generate SDF.
* src/sdf/ftsdf.c (sdf_generate): New function, currently disabled.
This is a proof-of-concept implementation: It doesn't use any
optimization, it simply checks all grid points against all contours.
|
|
0d52f4ae
|
2020-08-19T12:22:34
|
|
[sdf] Add functions to get shortest distance from any edge/contour.
* src/sdf/ftsdf.c (sdf_edge_get_min_distance): New function.
(sdf_contour_get_min_distance): New function, currently disabled.
|
|
81e32986
|
2020-08-18T17:49:56
|
|
[sdf] Add shortest distance finding functions.
* src/sdf/ftsdf.c (get_min_distance_line, get_min_distance_conic,
get_min_distance_cubic): New functions. Note that
`get_min_distance_conic` comes with two implementations (using an
analytical and an iterative method, to be controlled with the
`USE_NEWTON_FOR_CONIC` macro).
|
|
c918b54f
|
2020-08-18T10:28:16
|
|
[sdf] Add function to resolve corner distances.
* src/sdf/ftsdf.c (resolve_corner): New function.
|
|
a255125f
|
2020-08-18T10:17:46
|
|
[sdf] Add essential math functions.
* src/sdf/ftsdf.c (cube_root, arc_cos) [!USE_NEWTON_FOR_CONIC]: New
auxiliary functions.
* src/sdf/ftsdf.c (solve_quadratic_equation, solve_cubic_equation)
[!USE_NEWTON_FOR_CONIC]: New functions.
|
|
cd413845
|
2020-08-18T10:14:20
|
|
[sdf] Add utility functions for contours.
* src/sdf/ftsdf.c (get_control_box, get_contour_orientation): New
functions.
(split_conic, split_cubic, split_sdf_conic, split_sdf_cubic,
split_sdf_shape): New functions.
|
|
2de1b563
|
2020-08-17T16:36:30
|
|
[sdf] Add functions to decompose `FT_Outline`.
* src/sdf/ftsdf.c (sdf_move_to, sdf_line_to, sdf_conic_to,
sdf_cubic_to): New auxiliary decomposition functions.
(sdf_compose_funcs): New structure.
(sdf_outline_decompose): New function.
|
|
cf0464d8
|
2020-08-17T16:24:39
|
|
[sdf] Structs, enums, macros, and functions for 'sdf' rasterizer.
* src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER)
[FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New macros.
(SDF_MemoryUser) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New
struct for memory usage tracing.
(sdf_alloc, sdf_free) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New
functions for memory usage tracing.
(SDF_ALLOC, SDF_FREE): New macros for memory management.
(SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP,
SDF_MEMORY_TRACKER_DONE): New macros to set up memory usage tracing.
(USE_NEWTON_FOR_CONIC, MAX_NEWTON_DIVISIONS, MAX_NEWTON_STEPS,
CORNER_CHECK_EPSILON, CG_DIMEN): New configuration macros for
controlling the process of finding the shortest distance.
(MUL_26D6, VEC_26D6_DOT): New auxiliary macros.
(SDF_TRaster, SDF_Edge, SDF_Contour, SDF_Shape, SDF_Signed_Distance,
SDF_Params): New structs for setting up SDF data.
(SDF_Edge_Type, SDF_Contour_Orientation): New enums for SDF data.
(zero_vector, null_edge, null_contour, null_shape, max_sdf): Useful
constants.
(sdf_edge_new, sdf_edge_done, sdf_contour_new, sdf_contour_done,
sdf_shape_new, sdf_shape_done): New constructors and destructors.
|
|
c6ec87ec
|
2020-08-17T16:11:56
|
|
[sdf] Add raster parameters structure.
* src/sdf/ftsdf.h (SDF_Raster_Params): New structure.
* src/sdf/sdf.c: Include source files in order to make a single
object of the module.
|
|
56d27d32
|
2020-08-17T11:47:26
|
|
[sdf] Add 'sdf' renderer.
* src/sdf/ftsdf.c: Add 'sdf' renderer along with its interface
functions.
Also add functions to set and get properties.
|
|
21627032
|
2020-08-17T11:40:57
|
|
[sdf] Add common elements for 'sdf' and 'bsdf' renderers.
* src/sdf/ftsdfrend.h (SDF_Rendere_Module, ft_sdf_renderer_class,
ft_bitmap_sdf_renderer_class): New structures.
* src/sdf/ftsdfcommon.h (DEFAULT_SPREAD, MIN_SPREAD_MAX_SPREAD,
USE_SQUARED_DISTANCES): New macros.
(FT_INT_26D6, FT_INT_16D16, FT_26D6_16D16): New macros.
(FT_CALL, VECTOR_LENGTH_16D16): New macros.
(FT_26D6_Vec, FT_16D16_Vec, FT_16D16, FT_26D6, FT_6D10, FT_CBox):
New typedefs.
(square_root): New macro.
* src/sdf/ftsdferrs.h: Add module error setup.
|
|
cd6ff28a
|
2020-08-16T17:09:22
|
|
[sdf] Add files for new 'sdf' module.
Here is a breakdown of what the files will contain.
* src/sdf/ftsdfrend.c, src/sdf/ftsdfrend.h: The 'sdf' and 'bsdf'
renderers.
* src/sdf/ftsdf.c, src/sdf/ftsdf.h: The rasterizer for the 'sdf'
renderer.
* src/sdf/ftbsdf.c, src/sdf/ftbsdf.h: The rasterizer for the 'bsdf'
renderer.
* src/sdf/ftsdfcommon.h: Commmon properties and functions for both
rasterizers.
* src/sdf/ftsdferrs.h: Common error defines.
* src/sdf/sdf.c: For building a single object of the entire module.
|