summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [sdf] Add debugging function.sdfAnuj Verma2020-12-222-0/+106
| | | | * src/sdf/ftsdf.c (sdf_shape_dump): New function.
* [sdf] Add brief technical overview of both rasterizers.Anuj Verma2020-12-222-0/+166
|
* [sdf] Add 'bsdf' renderer to 'sdf' module.Anuj Verma2020-12-223-2/+158
| | | | | | * src/sdf/ftsdfrend.c (ft_bsdf_render): New function. (ft_bitmap_sdf_renderer_class): New structure.
* [sdf] Add interface functions for the 'bsdf' rasterizer.Anuj Verma2020-12-223-2/+198
| | | | | | | | | | * 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.
* [sdf] Add function to copy SDF data into output bitmap.Anuj Verma2020-12-222-0/+105
| | | | * src/sdf/ftbsdf.c (finalize_sdf): New function.
* [sdf] Add '8-point sequential Euclidean distance mapping' algorithm.Anuj Verma2020-12-222-1/+257
| | | | | * src/sdf/ftbsdf.c (compare_neighbor, first_pass, second_pass, edt8): New functions.
* [sdf] Add function to copy source bitmap to distance map.Anuj Verma2020-12-222-0/+207
| | | | * src/sdf/ftbsdf.c (bsdf_init_distance_map): New function.
* [sdf] Add functions to compute pixel edge distances.Anuj Verma2020-12-222-1/+262
| | | | | * src/sdf/ftbsdf.c (compute_edge_distance, bsdf_approximate_edge): New functions.
* [sdf] Add function to find edge pixels in a grid of alpha values.Anuj Verma2020-12-222-0/+117
| | | | * src/sdf/ftbsdf.c (bsdf_is_edge): New function.
* [sdf] Add essential structures for the 'bsdf' rasterizer.Anuj Verma2020-12-222-0/+137
| | | | | | * src/sdf/ftbsdf.c (ONE): New macro. (BSDF_TRaster, ED, BSDF_Worker): New structures. (zero_ed): New constant.
* [sdf] Add 'sdf' module to non-gnumake build systems.Anuj Verma2020-12-223-0/+12
| | | | | | | * include/freetype/config/ftmodule.h: Add both the 'sfd' and 'bsfd' renderers to the list of modules. * CMakeLists.txt (BASE_SRCS): Add 'sdf' single-object module.
* [sdf] Added basic overlapping contour support.Anuj Verma2020-12-222-6/+259
| | | | | * src/sdf/ftsdf.c (sdf_generate_with_overlaps): New function. (sdf_raster_render): Enable it.
* [sdf] Add build infrastructure.Anuj Verma2020-12-227-0/+106
| | | | | | | | | | | | | | | * 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.
* [sdf] Add interface functions for the 'sdf' rasterizer.Anuj Verma2020-12-222-0/+203
| | | | | | | * 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.
* [sdf] Add subdivision and bounding box optimization.Anuj Verma2020-12-222-0/+311
| | | | | | * src/sdf/ftsdf.c (sdf_generate_bounding_box): New function, which is an optimized version of `sdf_generate`. (sdf_generate_subdivision): New function.
* [sdf] Add function to generate SDF.Anuj Verma2020-12-222-1/+169
| | | | | | * 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.
* [sdf] Add functions to get shortest distance from any edge/contour.Anuj Verma2020-12-222-0/+156
| | | | | * src/sdf/ftsdf.c (sdf_edge_get_min_distance): New function. (sdf_contour_get_min_distance): New function, currently disabled.
* [sdf] Add shortest distance finding functions.Anuj Verma2020-12-222-1/+1091
| | | | | | | | * 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).
* [sdf] Add function to resolve corner distances.Anuj Verma2020-12-222-0/+110
| | | | * src/sdf/ftsdf.c (resolve_corner): New function.
* [sdf] Add essential math functions.Anuj Verma2020-12-222-0/+254
| | | | | | | | * 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.
* [sdf] Add utility functions for contours.Anuj Verma2020-12-222-0/+479
| | | | | | | * 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.
* [sdf] Add functions to decompose `FT_Outline`.Anuj Verma2020-12-222-0/+208
| | | | | | | * 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.
* [sdf] Structs, enums, macros, and functions for 'sdf' rasterizer.Anuj Verma2020-12-222-0/+674
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* [sdf] Add raster parameters structure.Anuj Verma2020-12-224-0/+77
| | | | | | | * 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.
* [sdf] Add 'sdf' renderer.Anuj Verma2020-12-222-0/+429
| | | | | | * src/sdf/ftsdf.c: Add 'sdf' renderer along with its interface functions. Also add functions to set and get properties.
* [sdf] Add common elements for 'sdf' and 'bsdf' renderers.Anuj Verma2020-12-224-0/+258
| | | | | | | | | | | | | | | * 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.
* [sdf] Add files for new 'sdf' module.Anuj Verma2020-12-229-0/+64
| | | | | | | | | | | | | | | | | | 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.
* [base] Allow renderers of different formats.Anuj Verma2020-12-221-0/+12
| | | | | | | | | | * src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`. The forthcoming 'bsdf' renderer will require bitmaps for processing. * src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove renderer's glyph format check before adding and removing them. The 'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.
* Add data types required for the forthcoming 'sdf' module.Anuj Verma2020-12-224-5/+60
| | | | | | | | | | | | | * include/freetype/freetype.h (FT_Render_Mode): Add new render mode `FT_RENDER_MODE_SDF`, which will be used to generate SDF. * include/freetype/ftimage.h (FT_Pixel_Mode): Add new pixel mode `FT_PIXEL_MODE_GRAY16`, which will be the output of the 'sdf' module. (FT_RASTER_FLAG_SDF): New raster flag to be used internally by the 'sdf' module. * include/freetype/fttypes.h (FT_F6Dot10): New data type.
* [base] Allow renderers of different formats.Anuj Verma2020-12-222-7/+14
| | | | | | | | | | * src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`. The forthcoming 'bsdf' renderer will require bitmaps for processing. * src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove renderer's glyph format check before adding and removing them. The 'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.
* [autofit] Fix double division in stem darkening.Tatsuyuki Ishi2020-12-183-16/+30
| | | | | | | | | | | | | | | The old code used to divide the darkening amount by em_ratio twice, leading to unnecessarily bold stems on certain fonts with higher units per em (e.g. Inter). This patch fixes it. The return value of af_loader_compute_darkening was also changed to use 16.16 fixed point to get rid of a redundant truncation operation. This should slightly improve the precision, although it's still bottlenecked by the emboldening function, which uses 26.6 fixed point. * src/autofit/afloader.[ch] (af_loader_compute_darkening): Return FT_Fixed. (af_loader_embolden_glyph_in_slot): Revise calculations.
* ftmodapi.h: Replace 0xA0 characters with spaces.Werner Lemberg2020-12-171-12/+12
|
* * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): New public macro.Alexei Podtelezhnikov2020-12-172-0/+24
| | | | The driver name is needed for `FT_Property_Set' and `FT_Property_Get'.
* Documentation edits.Alexei Podtelezhnikov2020-12-161-4/+4
|
* [truetype] Fix incremental metrics (#59503).Chris Liddell2020-12-163-20/+47
| | | | | | | | | | | | | | | | | * src/truetype/ttgload.c (tt_get_metrics, load_truetype_glyph): Previously, the code would populate the phantom points before calling the `get_glyph_metrics` callback. For formats like PCL XL format 1, class 2 downloaded fonts (where metrics are removed from the TTF header), this causes problems when the hinting program uses the phantom points (misplaced and distorted glyphs) due to the metrics being unset (all zeros). (tt_get_metrics_incr_overrides): Renamed to... (tt_get_metrics_incremental): ... this. Updated caller * include/freetype/ftincrem.h: Update the documentation to make it clearer that `get_glyph_metrics` is to retrieve metrics from a non-standard source, but *not* for the purpose of imposing custom metrics.
* Documentation edits.Alexei Podtelezhnikov2020-12-151-5/+4
|
* [type42] Pacify static analysis tools (#59682).Werner Lemberg2020-12-142-2/+11
| | | | | * src/type42/t42objs.c (T42_Size_Init, T42_GlyphSlot_Init): Avoid warnings about uninitialized variables.
* .mailmap: Add Priyesh.Werner Lemberg2020-12-101-0/+1
|
* * builds/unix/configure.raw: Don't set `FT_DEBUG_LOGGING`.Werner Lemberg2020-12-072-4/+10
| | | | All debug options are handled exclusively in `ftoption.h`.
* * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-076-42/+46
|
* */*: s/FT_LOGGING/FT_DEBUG_LOGGING/.Werner Lemberg2020-12-0715-73/+77
|
* docs/CHANGES: Mention `FT_LOGGING`.loggingWerner Lemberg2020-12-051-0/+7
|
* * builds/toplevel.mk (do-dist): Remove `submodules` directory.Werner Lemberg2020-12-052-0/+7
|
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-0522-127/+149
| | | | | This ensures good logging output, with all lines having a proper prefix (if requested).
* [base] Don't close 'stderr' after logging.Werner Lemberg2020-12-053-2/+11
| | | | | * src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit): Fix it.
* * submodules/dlg: Updated to commit 9f0c8b22.Werner Lemberg2020-12-052-0/+4
|
* * src/bdf/bdflib.c: Fix `-Wformat` warning.Werner Lemberg2020-12-052-1/+5
|
* Improve setup for 'dlg' library.Werner Lemberg2020-12-053-18/+33
| | | | | | | | | | * autogen.sh (copy_submodule_file), builds/toplevel.mk: Redirect stderr to `/dev/null`. * builds/toplevel.mk: Move code block to handle 'dlg' stuff into `check_platform` conditional. Also fix wildcard expressions for guarding `git submodule` commands. Also make file copying work with non-Unix platforms (untested).
* [build] Use gcc (and clang) in C99 mode.Werner Lemberg2020-12-056-31/+26
| | | | | | | | | | | | Other compilers are unchanged. * builds/compiler/gcc-dev.mk, builds/compiler/gcc.mk (ANSIFLAGS): s/-ansi/-std=c99/. * builds/freetype.mk (FT_CFLAGS): Remove `-std=c99`. * builds/unix/configure.raw: Handle C99. Remove no longer needed test for gcc 4.6 and earlier.
* Update `.gitignore`.Werner Lemberg2020-12-041-1/+3
|