summaryrefslogtreecommitdiff
path: root/src/autofit
Commit message (Collapse)AuthorAgeFilesLines
* Minor compiler warning fixes.Werner Lemberg2023-05-082-2/+2
| | | | | | | * src/autofit/afcjk.c (af_cjk_get_standard_widths), src/autofit/aflatin.c (af_latin_get_standard_widths): Use `FT_CALLBACK_DEF`. * src/cff/cffparse.c (cff_parser_run): Initialize and fix allocation of `q`.
* [autofit] Signature fixes.Werner Lemberg2023-05-079-59/+88
|
* s/this is,/that is,/Werner Lemberg2023-04-273-5/+5
|
* * src/*: Replace leading underscores with trailing ones in dummy variables.Werner Lemberg2023-02-261-1/+1
| | | | This is to avoid clang warnings.
* [autofit] Clean up contour indexing.Alexei Podtelezhnikov2023-02-202-18/+13
| | | | | * src/autofit/aflatin.c (af_latin_metrics_init_blues): Refactor. * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Ditto.
* [autofit] Fix 'multi' compilation.Werner Lemberg2023-02-083-5/+26
| | | | | | | | | | * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`. Add ANSI boilerplate code for otherwise empty file. * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`. Use `FT_BEGIN_HEADER` and `FT_END_HEADER`. Decorate with `FT_LOCAL`. * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
* Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags.Werner Lemberg2023-02-083-3/+3
|
* For debugging, avoid implicit conversion from integer to double.Werner Lemberg2023-02-083-55/+64
| | | | | | | | | | Otherwise we get zillions of clang 15 warnings. * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c, src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c, src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use `double` cast in debugging and tracing macros.
* Avoid reserved identifiers that are globally defined.Werner Lemberg2023-02-086-22/+22
| | | | | | | | | | | This is mandated by the C99 standard, and clang 15 produces zillions of warnings otherwise. * devel/ftoption.h, include/freetype/config/ftoption.h, include/freetype/internal/ftmemory.h, src/autofit/afhints.h, src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
* Update all copyright notices.Werner Lemberg2023-01-1735-35/+35
|
* sr/*.c: Various minor fixes.Werner Lemberg2023-01-161-1/+2
| | | | | | | | | | | | | | | | * src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after variable declarations. * src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate unused variable. * src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++ compiler. * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid compiler warning. * src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
* * src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes.Werner Lemberg2023-01-071-2/+3
|
* [autofit] Don't depend on 'hb-ft'.Matthias Clasen2023-01-065-2/+144
| | | | | | | | | | | | | | | | The circular dependency is still there, but at least we no longer depend on the HarfBuzz API that is only present if HarfBuzz has been built with FreeType support, making the bootstrapping a bit easier. * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing `_hb_ft_font_create`, which is more or less a verbatim copy of the corresponding HarfBuzz code from file `hb-ft.cc`. * src/autofit/afglobal.c (af_face_globals_new): Use it. * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`. * src/autofit/autofit.c: Include `ft-hb.c`. * LICENSE.TXT: Updated.
* * src/autofit/afloader.c (af_loader_load_glyph): Remove `size` check.Alexei Podtelezhnikov2022-11-201-6/+1
| | | | This is done by `FT_Load_Glyph`.
* * src/autofit/afloader.c (af_loader_load_glyph): Fix dereference.Johan Matsson2022-11-161-1/+3
| | | | | | | | This must happen after the NULL check. Taken from https://github.com/freetype/freetype/pull/2
* Replace '1/64th' (and similar entries) with '1/64' in docs and comments.Werner Lemberg2022-10-241-7/+7
|
* [autofit] Reset the face charmap directly.Alexei Podtelezhnikov2022-10-034-5/+4
| | | | | | | | | There is no need to validate the original charmap in `FT_Set_Charmap`. It can be reset directly. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Use direct assignment. * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto.
* [autofit] Minor fix.Werner Lemberg2022-09-051-1/+1
| | | | | * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid compiler warning.
* [autofit] Updated to reduce casting (cont'd).Alexei Podtelezhnikov2022-08-013-16/+13
| | | | | | | * src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Remove casting. * src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly.
* [autofit] Updated to reduce casting.Alexei Podtelezhnikov2022-08-013-20/+20
| | | | | | | | * src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage, af_face_globals_get_metrics, af_face_globals_is_digit, af_face_globals_new): Changed local types and updated accordingly. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto.
* [autofit] Use unsigned accounting for hints.Alexei Podtelezhnikov2022-07-294-16/+16
| | | | | | | | | | * src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types. * src/autofit/afhints.c (af_axis_hints_new_{segment,edge}, af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset): Updated accordingly. * src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto. * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto.
* * src/autofit/afhints.h: Remove dead code.Alexei Podtelezhnikov2022-07-291-5/+0
|
* * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.Alexei Podtelezhnikov2022-01-181-3/+5
| | | | | Everything in AF_FaceGlobals is initialized except metrics. Those are zeroed here and initialized on demand later.
* Update all copyright notices.Werner Lemberg2022-01-1135-35/+35
|
* [autofit, pshinter] Use `FT_OFFSET`.Werner Lemberg2022-01-073-13/+13
| | | | | | | | | | | | | | | | | | | | | | | This avoids ``` runtime error: applying zero offset to null pointer ``` warnings of clang's undefined behaviour sanitizer. * src/autofit/afcjk.c (af_cjk_hints_link_segments, af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges, af_cjk_hint_edges, af_cjk_align_edge_points): Do it. * src/autofit/afhints.c (af_glyph_hints_align_edge_points, af_glyph_hints_align_strong_points): Ditto. * src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_hints_link_segments, af_latin_hints_compute_edges, af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto. * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto.
* * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting.Alexei Podtelezhnikov2021-09-301-9/+9
|
* Cosmetic zeros.Alexei Podtelezhnikov2021-09-022-2/+2
|
* [autofit] Split `afwrtsys.h`.Ben Wagner2021-07-245-34/+47
| | | | | | | | | | | | | | | | | | | | | | | | | The header file `afwrtsys.h` has two distinct functions: to include the required writing system headers and also to generate code for each writing system. At each current use site only one or the other is used, with various macro trickery selecting one or the other. Split this header into `afws-decl.h` for the required writing system declarations and `afws-iter.h` for iterating over the writing systems to generate code. The motivation for this change is that the Visual C++ compiler treats the standard include guard idiom like `#pragma once` 'if no non-comment code or preprocessor directive comes before or after the standard form of the idiom'. It appears to check this after macro expansion, so if `WRITING_SYSTEM` expands to empty the bottom of `afwrtsys.h` is empty and looks like the standard include guard idiom which is treated like `#pragma once`, so subsequent inclusion of `afwrtsys.h` is elided. Fixes #1075. * src/autofit/afglobal.c (af_writing_system_classes), src/autofit/aftypes.h (AF_WritingSystem), src/autofit/rules.mk (AUTOF_DRV_H): Updated. * src/autofit/afwrtsys.h: Split into... * src/autofit/afws-decl.h, src/autofit/afws-iter.h: New files.
* [autofit] More clean-ups.Werner Lemberg2021-07-123-8/+2
| | | | | | | | * src/autofit/afhints.h (AF_GlyphHintsRec): Remove the no longer needed fields `xmin_delta` and `xmax_delta`. * src/autofit/afhints.c (af_glyph_hints_reload), src/autofit/afloader.c (af_loader_load_glyph): Updated.
* Remove obsolete AF_Angle type and related sources.David Turner2021-07-126-352/+99
| | | | | | 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.
* Remove experimental auto-hinting 'warp' mode.David Turner2021-07-1212-606/+0
| | | | | | | 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.
* Remove experimental "Latin2" writing system (FT_OPTION_AUTOFIT2)David Turner2021-07-126-2497/+0
| | | | | | 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).
* Prevent hinting if there are too many segments.Werner Lemberg2021-06-191-0/+25
| | | | | | | | | | | 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.
* Fix for issue 1063David Turner2021-06-161-0/+4
| | | | | See https://gitlab.freedesktop.org/freetype/freetype/-/issues/1063 for more details on the bug.
* * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix tracing.Werner Lemberg2021-06-021-0/+2
| | | | Problem reported by Alexei.
* Fix compilation errors and (some) warnings for clang++.Werner Lemberg2021-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* [afshaper] Fix hb_ot_tags_from_script deprecation warning.Nikolaus Waxweiler2021-01-171-9/+17
| | | | | | | * 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.
* Update all copyright notices.Werner Lemberg2021-01-1739-39/+39
|
* [autofit] Fix double division in stem darkening.Tatsuyuki Ishi2020-12-182-16/+13
| | | | | | | | | | | | | | | 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.
* * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-071-17/+16
|
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-056-54/+59
| | | | | This ensures good logging output, with all lines having a proper prefix (if requested).
* Downgrade property tracing.Alexei Podtelezhnikov2020-11-201-3/+3
|
* [autofit] Synchronize with ttfautohint.Werner Lemberg2020-09-256-113/+195
| | | | | | | | | | | | | | | | This corresponds to the following commits in the ttfautohint git repository: bb6842bd3bd437b7b4a7921b0376c860f5e73d18 Typo, formatting. d5c91ddb1cb310257a3dfe9a8e20e1fc51335faa Add Medefaidrin script. * src/autofit/afblue.dat: Add blue zone data for Medefaidrin. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Medefaidrin standard characters. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Medefaidrin data.
* Fix `-Wformat' compiler warnings.Priyesh Kumar2020-07-284-35/+35
| | | | | | * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
* Fix clang warnings.Werner Lemberg2020-07-072-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/internal/autohint.h (FT_DECLARE_AUTOHINTER_INTERFACE): New macro. * src/autofit/afmodule.h: Use it to declare `af_autofitter_interface'. * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro. * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and `ft_outline_glyph_class'. * src/base/ftglyph.c: Include `ftbase.h'. * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'. * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'. * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'. * src/psaux/psauxmod.h: Declare `afm_parser_funcs', `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'. * src/pshinter/pshmod.c: Include `pshmod.h'. * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign conversion. (compute_ULong_sum): Fix return type. Fix implicit sign conversion. (store_points): Fix type of `last_flag', `repeat_count', and `flag'. Use casts to avoid warnings. (reconstruct_glyf): Fix implicit sign conversion. Use cast to avoid warning. (get_x_mins): Fix implicit sign conversion. * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'. * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to declare cmap classes. * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast. * src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
* Remove redundant inclusion of `ft2build.h'.Werner Lemberg2020-06-138-8/+0
| | | | | | | * */*: Remove `#include <ft2build.h>' where possible. * include/freetype/freetype.h: Remove cpp error about missing inclusion of `ft2build.h'.
* Make macros for header file names optional.David Turner2020-06-0812-24/+24
| | | | | | | | | | | | | | | | | We no longer have to take care of the 8.3 file name limit; this allows us (a) to introduce longer, meaningful file names, and (b) to avoid macro names in `#include' lines altogether since some compilers (most notably Visual C++) doesn't support this properly. */*: Replace #include FOO_H with #include <freetype/foo.h> or something similar. Also update the documentation.
* Remove Jamfile files from the tree.David Turner2020-05-181-53/+0
| | | | | | | | These have not been used in a very, very long time, so better remove them. A corresponding patch will be submitted to the `freetype2-demos' repository. * src/Jamfile, src/*/Jamfile, Jamrules: Delete.
* [autofit] Add support for Hanifi Rohingya script.Nikolaus Waxweiler2020-02-196-41/+93
| | | | | | | | | | * src/autofit/afblue.dat: Add blue zone data for Hanifi Rohingya. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Hanifi Rohingya standard character. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Hanifi Rohingya data.
* Update all copyright notices.Werner Lemberg2020-01-1940-40/+40
|