Commit Graph

241 Commits

Author SHA1 Message Date
Werner Lemberg f216947813 [autofit] Properly handle spikes pointing to the x-axis.
An example that gets better rendered is glyph `uusignTaml' (glyph
index 2286) in font `FreeSerif.ttf' (Version 0412.2263) at 22ppem.

* src/autofit/aflatin.c (af_latin_hints_compute_segments): Properly
handle segments where the last point of the first segment is
identical to the first point in the second one.  This can happen for
malformed fonts or spikes.  We either merge the new segment with the
previous one (both segments point into the same direction), or we
discard the shorter segment if they point into different directions.
2016-02-28 22:48:34 +01:00
Werner Lemberg ce48664579 [autofit] Minor code clean-up.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Change
some local variable names to better differentiate between values
along a segment and values orthogonal to it.
2016-02-27 15:01:49 +01:00
Werner Lemberg ebfd7ce52f [autofit] Improve BOUND action.
In complex glyph shapes, the original logic was too simple to cater
for situations that would actually need something similar to PS Hint
masks.  This fix should alleviate the worst cases.

* src/autofit/aflatin.c (af_latin_hint_edges): Don't allow
complete disappearance of stems.
2016-02-26 08:10:41 +01:00
Werner Lemberg fc11af1ea2 Various minor clang fixes.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
`ch'.

* src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast.

* src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast.

* src/base/fthash.c (hash_num_lookup): Add cast.

* src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast.

* src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out
redundant code.

* src/type1/t1driver.c (t1_get_ps_font_value) <PS_DICT_SUBR>: Add
cast.

* src/type1/t1load.c (parse_subrs): Fix type of `count'.
2016-01-19 19:15:54 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 2e09812c51 [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.
2015-12-25 08:05:30 +01:00
Werner Lemberg 868d5a0eaf * src/autofit/aflatin.c (af_latin_metrics_init_blues): Minor. 2015-12-12 07:28:22 +01:00
Werner Lemberg 4fe3b55d0b [autofit] Restore OpenType feature check.
This was removed while rewriting the HarfBuzz interface.

* src/autofit/afglobal.h (AF_FaceGlobalsRec): Add `hb_buf' field to
hold internal HarfBuzz buffer, needed for feature comparison.

* src/autofit/afglobal.c (af_face_globals_new,
af_face_globals_free): Initialize and destroy `hb_buf'.

* src/autofit/afshaper.c (af_shaper_get_cluster): Compare character
(cluster) with and without applied feature.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix tracing
message.
2015-12-11 08:08:48 +01:00
Werner Lemberg bbe84ed972 [autofit] Remove redundant code.
* src/autofit/aflatin.c (af_latin_metrics_init_widths): Do it.
2015-12-10 09:33:41 +01:00
Werner Lemberg dd305f31f0 [autofit] Thinko.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Don't count
empty blue zones (bug introduced 2015-12-06).
2015-12-09 21:00:33 +01:00
Werner Lemberg 0164d934b6 [autofit] Introduce subscript top blue zones.
This feature is mainly for Khmer: The idea is to avoid a clash
between the top of subscript glyphs and the bottom of normal
baseline glyphs.

This only works for character clusters mapped to multiple glyphs.

* src/autofit/afblue.dat: Add subscript top blue zone for Khmer.

* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_SUB_TOP): New
macro.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.h (AF_LATIN_IS_SUB_TOP_BLUE,
AF_LATIN_BLUE_SUB_TOP): New macros.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle new
blue zone property.
Update tracing messages.
(af_latin_metrics_scale_dim): Handle new blue zone property.
(af_latin_hints_compute_blue_edges): Updated.
2015-12-09 20:04:18 +01:00
Werner Lemberg f02e1df7ac [autofit] Fix tracing message.
* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Display
inactive blue zones also.
2015-12-09 14:45:30 +01:00
Werner Lemberg 24aa9c665e [autofit] Rewrite HarfBuzz interface to support character clusters.
Scripts like Khmer have blue zones that can't be directly
represented by Unicode characters.  Instead, it is necessary to let
HarfBuzz convert character clusters into proper glyph representation
forms, then deriving the blue zone information from the resulting
glyphs.

* src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by...
* src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new
files, providing a new API to access HarfBuzz.

The new API manages a HarfBuzz buffer with `af_shaper_buf_create'
and `af_shaper_buf_destroy'.  The buffer receives a UTF8 encoded
string with function `af_shaper_get_cluster', and the resulting
glyph data (indices, advance widths, vertical offsets) can be
iteratively accessed with function `af_shaper_get_elem'.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
Updated.

* include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/.

* src/autofit/afglobal.c: s/hbshim.h/afshaper.h/.
(af_face_globals_compute_style_coverage): Updated.

* src/autofit/afglocal.h: s/hbshim.h/afshaper.h/.

* src/autofit/autofit.c: s/hbshim.c/afshaper.c/.

* src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC):
Updated.
2015-12-06 18:52:41 +01:00
Werner Lemberg de5999411a [autofit] Prepare forthcoming changes.
This makes it easier to control the commits.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Add dummy
loop.  No functional change.
2015-12-06 18:18:02 +01:00
Werner Lemberg f45c0bf963 [autofit] Use string of standard characters.
This is more flexible; additionally, it would allow character
clusters.

* src/autofit/aftypes.h (SCRIPT, AF_DEFINE_SCRIPT_CLASS): Updated.
(AF_ScriptClassRec): Replace `standard_char[123]' with
`standard_charstring'.

* src/autofit/afscript.h: Replace last three character arguments
of the `SCRIPT' calls with a string parameter, holding the standard
characters (in UTF-8 encoding) separated with spaces.

* src/autofit/afglobal.c, src/autofit/afglobal.h,
src/autofit/afpic.c, src/autofit/afranges.c, src/autofit/hbshim.c
(SCRIPT): Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Updated.
2015-12-06 09:58:18 +01:00
Philipp Knechtges be32b168ac [autofit] Don't distort (latin) glyphs too much (#46195).
* src/autofit/aflatin.h (AF_LatinBlueRec): Add `ascender' and
`descender' fields.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Collect
ascender and descender data for blue zones.
(af_latin_metrics_scale_dim): Reject vertical scaling values that
change the result by more than two pixels.
2015-11-08 08:37:51 +01:00
Nikolaus Waxweiler 37c401ac0a [autofit] Add functions to get standard widths for writing systems.
We need the computed standard horizontal and vertical widths for the
emboldening calculation.  This method provides a convenient way to
extract it from writing-system-specific metrics structures, which
all script definitions must implement.

* src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New
function type.
(AF_WritingSystemClassRec): New member `style_metrics_getstdw'.
(AF_DEFINE_WRITING_SYSTEM_CLASS): Updated.

* src/autofit/afcjk.c (af_cjk_get_standard_width): New function.
(af_cjk_writing_system_class): Updated.
* src/autofit/afdummy.c	(af_dummy_writing_system_class): Updated.
* src/autofit/afindic.c (af_cjk_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
2015-11-02 09:32:26 +01:00
Werner Lemberg dbd04269dc [autofit] Replace `no-base' with `non-base'.
* src/autofit/*: Do it.
2015-09-30 17:52:42 +02:00
Werner Lemberg 19188a9a19 [autofit] Minor tracing improvement.
* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Don't emit
blue zones header line if there are no blue zones.
2015-09-26 16:57:17 +02:00
Werner Lemberg d3cba0ed30 [autofit] Redesign code ranges (2/2).
This commit adds two fallback scripts (`latb', `latp') and
implements support for the no-base character ranges introduced in
the previous commit.

* src/autofit/aftypes.h (AF_ScriptClassRec): Add
`script_uni_nobase_ranges' field.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and
`latp' fallback scripts.

* src/autofit/afblue.dat: Add blue zones for Latin subscript and
superscript fallback scripts.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base
characters.
(AF_STYLE_MASK): Updated.

* src/autofit/afglobal.c (SCRIPT): Updated.
(af_face_globals_compute_style_coverage): Handle new style flag.

* src/autofit/aflatin.c (af_latin_hints_apply): Handle new style
flag.

* src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges.
2015-09-04 10:28:53 +02:00
Werner Lemberg 8cbbcf6b98 [autofit] Pass glyph index to hinting function.
No functionality change yet.

* src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass
glyph index.

* src/autofit/afcjk.c, src/autofit/afcjk.h (af_cjk_hints_apply),
src/autofit/afdummy.c (af_dummy_hints_apply), src/autofit/afindic.c
(af_indic_hints_apply), src/autofit/aflatin.c
(af_latin_hints_apply), src/autofit/aflatin2.c
(af_latin2_hints_apply), src/autofit/afloader.c (af_loader_load_g):
Updated.
2015-09-03 06:47:30 +02:00
Werner Lemberg 15e2a4f790 [autofit] Improve recognition of flat vs. rounded segments.
Lower the flatness threshold from upem/8 to upem/14, making the
auto-hinter accept shorter elements.

Synchronize flat/round stem selection algorithm with blue zone code.

* src/autofit/aflatin.c (FLAT_THRESHOLD): New macro.
(af_latin_metrics_init_blues): Use it.
(af_latin_hints_compute_segments): Collect information on maximum
and minimum coordinates of `on' points; use this to add a constraint
for the flat/round decision similar to
`af_latin_metrics_init_blues'.
2015-08-05 21:53:50 +02:00
Werner Lemberg 12661a5ae0 [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.
2015-04-21 07:13:59 +02:00
Werner Lemberg 58f48f0ddc [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'.
2015-04-16 20:11:49 +02:00
Alexei Podtelezhnikov eae1b3e371 [autofit,pshinter] NULL. 2015-04-13 22:40:17 -04:00
Alexei Podtelezhnikov 770b5d0647 * src/autofit/aflatin.c (af_latin_hint_edges): Reduce logic. 2015-04-02 23:15:36 -04:00
Werner Lemberg a374c9cfe7 [autofit] Fix Savannah bug #44241.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs
with less than 3 points.
2015-03-03 11:23:45 +01:00
Werner Lemberg 851e815127 Various compiler warning fixes for `make multi'.
* src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges),
src/autofit/aflatin.c (af_latin_hint_compute_blue_edges,
af_latin_hint_edges), src/autofit/aflatin2.c
(af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare
as `static'.

* src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH):
Removed.  Unused.
* src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H.
* src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed.  Unused.

* src/cff/cf2intrp.c: Include `cf2intrp.h'.
* src/cff/cffdrivr.c (PAIR_TAG): Removed.  Unused.

* src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed.  Unused.

* src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'.

* src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX):
Removed.  Unused.

* src/raster/ftraster.c (Render_Glyph): Declare as `static'.

* src/sfnt/ttpost.c (load_format_20): Fix signedness warning.

* src/truetype/ttdriver.c (PAIR_TAG): Removed.  Unused.
* src/truetype/ttsubpix.c (is_member_of_family_class,
is_member_of_style_class): Declare as `static'.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare
as `static'.
* src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as
`static'.
(T1_FIELD_COUNT): Removed.  Unused.
* src/type1/t1parse.h (T1_Done_Table): Removed.  Unused.

* src/type42/t42parse.c (T1_Done_Table): Removed.  Unused.
2015-03-01 19:27:09 +01:00
Werner Lemberg b57bb11ad0 [autofit] Fix signedness issues.
* src/autofit/afangles.c, src/autofit/afcjk.c,
src/autofit/afglobal.c, src/autofit/afhints.c,
src/autofit/aflatin.c, src/autofit/aflatin2.c, src/autofit/afwarp.c,
src/autofit/hbshim.c: Apply.
2015-02-19 10:44:18 +01:00
Werner Lemberg 81e5ff53a8 [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.
2015-02-19 09:46:48 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg 5b68e4fb60 [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...
2014-09-24 19:06:13 +02:00
Werner Lemberg 7a615283cb [autofit] Minor. 2014-09-22 08:38:00 +02:00
Werner Lemberg 231171fc3a Partially revert commit from 2014-06-13.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Move
declaration of `p_first' and `p_last' out of the loop.
2014-06-17 09:14:32 +02:00
Werner Lemberg 6497b9c5a5 Fix compiler warnings.
Reported by Wojciech Mamrak <wmamrak@gmail.com>.

* src/autofit/afglobal.c (af_face_globals_compute_style_coverage),
src/autofit/afmodule.c (af_property_set): Fix `signed' vs.
`unsigned' issues.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler
happy.

* src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements
for `fir'.
Fix `signed' vs. `unsigned' issues.

* src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused.
(WRITE_USHORT, WRITE_ULONG): Add proper casts.

* src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts.

* src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1'
and `B2'.
2014-06-13 09:28:00 +02:00
Werner Lemberg 63bef9a588 [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.
2014-05-01 07:16:05 +02:00
Werner Lemberg ccfc4b4c4e [autofit] Introduce neutral blue zones to the latin module.
Such blue zones match either the top or the bottom of a contour.  We
need them for scripts where accent-like elements directly touch the
base character (for example, some vowel signs in Devanagari, cf.
U+0913 or U+0914).

* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New
property.

* src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro.
(AF_LATIN_BLUE_NEUTRAL): New enumeration value.

* src/autofit/aflatin.c (af_latin_metrics_init_blues,
af_latin_hints_compute_blue_edges): Handle neutral blue zones.
2014-04-28 21:13:14 +02:00
Werner Lemberg 98e510ee94 [autofit] Fix Savannah bug #42148.
The adaptation of the cjk auto-hinter module to blue stringsets in
2013-08-25 had three severe bugs.  Mea culpa.

1. Contrary to the latin auto-hinter, characters for reference and
   overshoot values of a blue zone are specified separately.  Due to
   the screwed-up change it didn't work at all.

2. A boolean comparison was erroneously replaced with a cast,
   causing invalid results with the `^' operator later on.  The
   visual artifact caused by this problem is the topic of the bug
   report.

3. Two flag values were inverted, causing incorrect assignment of
   reference and overshoot values.

* src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new
syntax to have both reference and overshoot characters in a single
string.  This is error #1.
Add extensive comments.

* src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no
longer used.
(AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.
This is error #3.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.
Use character `|' to separate characters for reference and overshoot
values.
Improve tracing messages, synchronizing them with the latin
auto-hinter.
(af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.
This is error #2.
(af_cjk_align_linked_edge): Add tracing message.

* src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer
used.
2014-04-20 22:11:27 +02:00
Werner Lemberg 71f53e122b [autofit] Improve scoring algorithm for identifying stems.
Problem reported by Karsten Lücke <karsten.luecke@kltf.de>.

The new algorithm takes care of the width of stems: If the distance
between two segments is larger than the largest stem width, the
demerits quickly increase for larger distances.  This improves
hinting of slanted fonts (especially if the inner parts of serifs
have non-horizontal `shoulders'), avoiding false stem links.

* src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest
stem width (if available) to compute better demerits for distances
between stems.
(af_latin_hints_detect_features): Pass stem width array and array
size.
(af_latin_metrics_init_widths): Updated to use original algorithm.
(af_latin_hints_apply): Updated to use new algorithm.

* src/autofit/aflatin.h: Updated.
* src/autofit/afcjk.c: Updated.
2014-04-05 16:27:19 +02:00
Werner Lemberg 87360a78f3 [aflatin] Improve comment. 2014-04-05 00:08:52 +02:00
Werner Lemberg cc7cf2c3d0 Partially revert last commit.
Found by Alexei.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing
those variables is plain wrong, since we are in a loop.
2014-03-19 07:35:35 +01:00
Sean McBride 87628724a9 Fix clang warnings.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
some variables.

* src/base/ftcalc.c (FT_MulFix): Only use code if
`FT_MULFIX_INLINED' is not defined.

* src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class),
src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c
(ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c
(pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make
function static.

* src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant
code.
2014-03-18 08:39:35 +01:00
Werner Lemberg a8772918a3 [autofit] Minor fix.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling
of alternative standard characters.
This also fixes a compilation warning in non-debug mode.
2014-02-04 11:36:08 +01:00
Werner Lemberg a336400112 [autofit] Introduce two more slots for standard characters.
This is useful for OpenType features like `c2sc' (caps to small
caps) that don't have lowercase letters by definition, or other
features that mainly operate on numerals.

* src/autofit/afscript.h: Add more standard characters.

* src/autofit/aftypes.h: Update use of `SCRIPT' macro.
(AF_ScriptClassRec): Add members to hold two more standard
characters.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afglobal.c, src/autofit/afglobal.h,
* src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c:
Update use of `SCRIPT' macro.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more
standard characters.
2014-01-26 09:45:23 +01:00
Werner Lemberg eb7691cc3d Fix Savannah bug #41320.
* src/autofit/aflatin.c (af_latin_metrics_init_blues)
<AF_LATIN_IS_LONG_BLUE>: Avoid negative index of `last'.
2014-01-24 19:04:22 +01:00
Werner Lemberg 2b623fe4f6 Minor doc issues. 2014-01-15 09:46:23 +01:00
Werner Lemberg ecdb0e35c3 [autofit] Thinko.
* src/autofit/hbshim.c (af_get_char_index): Similar to
`af_get_coverage', reject glyphs which are not substituted.
2014-01-03 20:49:31 +01:00
Werner Lemberg 73cc8330ed [autofit] Implement and use `af_get_char_index' with HarfBuzz.
* src/autofit/hbshim.c (COVERAGE) [FT_CONFIG_OPTION_USE_HARFBUZZ]:
Redefine to construct HarfBuzz features.
(af_get_char_index) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Rewritten.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Use
`y_offset' to adjust `best_y'.
2014-01-01 07:10:36 +01:00
Werner Lemberg 785f38573b [autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i. 2013-12-31 09:45:10 +01:00
Werner Lemberg c9d9947c68 [autofit] Fix interface of `af_get_char_index'.
* src/autofit/hbshim.c (af_get_char_index): Return error value.
Add argument for y offset (to be used in a yet-to-come patch).

* src/autofit/hbshim.h, src/autofit/afcjk.c,
src/autofit/aflatin.c: Updated.
2013-12-31 08:16:57 +01:00
Werner Lemberg 17af586e05 [autofit] Add wrapper function for `FT_Get_Char_Index'.
Yet-to-come changes will provide HarfBuzz functionality for the new
function.

* src/autofit/hbshim.c (af_get_char_index): New function.
* src/autofit/hbshim.h: Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
Updated.
2013-12-28 10:33:01 +01:00
Werner Lemberg 8a8f3758f1 [autofit] Fix PIC compilation.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths)
[FT_CONFIG_OPTION_PIC]: Declare `globals'.

* src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
AF_DEFINE_STYLE_CLASS.

* src/autofit/afpic.c: Include `afglobal.h'.
(autofit_module_class_pic_init): Typo.

* src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
parameter and structure member.
2013-12-20 18:35:35 +01:00
Werner Lemberg 974b193bcc [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'.
2013-12-20 17:26:26 +01:00
Werner Lemberg d8324571f1 [autofit] Factor scripts and uniranges out of writing system files.
* src/autofit/afranges.c, src/autofit/afranges.h: New files.

* src/autofit/afscript.h: Extend `SCRIPT' macro with more
parameters, taking data from the writing system files.

* src/autofit/aftypes.h: Updated.

* src/autofit/afglobal.c: Include `afranges.h'.
Load `afscript.h' to call AF_DEFINE_SCRIPT_CLASS.
* src/autofit/afglobal.c: Include `afranges.h'.
Load `afscript.h' to call AF_DECLARE_SCRIPT_CLASS.

* src/autofit/afcjk.c, src/autofit/afcjk.h: Updated.
* src/autofit/afdummy.c, src/autofit/afdummy.h: Updated.
* src/autofit/afindic.c, src/autofit/afindic.h: Updated.
* src/autofit/aflatin.c, src/autofit/aflatin.h: Updated.
* src/autofit/aflatn2.c, src/autofit/aflatn2.h: Updated.

* src/autofit/afpic.c: Updated.

* src/autofir/autofit.c: Include `afranges.c'.
* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'.
2013-12-19 15:45:24 +01:00
Werner Lemberg 4593062207 [autofit] Minor. 2013-12-19 15:24:39 +01:00
Werner Lemberg 73f3198101 [autofit] More code orthogonality.
* src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class'
pointer to an `AF_ScriptClass' structure with `script' index of type
`AF_Script'.
Move some code around.

* src/autofit/afcjk.c: Include `afpic.h'.
(af_cjk_metrics_init_widths, af_cjk_metrics_init_blues,
af_cjk_hint_edges): Updated.

* src/autofit/aflatin.c: Include `afpic.h'.
(af_latin_metrics_init_widths, af_latin_metrics_init_blues,
af_latin_metrics_scale_dim, af_latin_hint_edges): Updated.

* src/autofit/afglobal.c (af_face_globals_get_metrics): Updated.

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
2013-12-19 15:24:17 +01:00
Werner Lemberg 3f91cb338b [autofit] s/ScriptMetrics/StyleMetrics/. 2013-12-18 12:59:35 +01:00
Werner Lemberg 7a5fc2f362 [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate. 2013-12-17 13:29:53 +01:00
Werner Lemberg 75efc2d0bd [autofit] s/SMALL_TOP/X_HEIGHT/.
* src/autofit/afblue.dat: Updated.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.c, src/autofit/aflatin.h,
src/autofit/atlatin2.c: Updated.
2013-10-19 21:46:03 +02:00
Werner Lemberg 955f6a86a3 [autofit] Improve tracing message for extra light flag.
* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it.
2013-10-16 19:47:57 +02:00
Werner Lemberg b6695243b7 [autofit] Improve tracing of `latin' hinter.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue
zone types.
(af_latin_metrics_scale_dim): Report scaling changes due to x height
alignment.
Report scaled stroke width and blue zone values.
2013-10-12 10:33:04 +02:00
Werner Lemberg b75a8b8817 * src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays. 2013-09-25 09:46:36 +02:00
Werner Lemberg 5a4c5a5b23 [autofit] Disunify Cyrillic and Greek handling from Latin.
* src/autofit/afscript.h: Add Cyrillic and Greek.

* src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,
AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.
(AF_BLUE_STRINGSET_LATN): Fix typo.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New
arrays.
(af_grek_script_class, af_cyrl_script_class): New scripts.
* src/autofit/aflatin.h: Updated.
2013-09-22 22:37:26 +02:00
Werner Lemberg 3f542498b2 [autofit] Improve Hebrew rendering.
This change introduces a new blue zone property
`AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short
top segments.

* src/autofit/afblue.dat: Fix Hebrew blue strings.
Use AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP.

* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro.

* src/autofit/afblue.c, src/autofit/afblue.h: Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle
`AF_LATIN_IS_LONG_BLUE'.

* src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro.
2013-09-11 23:08:31 +02:00
Werner Lemberg 5e53db25ff [autofit] While tracing, report script names instead of ID values.
* src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:
New array.
* src/autofit/afglobal.h: Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_hint_edges): Use `af_script_names'.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_hint_edges): Ditto.
2013-08-27 18:37:39 +02:00
Werner Lemberg 278f64b330 [autofit] Report used script while hinting a glyph.
* src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c
(af_latin_hint_edges): Implement it.
2013-08-26 20:20:03 +02:00
Werner Lemberg 371f5c3b9d [autofit] Add support for Hebrew script.
* src/autofit/afblue.dat: Add blue strings for Hebrew.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.c (af_hebr_uniranges): New array.
(af_hebr_script_class): New script.
* src/autofit/aflatin.h, src/autofit/afscript.h: Updated.
2013-08-26 20:11:24 +02:00
Werner Lemberg 098121dbb9 [autofit] Improve tracing messages.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script
ID in tracing message.
(af_cjk_metrics_init_blues): Initialize `axis' outside of the inner
loop.
Improve tracing messages.
(af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable
`num_actions' to count hinting actions.
Improve tracing messages.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention
script ID in tracing message.
(af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing
messages.
2013-08-26 18:54:05 +02:00
Werner Lemberg 306f8c5d89 [autofit] Synchronize `cjk' with `latin' module (and vice versa).
* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing
messages.
(af_cjk_metrics_init_blues): Don't pass blue string array as
argument but use the global array directly.
Use `outline' directly.
Update and add tracing messages.
(af_cjk_metrics_init): Simplify code.
(af_cjk_metrics_scale_dim): Improve tracing message.
(af_cjk_metrics_scale): Synchronize.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues): Improve and add tracing messages.
2013-08-25 13:07:08 +02:00
Werner Lemberg 0975d685ed [autofit] Make `latin' module use blue stringsets.
* src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed.
(af_latin_blue_chars): Removed.
(af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS
with AF_BLUE_STRING_MAX_LEN.
Change loops to use offsets (in file `afblue.h') into the new arrays
`af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').
Use `AF_LATIN_IS_SMALL_TOP_BLUE' macro.

* src/autofit/aflatin.h: Remove old enumeration values superseded by
the new data in `afblue.h'.
(AF_LATIN_IS_TOP_BLUE): Updated definition.
(AF_LATIN_IS_SMALL_TOP_BLUE): New macro.
(AF_LATIN_MAX_BLUES): Remove.
(AF_LatinAxisRec): Updated.
2013-08-25 08:37:47 +02:00
Werner Lemberg db3e5b9394 [autofit] Add blue stringsets.
* src/autofit/aftypes.h: Include `afblue.h'.
(AF_ScriptClassRec): Add `blue_stringset' field.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/autofit.c: Include `afblue.c'.

* src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c
(af_dflt_script_class), src/autofit/afindic.c
(af_deva_script_class), src/autofit/aflatin.c
(af_latn_script_class), src/autofit/aflatin2.c
(af_ltn2_script_class): Updated.

* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'.
2013-08-25 08:23:22 +02:00
Werner Lemberg 72f5ff5bbb [autofit] Introduce `writing systems'.
This patch adds a new top level to the auto-hinter's script class
hierarchy.  It defines `writing systems' which can contain multiple
scripts.

For example, the `latin' writing system (in file `aflatin.c') is
able to support scripts like Latin, Cyrillic, Armenian, etc., which
can be handled similarly.

Scripts are now named using four-letter OpenType tags.

* src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members
to...
(AF_WritingSystemClassRec): This new structure.  It holds pointers
to functions which can be shared among related scripts.
(AF_WritingSystem): New enumeration.
(AF_Script): Revised values using four-letter tags.
(AF_DEFINE_WRITING_SYSTEM_CLASS): New macro.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/afglobal.c (af_writing_system_classes): New global,
constant array.
(af_script_classes): Updated.
(af_face_globals_free): Updated.
Remove assertion.
(af_face_globals_get_metrics): Updated.

* src/autofit/afglobal.h (AF_SCRIPT_FALLBACK)
[!AF_CONFIG_OPTION_CJK]: Handle this case.

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.

* src/autofit/afpic.c (autofit_module_class_pic_init): Updated;
initialize structures for both writing systems and scripts.
* src/autofit/afpic.h: Updated.
(AF_WRITING_SYSTEM_CLASSES_GET): New macro.

* src/autofit/afcjk.c (af_cjk_writing_system_class): New writing
system.
(af_cjk_uniranges): Renamed to...
(af_hani_uniranges): This.
(af_cjk_script_class): Reduced and renamed to...
(af_hani_script_class): This.
* src/autofit/afcjk.h: Updated.

* src/autofit/afdummy.c (af_dummy_writing_system_class): New writing
system.
(af_dummy_script_class): Reduced and renamed to...
(af_dflt_script_class): This.
* src/autofit/afdummy.h: Updated.

* src/autofit/afindic.c (af_indic_writing_system_class): New writing
system.
(af_indic_uniranges): Renamed to...
(af_deva_uniranges): This.
(af_indic_script_class): Reduced and renamed to...
(af_deva_script_class): This.
* src/autofit/afcjk.h: Updated.

* src/autofit/aflatin.c (af_latin_writing_system_class): New writing
system.
(af_latin_uniranges): Renamed to...
(af_latn_uniranges): This.
(af_latin_script_class): Reduced and renamed to...
(af_latn_script_class): This.
* src/autofit/aflatin.h: Updated.

* src/autofit/aflatin2.c (af_latin2_writing_system_class): New
writing system.
(af_latin2_uniranges): Renamed to...
(af_ltn2_uniranges): This.
Synchronize ranges with `latin'.
(af_latin2_script_class): Reduced and renamed to...
(af_ltn2_script_class): This.
* src/autofit/aflatin2.h: Updated.
2013-07-31 22:57:01 +02:00
Werner Lemberg 5d6a360542 [autofit] Variable renaming.
* src/autofit/aftypes.h (AF_ScriptMetricsRec):
s/clazz/script_class/.
Update all users.
2013-07-31 22:57:01 +02:00
Werner Lemberg 05c1421f8d [autofit] Fix segment classification for blue zones.
The old code (essentially unchanged since the very beginning)
incorrectly handled this configuration

               x -o- x
                /   \
               /     \
              /       \
             o         o

as flat and this

                o               o
               /               /
             x|              x|
              |               |
              o---------------o

as round.  (`o' and `x' are on and off points, respectively).

This is a major change which should improve the rendering results
enormously for many TrueType fonts, especially in the range approx.
20-40ppem, fixing the appearance of many overshoots.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the
first and last points of the segment, not the points right before
and after.
2013-07-19 23:11:23 +02:00
Werner Lemberg aa0ac3239c [sfnt] Fix documentation of `tt_face_get_metrics'.
Problem reported in Savannah bug #39383.
2013-07-02 10:36:26 +02:00
Werner Lemberg ccbdc3c421 * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Typo. 2013-05-08 09:17:56 +02:00
Werner Lemberg eed830614f Whitespace. 2013-03-23 14:25:43 +01:00
Werner Lemberg e3c9301581 */*: Use FT_Err_Ok only.
This is a purely mechanical conversion.
2013-03-14 11:21:17 +01:00
Werner Lemberg 3a55340029 [autofit] Trace stem widths.
* src/autofit/aflatin.c (af_latin_metrics_init_widths): Add some
FT_TRACE calls.
2012-11-15 16:37:05 +01:00
Werner Lemberg 1a37e4174b [autofit] Minor improvement.
* src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Fix
loop.
2012-11-12 11:01:07 +01:00
Werner Lemberg f966da825c [autofit] Improve tracing.
* src/autofit/aflatin.c (af_latin_hint_edges)
[FT_DEBUG_LEVEL_TRACE]: Count number of actions and emit something
if there weren't any.
2012-11-10 12:42:18 +01:00
Werner Lemberg 553bb3c3ca [autofit] Add standard character to `AF_ScriptClassRec' structure.
* src/autofit/aftypes.h (AF_ScriptClassRec): Add `standard_char'
member.
(AF_DEFINE_SCRIPT_CLASS): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Use it.
(af_latin_metrics_init, af_latin_script_class): Updated.

* src/autofit/aflatin.c (af_latin2_metrics_init_widths): Use it.
(af_latin2_metrics_init, af_latin2_script_class): Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Use it.
(af_cjk_metrics_init, af_cjk_script_class): Updated.

* src/autofit/afindic.c(af_indic_metrics_init,
af_indic_script_class): Updated.

* src/autofit/afcjk.h, src/autofit/aflatin.h: Updated.

* src/autofit/afdummy.c: Updated.
2012-10-24 14:22:14 +02:00
Werner Lemberg 118c6025b7 [autofit] Only use Unicode CMap.
* src/autofit/aflatin.c (af_latin_metrics_init): Implement it, to be
in sync with `af_face_globals_compute_script_coverage)'.
2012-10-24 12:26:20 +02:00
Werner Lemberg dda1e93db8 [autofit] Fix `make multi CC=c++'.
* src/autofit/aflatin.c, src/autofit/aflatin2.c: Include
`afglobal.h'.
* src/autofit/afloader.c: Fix order of header files.
* src/autofit/afmodule.c: Include `afglobal.h' and `aferrors.h'.
2012-10-20 08:34:57 +02:00
Werner Lemberg 7da6bbc34a Typos. 2012-09-25 06:37:15 +02:00
Werner Lemberg d180ac70fc [autofit] Implement Infinality's `increase glyph heights'.
This is an improved version of a similar fix contained in the
so-called `Infinality patch', taken from

  http://www.infinality.net/fedora/linux/zips/freetype-infinality-2.4.10-20120616_01-x86_64.tar.bz2

which addresses various enhancements of the auto-hinter.  Without
properties to control a module's metadata it wasn't possible to
adapt the patches because everything was originally controlled by
environment variables which I consider not suitable in general.

A patch to control `increase_x_height' follows.

* src/autofit/afglobal.h (AF_PROP_INCREASE_X_HEIGHT_MIN,
AF_PROP_INCREASE_X_HEIGHT_MAX): New macros.
(AF_FaceGlobalsRec): Add `increase_x_height' member.
* src/autofit/afglobal.c (af_face_globals_new): Initialize it.

* src/autofit/aflatin.c (af_latin_metrics_scale_dim),
* src/autofit/aflatin2.c (af_latin2_metrics_scale_dim): Implement
handling of `increase_x_height'.
2012-09-18 23:26:37 +02:00
Werner Lemberg 302fd62590 [autofit] Cosmetics. 2012-09-16 07:51:20 +02:00
Werner Lemberg 44e1f0d3a0 [autofit] Correct previous Unicode 6.1.0 change.
The auto-hinter's latin module only handles latin ligatures in the
`Alphabetical Presentation Forms' block.

* src/autofit/aflatin.c (af_latin_uniranges): Fix it.
2012-09-15 11:11:18 +02:00
Werner Lemberg 8ae2a65e09 [autofit] Update to Unicode 6.1.0.
* src/autofit/afcjk.c (af_cjk_uniranges), src/autofit/aflatin.c
(af_latin_uniranges): Add and fix ranges.
2012-09-14 14:10:01 +02:00
Werner Lemberg 5b995a8dd8 [autofit] Improve recognition of flat segments.
Problem reported by Brad Dunzer <BDunzer@extensis.com>.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): We have
a flat segment if the horizontal distance of best on-points is
larger than a given threshold.
2012-08-05 11:11:44 +02:00
Werner Lemberg e194d7cd61 [autofit] Variable renamings.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace
`glyph' with `outline'.
s/best_first/best_contour_first/.
s/best_last/best_contour_last/.
2012-08-05 10:58:02 +02:00
Werner Lemberg 5a0af493e4 [autofit] Improve debugging messages; do some code cleanup.
* src/autofit/aflatin.c (af_latin_align_linked_edge,
af_latin_hint_edges): Synchronize with formatting used in the
ttfautohint project.
2012-07-09 08:19:25 +02:00
Werner Lemberg 5210306145 Fix Savannah bug #36091.
* src/autofit/aflatin.c (af_latin_metrics_init_blues),
src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Change the
constraint for testing round vs. flat segment: Accept either a
small distance or a small angle.
2012-07-04 17:20:33 +02:00
Werner Lemberg 09e9b59605 [autofit] Beautify blue zone tracing.
* src/autofit/aflatin.c (af_latin_metrics_init_blues),
src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Implement it.
2012-07-04 13:00:06 +02:00
Werner Lemberg 2a9c4552f6 [autofit] Quantize stem widths.
* src/autofit/afangles.c (af_sort_widths): Rename to...
(af_sort_and_quantize_widths): This.
Add code to avoid stem widths which are almost identical.
* src/autofit/aftypes.h, src/autofit/aflatin.c, src/autofit/afcjk.c:
Updated.
2012-07-03 11:54:12 +02:00
Werner Lemberg 8be32d2f4a [autofit] Properly copy scaler flags to script metrics object.
Without this patch, only the dummy and cjk autohinter modules get
them (since they copy the whole scaler object).

* src/autofit/aflatin.c (af_latin_metrics_scale),
src/autofit/aflatin2.c (af_latin2_metrics_scale): Implement it.
2012-03-28 12:21:50 +02:00
Werner Lemberg c52f44d4fd Whitespace. 2011-11-30 10:46:53 +01:00
Werner Lemberg 4696dde23d * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change
from 2011-05-04.
2011-06-20 19:09:02 +02:00
Werner Lemberg 58d1a5ee74 [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.
2011-06-08 09:32:56 +02:00
Werner Lemberg 71cc1a83d8 Fix gcc 4.6 compiler warnings.
* src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and
remove unused variables.
* src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out
`up_dir'.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org'
and `width_org' conditionalized.
2011-05-30 07:20:37 +02:00