src


Log

Author Commit Date CI Message
Alexei Podtelezhnikov baa0f71d 2021-04-23T13:48:34 [cid] s/FT_ALLOC/FT_QALLOC/ and clean up. * src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer. * src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto.
Alexei Podtelezhnikov b3438ccb 2021-04-23T08:35:02 [pfr] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/pfr/pfrload.c (pfr_extra_item_load_font_id, pfr_aux_name_load): Do not zero out the buffer.
Alexei Podtelezhnikov 1e525c62 2021-04-23T08:24:22 [bzip2,gzip] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Do not zero out the buffer. * src/gzip/ftgzip.c (ft_gzip_alloc, FT_Stream_OpenGzip): Ditto.
Alexei Podtelezhnikov a0fb6dbc 2021-04-23T00:05:18 [pcf,bdf,winfonts] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/pcf/pcfread.c (pcf_interpret_style): Do not zero out the buffer. * src/bdf/bdfdrivr.c (bdf_interpret_style): Ditto. * src/winfonts/winfnt.c (FNT_Face_Init, FNT_Load_Glyph): Ditto.
Alexei Podtelezhnikov 23f85c8a 2021-04-22T23:34:08 [cache] Optimize SBit copying. * src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer. (ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/.
Alexei Podtelezhnikov 93715ab2 2021-04-22T23:07:01 [gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/gxvalid/gxvmod.c (gxv_load_table): Do not zero out the buffer. * src/otvalid/otvmod.c (otv_load_table): Ditto.
Alexei Podtelezhnikov 90b97a83 2021-04-22T23:00:40 [psaux] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/psaux/psobjs.c (ps_table_done, ps_parser_load_field): Do not zero out the buffer.
Alexei Podtelezhnikov 44b1ebe5 2021-04-22T22:34:05 [base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. * src/base/ftobjs.c (open_face_PS_from_sfnt_stream, Mac_Read_sfnt_Resource): Do not zero out the buffer. * src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto. * src/base/ftrfork.c (raccess_make_file_name, raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto.
Alexei Podtelezhnikov 8a459e51 2021-04-20T22:53:13 [cache] Restore SBit copying for unowned (BDF) bitmaps. * src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Restore. (ftc_snode_load): Check ownership and copy unowned bitmaps.
Alexei Podtelezhnikov 361465de 2021-04-20T22:31:28 Bitmap tracing.
Dominik Röttsches e662a950 2021-04-19T12:49:16 [sfnt] Return in 'COLR' v1 when layer pointer outside table * src/sfnt/ttcolr.c (tt_face_get_paint_layers): Add missing return when paint pointer outside table. (read_paint): Add missing return when paint pointer outside table.
Alexei Podtelezhnikov 7c685cb3 2021-04-18T22:31:13 [cache] Switch to lazy SBit setting. * src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Removed. (ftc_snode_load): Take the bitmap ownership instead of copying.
Daniel Welty 2e68785e 2021-04-17T09:00:40 * src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch.
Dominik Röttsches 7f8a1edd 2021-04-16T12:35:29 [sfnt] Safeguard 'COLR' v1 layer extraction * src/sfnt/ttcolr.c (tt_face_get_paint_layers): Do not output layer pointer to iterator if it is outside the 'COLR' table. (read_paint): Do not attempt to read layers that are outside the table.
Ben Wagner f9350be1 2021-04-01T09:44:00 [base] Complete `ft_glyphslot_clear`. * src/base/ftobjs.c (ft_glyphslot_clear): This function is intended to reset all the values of a glyph slot. However, it was not resetting the values of the advances and `glyph_index`. Reset the advances and `glyph_index` to zero.
Ben Wagner 52f2a008 2021-04-01T09:33:47 Update TT_New_Context documentation In commit 531d463aed365b [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver. the `TT_ExecContext` was moved from being on the driver to being on the size to make it easier to use FreeType in a multi-threaded environment. However, the documentation for `TT_New_Context` was not updated and still reflects the old behavior and parameter list. This change updates `TT_New_Context` documentation to reflect the current parameters and usage.
Ben Wagner 369d8be9 2021-03-31T22:31:44 [truetype] Prevent glyph program state from persisting. `FDEF` instructions are specified as allowed only in 'prep' or 'fpgm'. FreeType has attempted to prevent their use in the glyph program, but they were still allowed in glyph programs if defined in a function defined in 'prep' or 'fpgm' and called from the glyph program. Similarly, `IDEF` instructions are specified not to be able to modify any existing instruction. FreeType has attempted to prevent their use in the glyph program, but they can still be used like `FDEF`. This change stores the initial bytecode range type and disallows the use of `FDEF` and `IDEF` while running the glyph program. Most other state is copied from the `TT_Size` into the execution context. However, it is possible for a glyph program to use `WS` to write to the storage area or `WCVTP`, `WCVTF`, and `DELTAC[123]` to write to the control value table. Allowing any change to the global state from the glyph program is problematic as the outlines of any given glyph may change based on the order the glyphs are loaded or even how many times they are loaded. There exist fonts that write to the storage area or the control value table in the glyph program, so their use should not be an error. Possible solutions to using these in the glyph program are * ignore the writes; * value-level copy on write, discard modified values when finished; * array-level copy on write, discard the copy when finished; * array-level copy up-front. Ignoring the writes may break otherwise good uses. A full copy up-front was implemented, but was quite heavy as even well behaved fonts required a full copy and the memory management that goes along with it. Value-level copy on write could use less memory but requires a great deal more record keeping and complexity. This change implements array-level copy on write. If any attempt is made to write to the control value table or the storage area when the initial bytecode range was in a glyph program, the relevant array will be copied to a designated storage area and the copy used for the rest of the glyph program's execution. * src/truetype/ttinterp.h (TT_ExecContextRec): New fields `iniRange`, `glyfCvtSize`, `glyfCvt`, `origCvt`, `glyfStoreSize`, `glyfStorage`, and `origStorage`. * src/truetype/ttinterp.c (Modify_CVT_Check): New function to handle `exc->glyfCvt`. (Write_CVT, Write_CVT_Stretched, Move_CVT, Move_CVT_Stretched): Use it. (Ins_WS): Handle `exc->glyfStorage`. (Ins_FDEF, Ins_IDEF): Updated. (TT_RunIns): Updated. (TT_Done_Context): Free 'glyf' CVT working and storage area. (TT_Load_Context): Fix/add casts. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix cast.
Dominik Röttsches 1c086293 2021-04-02T06:55:29 [sfnt] Check validity of pointer location of `read_color_line`. * src/sfnt/ttcolr.c (get_child_table_pointer): New function to fetch child table pointer early for all paint formats that compute a child table pointer. (read_color_line, read_paint): Updated. (tt_face_get_colorline_stops): Check `colr->table`.
Alexei Podtelezhnikov e9c50fa7 2021-03-16T22:12:41 * src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.
Ben Wagner b0729b8f 2021-03-15T14:32:24 [sfnt] Fix memory leak in png loading. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1182552 Memory is allocated and the pointer assigned to `rows` inside a 'setjmp' scope. This memory must be freed outside the 'setjmp' scope after a 'longjmp'. Since `rows` is a local and modified inside the 'setjmp' scope it must be marked volatile or it will have an indeterminate value after the 'longjmp'. * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak of `rows`.
Alexei Podtelezhnikov fb9bf2ef 2021-03-15T22:33:17 * src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning.
Werner Lemberg 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`.
Alexei Podtelezhnikov 80bda804 2021-03-11T22:40:19 [smooth] Reduce copying during integration phase. We now record `cover' and `area' directly into the linked list. This makes rendering faster by 10% or even more at larger sizes. * src/smooth/ftgrays.c (FT_INTEGRATE): Write directly. (gray_TWorker): Add direct cell reference and remove unused fields. (gray_set_cell): Consolidate the linked list management and pointers. (gray_convert_glyph, gray_convert_glyph_inner): Updated.
Alexei Podtelezhnikov d5b7de55 2021-03-11T22:08:45 * src/smooth/ftgrays.c (FT_INTEGRATE): New convenience macro. (gray_render_line, gray_render_scanline): Use it.
Alexei Podtelezhnikov 85168499 2021-03-09T22:14:44 * src/smooth/ftgrays.c (gray_render_line): Rearrange conditionals. These produce faster or more optimizable code.
Werner Lemberg 7227aabb 2021-03-04T06:41:30 Revert "[sfnt] Fix crash in `Load_SBit_Png` on Windows x64." This reverts commit dbf9142f7e0432c9ed618b3276e2b61fa39e7262, as discussed in #1037.
Jesse Towner dbf9142f 2021-02-25T15:07:25 [sfnt] Fix crash in `Load_SBit_Png` on Windows x64. This change fixes a crash that occurs in `Load_SBit_Png` when running on a 64-bit Windows OS. A memory access violation exception would be raised by `setjmp` if the `jmp_buf` is not aligned to a 16-byte memory boundary. This is due to setjmp executing `movdqa` instructions to store 128-bit XMM registers to memory, which require correct memory alignment. This problem occurs because `png_create_read_struct` uses `malloc` and `free` for memory management, which only guarantees 8-byte alignment on Windows. Instead, to fix the problem, `png_create_read_struct_2` is used on 64-bit Windows, which allows for user-defined memory allocation and deallocation callbacks to be specified. These callbacks forward the allocation and deallocation requests to `_aligned_alloc` and `_aligned_free`, ensuring that the allocated `png_struct` and internal `jmp_buf` have the requisite 16-byte alignment. * src/sfnt/pngshim.c <_WIN64>: Include `malloc.h`. (malloc_callback, free_callback) <_WIN64>: New functions. (Load_SBit_Png) <_WIN64>: Use `png_create_read_struct_2` instead of `png_create_read_struct`
Werner Lemberg e1f364e5 2021-02-25T20:00:07 [woff2] Fix memory leak. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28148 * src/sfnt/sfwoff2.c (woff2_open_font): Reject fonts that have multiple tables with the same tag. While not explicitly forbidden in the OpenType specification, it is implicitly forbidden by describing a binary search algorithm for tables that only works reliably if table tags are unique.
Werner Lemberg 92bd99bd 2021-02-16T14:07:18 Move 'dlg' submodule to `subprojects` directory. This is for future changes with Meson, which doesn't allow a different name for its `subprojects` directory. Having both a `submodules` and a `subprojects` directory is confusing. * .gitmodules, autogen.sh (copy_submodule_files, DLG_INC_DIR, DLG_SRC_DIR): Updated. * builds/toplevel.mk (<top-level>, do-dist), builds/windows/vc2010/script.bat: Updated. * src/tools/no-copyright: Updated.
Dominik Röttsches 215ae253 2021-02-16T12:53:45 [sfnt] Update paint format values to support non-variable paints. * freetype.h (FT_PaintFormat): Update paint format identifiers after a specification change. The specification was updated to have sibling formats, variable and non-variable variants for each. Reflect that here. * sfnt/ttcolr.c (read_paint): Remove parsing of variable indices as the non-variable formats no longer have them.
Werner Lemberg 7849316c 2021-02-13T09:21:37 * src/tools/update-copyright-year: Fix single-year entry handling. The fix from 2021-01-17 didn't cover the case where the year to be updated is identical to the current year.
Werner Lemberg d51452e3 2021-02-13T08:52:58 Add new function `FT_Get_Transform`. See https://github.com/harfbuzz/harfbuzz/issues/2428 for some reasons to introduce this function. * include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform): Implement it.
Alexei Podtelezhnikov 70fd20e6 2021-02-12T19:28:05 Decorate qsort callbacks with cdecl. * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Add new macro. * src/base/ftrfork.c, src/bdf/bdflib.c, src/gxvalid/gxvcommn.c, src/psaux/afmparse.c, src/psnames/psmodule.c, src/type1/t1afm.c, src/sfnt/sfwoff.c, src/sfnt/sfwoff2.c: Update qsort callbacks. Fixes #1026 when compiling FreeType with an unusual calling convention while the C library qsort still expects cdecl.
Dominik Röttsches 54c5ad5c 2021-02-10T19:24:13 [sfnt] Implement 'COLR' v1 sweep gradients. * freetype.h (FT_PaintSweepGradient): Add `FT_PaintSweepGradient` to represent a 'COLR' v1 sweep gradient. Update format. (FT_PaintFormat): Update shifted paint formats. Sync with spec. * sfnt/ttcolr.c (read_paint): Logic to parse sweep gradients. Fix struct access in radial gradient implementation.
Dominik Röttsches 64f01bfe 2021-01-20T13:04:50 [sfnt] Provide optional root transform for 'COLR' v1 glyph graph. * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): Additional function argument root_transform to control whether root transform should be returned. (FT_OpaquePaint): Additional tracking field to denote whether root transform is to be returned. * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func): Propagate additional argument. * src/base/ftobjs.c (FT_Get_Color_Glyph_Paint): Ditto. * src/sfnt/ttcolr.c (tt_face_get_colr_glyph_paint): Return root transform reflecting the size and tranform configured on FT_Face. (read_paint): Initialize and track status of insert_root_transform flag.
Werner Lemberg 947e4752 2021-02-04T10:19:26 [base] Fix Netpbm tracing message. * src/base/ftobjs.c (FT_Render_Glyph_Internal): Don't emit Netpbm warning if there is nothing to output.
Werner Lemberg d924a66a 2021-02-04T07:44:06 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. This ensures good logging output, with all lines having a proper prefix (if requested). This is a continuation of a similar patch from 2020-12-02, which missed some locations.
Werner Lemberg 0636dc8a 2021-02-03T19:16:02 [psaux] Fix integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30154 * src/psaux/psblues.c (cf2_blues_capture): Use `SUB_INT32`.
Werner Lemberg 324612ce 2021-01-31T14:28:44 Always provide logging API. It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to modify `ftexport.sym` conditionally. Problem reported by Alexei. * src/base/ftdebug.c: Include `ftlogging.h`. (FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler, FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs.
Alexei Podtelezhnikov 7ae5609d 2021-01-27T16:08:08 * src/base/ftstroke.c (FT_Stroker_EndSubPath): Ignore tiny gaps. Fixes bug #1020.
Alexei Podtelezhnikov 4c3bd2ab 2021-01-27T15:54:34 [stroker] Minor clean-up. * src/base/ftstroke.c (FT_Stroker_{ConicTo,CubicTo}): Reset the last line length. (FT_Stroker_EndSubPath): Call `ft_stroker_process_corner'.
Alexei Podtelezhnikov b594cd90 2021-01-19T07:35:38 * srd/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix return value.
Nikolaus Waxweiler f1f9705f 2021-01-15T23:52:04 [afshaper] Fix hb_ot_tags_from_script deprecation warning. * autofit/afshaper.c (af_shaper_get_coverage): Copy the source code of the function as suggested in https://github.com/harfbuzz/harfbuzz/issues/2737 and adjust to handle at most three tags.
Werner Lemberg d35c7f7c 2021-01-17T08:44:00 * src/tools/update-copyright-year: Fix single-year entry handling.
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Werner Lemberg 4278ee6c 2021-01-17T07:16:26 no-copyright: Updated.
Werner Lemberg ba1a6acf 2021-01-15T10:09:00 [sfnt] Additional checks for 'colr' table presence. * sfnt/ttcolr.c (tt_face_get_colr_glyph_paint, tt_face_get_colorline_stops, tt_face_get_paint): Additional checks for whether colr table is present. Prevents crashes when these methods are called on non-COLR fonts.
Dominik Röttsches 4b58cf47 2020-12-16T17:18:56 [base] Fill 'COLR' v1 API templates to make them work (#59703). * src/base/ftobjs.c (FT_Get_Color_Glyph_Paint, FT_Get_Paint_Layers, FT_Get_Paint, FT_Get_Colorline_Stops): Add basic sanity checks, check for existence of `FT_Face`, check arguments and delegate calls for the respective 'COLR' v1 API to the SFNT driver.
Dominik Röttsches d3e95d97 2020-12-16T17:12:30 [sfnt] Register 'COLR' v1 API in driver (#59703). * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func, TT_Get_Paint_Layers_Func, TT_Get_Colorline_Stops_Func, TT_Get_Paint_Func): New function pointer types. (SFNT_Interface): Add them. (FT_DEFINE_SFNT_INTERFACE): Updated. * src/sfnt/sfdriver.c (PUT_COLOR_LAYERS_V1): New macro. (sfnt_interface): Add new function pointers.
Dominik Röttsches 6260b490 2020-12-16T17:06:42 [sfnt] Add 'COLR' v1 API to retrieve color layers (#59703). * src/sfnt/ttcolr.c (tt_face_get_paint_layers): New function to get the layers of a `PaintColrLayers` table in the font, using an `FT_LayerIterator` from an `FT_PaintColrLayers` object retrieved via `tt_face_get_paint`. * src/sfnt/ttcolr.h: Updated.
Dominik Röttsches be06a9d0 2020-12-16T17:02:22 [sfnt] Add 'COLR' v1 API to iterate color stops (#59703). * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): New function to return the current `FT_ColorStop` object from `FT_ColorStopIterator`. Also increment the iterator. * src/sfnt/ttcolr.h: Updated.
Dominik Röttsches cdad4db4 2020-12-16T16:52:24 [sfnt] Add API to get actual paint from `FT_OpaquePaint` (#59703). * src/sfnt/ttcolr.c (tt_face_get_paint): New function to resolve an `FT_OpaquePaint` paint reference into an `FT_COLR_Paint` object of a certain format, which contains the detailed information stored in a paint of the respective format. (read_paint): New function to provide the format specific parsing and to populate the data members of each specific `FT_COLR_Paint` subtype. (read_color_line): New function to parse retrieved color line information into an `FT_ColorLine` object, which has information about the color line extend mode as well as an `FT_ColorStopIterator` object. * src/sfnt/ttcolr.h: Updated.
Dominik Röttsches 9e422b67 2020-12-16T16:44:34 [sfnt] Add API to retrieve 'COLR' v1 root paint (#59703). * src/sfnt/ttcolr.c (BaseGlyphV1Record): New structure. (tt_face_load_colr): Handle version 1 table header. (find_base_glyph_v1_record): New auxiliary function. (tt_face_get_colr_glyph_paint): New function to find the root `FT_OpaquePaint` object for a given glyph ID. * src/sfnt/ttcolr.h: Updated.
Dominik Röttsches 08dba4dc 2020-12-16T16:14:19 Add new methods required for 'COLR' v1 to public API (#59703). * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): New method for retrieving the root paint object for a color glyph by specifying a glyph ID. (FT_Get_Paint_Layers): New method for retrieving the layers of a `PaintColorGlyph`. (FT_Get_ColorLine_Stops): New method for retrieving the stops of a color. (FT_Get_Paint): New method for resolving an `FT_OpaquePaint` into an `FT_COLR_Paint` object.
Werner Lemberg cbc14b10 2021-01-07T10:13:15 Fix ABI incompatibility. * include/freetype/ftimage.h (FT_Pixel_Mode): Don't insert `FT_PIXEL_MODE_GRAY16' but append it. * src/base/ftobjs.c (pixel_modes): Updated.
Alexei Podtelezhnikov 6369058e 2021-01-07T00:13:23 [dlg] Move the headers to include/dlg to simplify their use. * autogen.sh, builds/toplevel.mk: Copy headers to incluide/dlg. * builds/freetype.mk, builds/windows/vc2010/freetype.vcxproj: Simplify included path. * include/freetype/internal/ftdebug.h: Simplify #include. * src/dlg/rules.mk, .gitignore: Updated.
Werner Lemberg 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.
Werner Lemberg b6c8542d 2020-12-26T08:51:46 * src/base/ftobjs.c (pixel_modes): Updated.
Anuj Verma 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.
Werner Lemberg 286e9e0d 2020-12-24T08:41:12 [sdf] Two more copyright notices.
Werner Lemberg 3c983eb8 2020-12-24T08:36:09 [sdf] Fix `make multi`. * src/sdf/ftsdf.c: Include `ftoutln.h`.
Werner Lemberg 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.
Werner Lemberg 04a64432 2020-12-24T08:29:05 [sdf] Add copyright notices.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma a2113475 2020-08-20T21:21:33 [sdf] Add function to copy SDF data into output bitmap. * src/sdf/ftbsdf.c (finalize_sdf): New function.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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).
Anuj Verma c918b54f 2020-08-18T10:28:16 [sdf] Add function to resolve corner distances. * src/sdf/ftsdf.c (resolve_corner): New function.
Anuj Verma 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.
Anuj Verma b298a644 2020-08-21T04:59:08 [sdf] Add debugging function. * src/sdf/ftsdf.c (sdf_shape_dump): New function.
Anuj Verma 6444875f 2020-08-21T03:59:23 [sdf] Add brief technical overview of both rasterizers.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 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.
Anuj Verma 3b9196c4 2020-08-16T09:06:59 [base] Allow renderers of different formats. * 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`.
Tatsuyuki Ishi 0d5f1dd3 2020-12-18T22:10:30 [autofit] Fix double division in stem darkening. 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.
Chris Liddell f6be9276 2020-12-16T06:03:10 [truetype] Fix incremental metrics (#59503). * 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.
Werner Lemberg a3edbfa9 2020-12-14T16:11:06 [type42] Pacify static analysis tools (#59682). * src/type42/t42objs.c (T42_Size_Init, T42_GlyphSlot_Init): Avoid warnings about uninitialized variables.
Werner Lemberg 272ae5ee 2020-12-07T10:29:24 * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.
Werner Lemberg 015a9b8d 2020-12-07T10:27:42 */*: s/FT_LOGGING/FT_DEBUG_LOGGING/.
Werner Lemberg a6adb256 2020-12-02T14:15:07 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. This ensures good logging output, with all lines having a proper prefix (if requested).
Werner Lemberg 74822f64 2020-12-02T08:32:37 [base] Don't close 'stderr' after logging. * src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit): Fix it.
Werner Lemberg 92db149e 2020-12-02T07:54:21 * src/bdf/bdflib.c: Fix `-Wformat` warning.
Werner Lemberg 1c229af2 2020-12-01T22:13:40 [dlg] Fix compiler warnings. * src/dlg/dlgwrap.c: Duplicate some feature test macros from `dlg.c`, which must come first before loading standard headers. For example, `freetype.h` loads `stdio.h` if compiled in debug mode.
Werner Lemberg 76915880 2020-12-01T15:43:11 * src/type42/t42parse.c: Fix `-Wformat` warnings.