src/autofit/afhints.h


Log

Author Commit Date CI Message
Werner Lemberg 563ae780 2017-01-04T20:16:34 Update copyright year.
Werner Lemberg 894c0228 2016-07-15T10:23:11 [autofit] For edges, reject segments wider than 1px (#41334). * src/autofit/afhints.h (AF_SegmentRec): New member `delta'. * src/autofit/aflatin.c (af_latin_hints_compute_segments): Compute `delta'. (af_latin_hints_compute_edges): Reject segments with a delta larger than 0.5px.
Werner Lemberg 8b8c4408 2016-07-02T18:35:50 [autofit] Remove unused structure members. * src/autofit/afhints.h (AF_SegmentRec, AF_EdgeRec): Remove `num_linked'. * src/autofit/afcjk.c (af_cjk_hints_link_segments): Updated.
Werner Lemberg 709486db 2016-03-20T22:20:32 [autofit] Show `near' points in tracing. * src/autofit/afhints.h (AF_FLAG_NEAR): New macro. * src/autofit/afhints.c (af_glyph_hints_dump_points): Implement it. (af_glyph_hints_reload): Handle AF_FLAG_NEAR.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg 37412ff9 2016-01-12T21:37:13 Don't use macro names that contain `__' [1/2]. Such macro names are reserved for both C and C++. */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
Werner Lemberg 2e09812c 2015-12-25T08:05:30 [autofit] Make top-to-bottom hinting work in latin auto-hinter. This improves rendering of scripts like Bengali or Devanagari. * src/autofit/afhints.c (af_axis_hints_new_edge): Add parameter to pass top-to-bottom hinting flag. This makes the function sort edges in descending vertical position. * src/autofit/afhints.c: Updated. * src/autofit/aflatin.c (af_latin_hints_compute_edges, af_latin_hint_edges): Use `top_to_bottom_hinting' flag. * src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/autofit/aflatin2.c (af_latin2_hints_compute_edges): Updated.
Werner Lemberg 12661a5a 2015-04-21T07:13:59 [autofit] Introduce `warping' property. This code replaces the debugging hook from the previous commit with a better, more generic solution. * include/ftautoh.h: Document it. * src/autofit/afmodule.h (AF_ModuleRec) [AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field. * src/autofit/afmodule.c (_af_debug_disable_warper): Remove. (af_property_set, af_property_get, af_autofitter_init) [AF_CONFIG_OPTION_USE_WARPER]: Handle `warping' option. * src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no longer existing `_af_debug_disable_warper'. * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c (af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init) [AF_CONFIG_OPTION_USE_WARPER]: Add `AF_SCALER_FLAG_NO_WARPER' to the scaler flags if warping is off. * src/autofit/aftypes.h: Updated.
Werner Lemberg 58f48f0d 2015-04-16T20:11:49 [autofit] Add debugging hook to disable warper. * src/autofit/afmodule.c (_af_debug_disable_warper) [FT_DEBUG_AUTOFIT]: New global variable. * src/autofit/aftypes.h: Updated. (AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet). * src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro. * src/autofi/aflatin.c (af_latin_hints_apply) [AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use of warper. * src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply) [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. * src/autofit/aflatin2.c (af_latin2_hints_apply) [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'.
Werner Lemberg bd133c35 2015-03-01T07:45:36 Minor typo.
Werner Lemberg 81e5ff53 2015-02-19T09:46:48 [autofit] Use macros for (unsigned) flags, not enumerations. This harmonizes with other code in FreeType (and reduces the number of necessary casts to avoid compiler warnings). * src/autofit/afblue.hin: Make flag macros unsigned. * src/autofit/afblue.h: Regenerated. * src/autofit/afcjk.h: Replace flag enumeration with macros. * src/autofit/afcjk.c: Updated. * src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with macros. * src/autofit/afhints.c: Updated. * src/autofit/aflatin.h: Replace flag enumerations with macros. * src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated. * src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Behdad Esfahbod 56ddafa0 2015-01-14T19:36:02 [autofit] Add embedded array of segments and edges. Avoids multiple mallocs per typical glyphs. With this and recent changes to avoid mallocs, the thread-safe stack-based loader is now as fast as the previous model that had one cached singleton. * src/autofit/afhints.h (AF_SEGMENTS_EMBEDDED, AF_EDGES_EMBEDDED): New macros. (AF_AxisHintsRec): Add two arrays for segments and edges. * src/autofit/afhints.c (af_axis_hints_new_segment): Only allocate data if number of segments exceeds given threshold value. (af_axis_hints_new_edge): Only allocate data if number of edges exceeds given threshold value. (af_glyph_hints_done): Updated.
Behdad Esfahbod 6f16b100 2015-01-14T19:26:49 [autofit] Add embedded arrays for points and contours. This avoids at least two malloc calls for typical glyphs. * src/autofit/afhints.h (AF_POINTS_EMBEDDED, AF_CONTOURS_EMBEDDED): New macros. (AF_GlyphHintsRec): Add two arrays for contours and points. * src/autofit/afhints.c (af_glyph_hints_init, af_glyph_hints_done): Updated. (af_glyph_hints_reload): Only allocate data if number of contours or points exceeds given threshold values.
Werner Lemberg 5b68e4fb 2014-09-24T19:06:13 [autofit] Minor clean-ups. * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values. * src/autofit/afhints.c (af_glyph_hints_dump_points, af_glyph_hints_align_strong_points): Updated. * src/autofit/aflatin.c (af_latin_hints_link_segments, af_latin_hints_compute_segments), src/autofit/afcjk.c (af_cjk_hints_link_segments), src/autofit/aflatin2.c (af_latin2_hints_link_segments, af_latin2_hints_compute_segments): There are no longer fake segments since more than 10 years...
Werner Lemberg 63bef9a5 2014-05-01T07:16:05 [autofit] Fix handling of neutral blue zones in stems. * src/autofit/afhints.h (AF_Edge_Flags): New value `AF_EDGE_NEUTRAL'. * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace neutral blue zones with AF_EDGE_NEUTRAL. (af_latin_hint_edges): Skip neutral blue zones if necessary.
Werner Lemberg 8a94b1ef 2014-04-12T20:44:33 [autofit] Redesign the recognition algorithm of strong points. In particular, local extrema without horizontal or vertical segments are better recognized: + A + D \ / \ / \ / \ / \ + C \ / B +/ If the distances AB and CD are large, point B wasn't previously detected as an extremum since the `ft_corner_is_flat' function `swallowed' BC regardless of its direction, tagging point B as weak. The next iteration started at B and made `ft_corner_is_flat' swallow point C, tagging it as weak also, et voilà. To improve that, another pass gets now performed before calling `ft_corner_is_flat' to improve the `topology' of an outline: A sequence of non-horizontal or non-vertical vectors that point into the same quadrant are handled as a single, large vector. Additionally, distances of near points are now accumulated, which makes the auto-hinter handle them as if they were prepended to the next non-near vector. This generally improves the auto-hinter's rendering results. * src/autofit/afhints.c (af_glyph_hints_reload): Implement it. * src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag `AF_FLAG_NEAR'.
Werner Lemberg 974b193b 2013-12-20T17:26:26 [autofit] Introduce `styles'. This is the new top-level structure for handling glyph input data; scripts are now defined separately. * src/autofit/aftypes.h (SCRIPT): Updated. (AF_ScriptClassRec): Move `blue_stringset' and `writing_system' members to ... (AF_Style_ClassRec): ... this new structure. (AF_Style): New enumeration. (AF_StyleMetricsRec): Replace `script' enumeration with `style_class' pointer. (AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated. (AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros. * src/autofit/afstyles.h: New file, using data from `afscript.h'. * src/autofit/afscript.h: Updated. * src/autofit/afcjk.c (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated. * src/autofit/afglobal.c (SCRIPT): Updated. (STYLE): Redefine macro to load `afstyles.h'. (af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with... (af_style_names): ... this array. (af_face_globals_compute_script_coverage): Renamed to... (af_face_globals_compute_style_coverage): ... this. Updated. (af_face_globals_new, af_face_globals_free, af_face_globals_get_metrics): Updated. * src/autofit/afglobal.h (SCRIPT): Updated. (STYLE): Redefine macro to load `afstyles.h'. (AF_SCRIPT_FALLBACK): Update definition. This will get more refinements with later on. (AF_SCRIPT_UNASSIGNED): Replace with... (AF_STYLE_UNASSIGNED): ... this macro. (AF_FaceGlobalsRec): Updated. * src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_metrics_init_blues, af_latin_metrics_scale_dim, af_latin_hint_edges): Updated. * src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated. (af_ltn2_uniranges): Removed. * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): Updated. * src/autofit/afpic.c (autofit_module_class_pic_init): Updated. * src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro. (AFModulePIC): Add `af_style_classes' and `af_style_classes_rec' members. * src/autofit/afranges.h: Updated. * src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
Werner Lemberg 3f91cb33 2013-12-18T12:59:35 [autofit] s/ScriptMetrics/StyleMetrics/.
Werner Lemberg cc25e3ae 2013-08-05T08:46:15 [autofit] Improve handling of `near' points. Points which are very near to each other are now marked as such. The `weak' flag is then computed by using the `in' vector of the first and the `out' vector of the last point of a group of near points. For example, this fixes the rendering of glyph `Oslash' in `Roboto-Thin.ttf'. * src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'. * src/autofit/afhints.c (af_glyph_hints_reload): Introduce the heuristic value `near_limit' to decide whether the current point is near to the previous one, then set `AF_FLAG_NEAR' accordingly. Store good `in' vector (of last non-near point) in `last_good_in_{x,y}' and use it as an argument to `ft_corner_is_flat' if necessary.
Werner Lemberg b8bf8b54 2013-08-04T09:25:24 [autofit] Update comments.
Werner Lemberg b6978dd0 2012-07-06T19:38:44 [autofit] Do some code cleanup. * src/autofit/afglobal.c (af_face_globals_new): Simplify. * src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf' everywhere. (FT_COMPONENT): New macro. (af_glyph_hints_done): Simplify. * include/freetype/internal/fttrace.h: Updated.
Werner Lemberg 58d1a5ee 2011-06-08T09:32:56 [autofit] Remove unused structure member. * src/autofit/afhints.h (AF_SegmentRec): Remove `contour'. * src/autofit/aflatin.c (af_latin_hints_compute_segments), src/autofit/aflatin2.c (af_latin2_hints_compute_segments): Updated.
Werner Lemberg d503b1bc 2011-04-18T19:05:28 Integrate autofitter debugging stuff. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_DEBUG_AUTOFIT): New macro. * include/freetype/internal/fttrace.h: Add trace components for autofitter. * src/autofit/aftypes.h (AF_LOG): Removed. (_af_debug): Removed. * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/. s/AF_LOG/FT_TRACE5/. Define FT_COMPONENT where necessary.
Werner Lemberg 576fc2c0 2011-03-02T03:52:36 Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper. * devel/ftoption.h, include/freetype/config/ftoption.h (AF_CONFIG_OPTION_USE_WARPER): New macro. * src/autofit/aftypes.h (AF_USE_WARPER): Remove. * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/. * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy variable assignment with a typedef.
Werner Lemberg f42cc539 2011-02-24T05:18:46 * src/autofit/afhints.h (AF_GlyphHints): Remove unused field.
Werner Lemberg 6af02423 2011-02-22T10:29:30 [autofit] Add ASCII drawing for better explanation.
Werner Lemberg c5bda503 2011-02-16T21:59:44 [autofit] Add a lot of comments and do some minor formatting.
Werner Lemberg 09344385 2010-05-22T07:43:22 autofit: Remove dead code. Suggested by Graham. * src/autofit/afhints.c (af_glyph_hints_compute_inflections): Removed. (af_glyph_hints_reload): Remove third argument. Update all callers.
Werner Lemberg 2b0b4221 2008-05-28T22:17:28 Cosmetic code changes.
David Turner b792017f 2007-06-11T05:37:35 experimental changes for the Latin auto-hinter. note that the new code is disabled by default.
Werner Lemberg bf24176b 2007-01-26T16:08:49 formatting
David Turner d91eebda 2007-01-26T15:05:41 improvement to glyph spacing, especially when light auto-hinting
Werner Lemberg 960ba59a 2006-12-01T08:20:47 * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are encoded in UTF-16BE. Patch from Rajeev Pahuja <rpahuja@esri.com>. (tt_name_entry_ascii_from_ucs4): Removed. * include/freetype/ftxf86.h: Fix and extend comment so that it appears in the documentation. * include/freetype/ftchapters.h: Add `font_format' section. * src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link to TOC in index page. Formatting.
David Turner 81e725f5 2006-11-23T14:49:48 * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c, src/autofit/aftypes.h: Misc. auto-hinter improvements
Werner Lemberg 111b5aef 2006-11-03T09:40:12 * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'. Formatting
David Turner 40604748 2006-11-02T16:37:35 - fixed a bug in af_compute_direction which generated ugly glyphs - added more debug/log messages to help improve the auto-fitter
Werner Lemberg 110246c6 2006-09-26T21:55:44 formatting
David Turner 6f8c6229 2006-09-26T15:42:44 * src/autofit/aftypes.h, src/autofit/afhints.h, src/autofit/afmodule.c: adding support for disabling horizontal and vertical hinting for the purpose of debugging the auto-fitter
Werner Lemberg d1d4bffe 2006-02-10T22:15:22 formatting
Wu, Chia-I (吳佳一) 4cdb45c0 2006-02-09T14:17:04 Introduce experimental autofit CJK module based on akito's autohint patch. You need to #define AF_MOD_CJK in afcjk.c to enable it. * src/autofit/afglobal.c, src/autofit/afcjk.h, src/autofit/afcjk.c, src/autofit/rules.mk, src/autofit/autofit.c, src/autofit/aftypes.h: Add CJK module based on akito's autohint patch. * src/autofit/afhints.h (AF_SegmentRec): New field `len' for the overlap length of the segments. (AF_SEGMENT_LEN, AF_SEGMENT_DIST): New macros. * src/autofit/aflatin.h (af_latin_metrics_init_widths), src/autofit/aflatin.c (af_latin_metrics_init_widths): Made `FT_LOCAL'. Use the character given by the caller. (af_latin_metrics_init_widths, af_latin_hints_link_segments): Scale the thresholds. * src/autofit/afloader.c (af_loader_load_g): Respect AF_SCALER_FLAG_NO_ADVANCE.
Werner Lemberg 1be9ebf5 2006-01-22T06:58:16 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add afwarp.c. Formatting, copyright notices, copyright years.
David Turner bb4edc92 2006-01-21T14:31:45 * src/autofit/aflatin.c, src/autofit/afwarp.h, src/autofit/afwarp.c, src/autofit/aftypes.h, src/autofit/afloader.c, src/autofit/autofit.c: adding experimental implementation of "warp hinting" (new hinting algorithm for gray-level and LCD rendering). It is disabled by default, you need to #define AF_USE_WARPER in aftypes.h to enable it.
Werner Lemberg baa662bb 2005-03-03T23:05:29 * src/base/ftutil.c: Include FT_INTERNAL_OBJECTS_H.
Werner Lemberg f13516c8 2005-03-03T17:09:08 Various fixes for C and C++ compiling. * src/autofit/*: Add copyright messages. Formatting. * src/autofit/afhints.c (af_glyph_hints_done): Don't use `AF_Dimension' but `int' for loop counter. * src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use `AF_Dimension' but `int' for loop counter. Use proper enumeration value for `render_mode'. (af_latin_metrics_scale_dim): Don't shadow variables. (af_latin_hints_compute_segments): Use proper cast for `major_dir' and `segment_dir'. (af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to `af_latin_compute_stem_width'. (af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop counter. * src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use proper cast for memory allocation. * src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for initialization of `sfnt'. * src/sfnt/sfdriver.c: Include `ttkern.h'. * src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables. * src/truetype/ttgload.c: Include `ttpload.h'. * src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]: Remove redundant variable.
David Turner b9c22aff 2005-03-01T15:48:29 * src/autofit/{afhints.h,afhints.c,aflatin.h,aflatin.c,afloader.c}: various bug-fixes and drastic heap usage reduction improvements. * include/freetype/config/ftmodule.h: the auto-fitter is now the only supported auto-hinting module * include/freetype/config/ftstdlib.h: adding FT_INT_MAX definition
David Turner 6a487b59 2005-02-28T22:09:07 * src/base/ftdbgmem.c (FT_DumpMemory): added sorting of memory sources according to decreasing maximum cumulative allocations. * include/freetype/internal/tttypes.h, src/sfnt/ttsbit.c, src/sfnt/ttsbit0.c, src/truetype/ttobjs.c, src/cff/cffobjs.c, src/sfnt/sfobjs.c: implementing new heap-optimized embedded bitmap loader. This one also fixes bug #12107 * src/sfnt/sfobjs.c: fixed bug that prevented loading SFNT fonts without a 'kern' table.
David Turner e664efad 2004-06-04T17:41:59 * src/autofit/*: important fixes to the auto-fitter. The output now seems to be 100% equivalent to the auto-hinter, while being about 2% faster (which proves that script-specific algorithm selection isn't a performance problem). to test it, change "autohint" to "autofit" in <freetype/config/ftmodule.h> and recompile. a few more testing is needed before making this the official auto-hinting module
Werner Lemberg 8bb07e63 2004-03-27T08:43:17 Add vertical phantom points. * include/freetype/internal/tttypes.h (TT_LoaderRec): Add `top_bearing', `vadvance', `pp3, and `pp4'. * src/autofit/afloader.c (af_loader_load_g): Handle two more points. * src/autohint/ahhint.c (ah_hinter_load): Handle two more points. * src/truetype/ttgload.c (Get_VMetrics): New function. (TT_Load_Simple_Glyph, TT_Process_Simple_Glyph): Handle two more points. (load_truetype_glyph): Use Get_VMetrics. Handle two more points. (compute_glyph_metrics): Thanks to vertical phantom points we now can always compute `advance_height' and `top_bearing'. * src/truetype/ttobjs.h (TT_SubglyphRec): Add vertical phantom points. * src/autohint/ahglyph.c (ah_outline_load): Fix allocation of `news'. Converting some files to Unix end-of-line convention.
David Turner 1029ed26 2004-02-23T20:40:30 * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c, src/autofit/afloader.c, src/types.h: grave bugs were fixed. The auto-fitter works, doesn't crashes, but still produces unexpected results !!
David Turner cf2c49c8 2003-12-24T18:42:04 * fixed compilation problems in the cache sub-system * partial updates to src/autofit
David Turner 57ecae22 2003-12-19T21:23:58 new version of the cache sub-system - still under debugging
David Turner ff9d2415 2003-11-23T21:39:51 * src/autofit/*: more updates
David Turner d25ad56d 2003-10-02T21:07:10 * src/autofit/*: adding first sources of the new multi-script "auto-fitter" * include/freetype/ftoutln.h, src/base/ftoutln.c: adding the definition of FT_Outline_Get_Orientation, used to compute the fill orientation of a given glyph outline. * include/freetype/internal/ftserv.h: fixed trivial bug which could crashed the font engine when a cached service pointer was retrieved with FT_FACE_LOOKUP_SERVICE