Commit Graph

241 Commits

Author SHA1 Message Date
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
Werner Lemberg 735e5abb7b [autofit] Improve tracing of hinting process.
* src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message
`ADJUST'.
2011-05-27 10:22:42 +02:00
Werner Lemberg a3a0f57a1d * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify. 2011-05-04 06:14:30 +02:00
Werner Lemberg c3135e43f5 [autofit] Fix and add comments. 2011-05-02 06:04:15 +02:00
Werner Lemberg b9aa1f1339 [autofit] Improve tracing messages.
* src/autofit/aflatin.c (af_latin_metrics_init_blues,
af_latin_align_linked_edge, af_latin_hint_edges): Do it.
2011-04-28 09:09:45 +02:00
Werner Lemberg d503b1bce2 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.
2011-04-18 19:05:28 +02:00
Werner Lemberg 948a8fb674 Fix formatting of autofit debug dumps.
* src/autofit/afhints.c (af_glyph_hints_dump_points,
af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust
column widths.
2011-04-04 13:02:08 +02:00
Werner Lemberg 9f5ed8118c Cosmetics. 2011-04-02 07:23:00 +02:00
Werner Lemberg 544adf7313 Whitespace, typo. 2011-04-02 07:15:33 +02:00
Werner Lemberg c7f26a1982 C++ compilation fixes.
* src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c
(af_cjk_hints_apply): Use cast for `dim'.
2011-03-19 02:28:21 +01:00
Werner Lemberg 576fc2c06e 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.
2011-03-02 03:52:36 +01:00
Werner Lemberg e547a656a5 [autofit] More comments, formatting, whitespace. 2011-02-26 18:39:10 +01:00
Werner Lemberg b7fc0c7461 [autofit] Slight simplifications.
* src/autofit/aflatin.c (af_latin_hints_link_segments): Remove
test which always returns false.
(af_latin_hints_compute_blue_edges): Remove redundant assignment.
2011-02-26 18:36:21 +01:00
Werner Lemberg 6c28689691 [autofit] Comment out unused code.
* src/autofit/aflatin.c, src/autofit/aflatin2.c
(af_latin_hints_compute_edges): Do it.
2011-02-24 05:52:14 +01:00
Werner Lemberg 5220ef58c5 Fix minor issues reported by <muktha.narayan@wipro.com>.
* src/autofit/aflatin.c (af_latin_compute_stem_width): Remove
redundant conditional check.
* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto.
* src/cff/cffload.c (cff_encoding_load): Remove conditional check
which always evaluates to `true'.
* src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points):
Ditto.
* src/truetype/ttinterp.c (Ins_IUP): Ditto.
* src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if
value is already dereferenced.
* src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
2010-09-13 07:32:22 +02:00
Werner Lemberg 09344385ee 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.
2010-05-22 07:43:22 +02:00
Werner Lemberg 7635ba64b7 Really fix FreeDesktop bug #21197.
This also fixes Savannah bug #28021.

* src/autofit/aflatin.c (af_latin_metrics_check_digits),
src/autofit/aflatin2.c (af_latin2_metrics_check_digits): Fix loop.
2009-11-15 10:17:44 +01:00
suzuki toshiya 76f1b9d9cf [autofit] Fix for multi build. 2009-09-25 23:57:30 +09:00
suzuki toshiya 87054758fb autofit: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya b56680240a autofit: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:32:07 +09:00
suzuki toshiya 38e480b4c6 autofit: Improve Unicode range definitions. 2009-08-01 00:30:21 +09:00
Werner Lemberg 858abbedc0 For warning messages, replace FT_ERROR with FT_TRACE0.
FT_ERROR is now used only if a function produces a non-zero `error'
value.

Formatting, improving and harmonizing debug strings.
2009-06-26 06:15:41 +02:00
Werner Lemberg b34c9b49cc aflatin.c: Fix compiler warning. 2009-06-20 06:32:23 +02:00
Werner Lemberg 8b84c9d19f autohinter: Don't change digit widths if all widths are the same.
This fixes FreeDesktop bug #21197.

* src/autofit/afglobal.c (AF_DIGIT): New macro.
(af_face_globals_compute_script_coverage): Mark ASCII digits in
`glyph_scripts' array.
(af_face_globals_get_metrics): Updated.
(af_face_globals_is_digit): New function.
* src/autofit/afglobal.h: Updated.
(AF_ScriptMetricsRec): Add `digits_have_same_width' flag.

* src/autofit/aflatin.c: Include FT_ADVANCES_H.
(af_latin_metrics_check_digits): New function.
(af_latin_metrics_init): Use it.
* src/autofit/aflatin.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init): Updated.

* src/autofit/aflatin2.c: Similar changes as with aflatin.c.

* src/autofit/afloader.c (af_loader_load_g): Test digit width.

* docs/CHANGES: Document it.
2009-04-27 19:40:35 +02:00
Oran Agra 59b4af8d59 Position Independent Code (PIC) support in autofit module.
* include/freetype/internal/autohint.h add macros to init
instances of FT_AutoHinter_ServiceRec.

* src/autofit/afmodule.h declare autofit_module_class
using macros from ftmodapi.h,
when FT_CONFIG_OPTION_PIC is defined create and destroy
functions will be declared.
* src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined
af_autofitter_service and autofit_module_class structs
will have functions to init or create and destroy them
instead of being allocated in the global scope.
And macros will be used from afpic.h in order to access them.

* src/autofit/aftypes.h add macros to init and declare
instances of AF_ScriptClassRec.

* src/autofit/afcjk.h declare af_cjk_script_class
using macros from aftypes.h,
when FT_CONFIG_OPTION_PIC is defined init function will be declared.
* src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined
af_cjk_script_class struct will have function to init it instead of
being allocated in the global scope.

* src/autofit/afdummy.h declare af_dummy_script_class
using macros from aftypes.h,
when FT_CONFIG_OPTION_PIC is defined init function will be declared.
* src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined
af_dummy_script_class struct will have function to init it instead of
being allocated in the global scope.

* src/autofit/afindic.h declare af_indic_script_class
using macros from aftypes.h,
when FT_CONFIG_OPTION_PIC is defined init function will be declared.
* src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined
af_indic_script_class struct will have function to init it instead of
being allocated in the global scope.

* src/autofit/aflatin.h declare af_latin_script_class
using macros from aftypes.h,
when FT_CONFIG_OPTION_PIC is defined init function will be declared.
* src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined
af_latin_script_class struct will have function to init it instead of
being allocated in the global scope.
Change af_latin_blue_chars to be PIC-compatible by being a two
dimentional array rather than array of pointers.


* src/autofit/aflatin2.h declare af_latin2_script_class
using macros from aftypes.h,
when FT_CONFIG_OPTION_PIC is defined init function will be declared.
* src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined
af_latin2_script_class struct will have function to init it instead of
being allocated in the global scope.
Change af_latin2_blue_chars to be PIC-compatible by being a two
dimentional array rather than array of pointers.

* src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined
af_script_classes array initialization was moved to afpic.c and
is later refered using macros defeined in afpic.h.

New Files:
* src/autofit/afpic.h declare struct to hold PIC globals for autofit
module and macros to access them.
* src/autofit/afpic.c implement functions to allocate, destroy and
initialize PIC globals for autofit module.

* src/autofit/autofit.c add new file to build: afpic.c.
* src/autofit/jamfile add new files to FT2_MULTI build: afpic.c.
2009-04-05 18:23:38 +03:00
Werner Lemberg b6fa845146 * src/autofit/aflatin.c (af_latin_hint_edges),
src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
(af_cjk_hint_edges): Protect against division by zero.
2008-12-21 09:46:31 +00:00
Werner Lemberg e3b083c65b * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges. This
fixes Savannah bug #21190 which also provides a basic patch.
2008-12-05 22:50:40 +00:00
Werner Lemberg 1e1b6dff54 * src/pfr/pfrcmap.c: Include pfrerror.h.
* src/autofit/afindic.c: Add some external declarations to pacify
`make multi' compilation.

* src/cid/cidgload.c (cid_load_glyph): Pacify compiler.

* src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
(cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
src/autofit/aflatin.c (af_latin_hints_compute_edges),
src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
(tt_face_get_metrics), src/base/ftobjs.c (open_face)
[FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.

* docs/release: Mention test compilation targets.
2007-07-07 07:30:40 +00:00
Werner Lemberg 3b0e500601 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
`round' to pacify compiler.

Really commit changes which have been used to build release 2.3.5.
2007-07-03 04:48:19 +00:00
David Turner 74cc0e9ee4 * src/truetype/ttinterp.c: add missing variable initialization,
gets rid of Valgrind fixes.

	* src/autofit/aflatin.c: get rid of an infinite loop in the case
	of degenerate fonts.
2007-06-30 22:54:12 +00:00
Werner Lemberg 46dde4953a * src/autofit/aflatin.c (af_latin_uniranges): Expand structure to
cover all ranges which could possibly be handled by the aflatin
module (since the default fallback for unknown ranges is now the
afcjk module).  It might be necessary to fine-tune this further by
splitting off modules for Greek, Cyrillic, or other blocks.
2007-06-14 03:59:02 +00:00
Werner Lemberg 49e18b8d5f formatting 2007-06-11 21:15:09 +00:00
David Turner b38c15da09 fix bug #19565, which was caused by an incorrect segment link computation 2007-06-11 19:36:48 +00:00
David Turner b792017faf experimental changes for the Latin auto-hinter.
note that the new code is disabled by default.
2007-06-11 05:37:35 +00:00
Werner Lemberg 94be20ea82 * src/truetype/ttinterp.c (Ins_IP), src/autofit/aflatin.c
(af_latin_metrics_scale_dim): Fix compiler warnings.
2007-05-09 20:02:55 +00:00
Werner Lemberg 94f1227f32 formatting; improved ChangeLog entries 2007-04-03 07:19:53 +00:00
David Turner e6472c1251 detect "extra-light" fonts in the auto-hinter in order to avoid producing weird results with them 2007-04-02 13:13:54 +00:00
Werner Lemberg 644b1ad49e * builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproc, README: s/2.3.2/2.3.3/,
s/232/233/.

* docs/CHANGES: Mention ftdiff.
2007-03-28 21:17:11 +00:00
David Turner f58caa09bc fix autofit's blue zone computations: it now ignores 1-point contours that
correspond to mark attach coordinates, and not to the real glyph outline
2007-03-26 12:39:25 +00:00
Werner Lemberg 3d92f08bc5 * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper
macro for `strstr'.

* src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning
`trick_names', as suggested by Ivan Nincic.
2007-03-06 11:59:24 +00:00
Werner Lemberg a091517a04 * src/truetype/ttinterp.c (Ins_MD): Remove unused variable.
* src/autofit/aflatin.c (af_latin_hints_link_segments): Ditto.
2007-02-16 08:12:50 +00:00
Werner Lemberg 3cd6cc24f2 formatting 2007-02-16 08:10:17 +00:00
David Turner a6bdb667d9 better handling of serif segments in the Latin auto-fitter, gets rid of
broken "9" in Arial 9pt/96dpi
2007-02-12 22:33:48 +00:00
Werner Lemberg b1be9e8b57 * src/cff/cffload.c (cff_index_get_pointers): Handle last entry
correctly.  This fixes Savannah bug #18867.

* docs/CHANGES: Document it.

Other formatting.
2007-01-25 11:50:00 +00:00
David Turner b6de8d1d3f * src/autofit/aflatin.c, src/autofit/aftypes.h, src/autofit/afwarp.h,
src/autofit/afwarp.c: fix and enable the warper to improve "light"
        hinting mode. This is not necessarily a final version, but it seems
        to work well
2007-01-23 15:51:50 +00:00
Werner Lemberg b4142d5126 Whitespace and spelling fixes from Alexei.
Formatting, copyright years.
2007-01-17 12:45:26 +00:00
David Turner 2212272992 * src/autofit/aflatin.c, src/cff/cffdriver.c, src/truetype/ttobjs.c,
src/truetype/ttinterp.c: fixing compiler warnings
2007-01-16 20:06:44 +00:00
Werner Lemberg 6b87e6f0ff * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate):
Remove compiler warning.

Formatting.
2007-01-02 19:20:08 +00:00
David Turner 115b442b23 * src/autofit/aflatin.c, src/truetype/ttgload.c: removing compiler
warnings

	* builds/win32/visualc/freetype.vcproj: adding _CRT_SECURE_NO_DEPRECATE
	to avoid deprecation warnings with Visual C++ 8
2006-12-22 11:37:05 +00:00
Werner Lemberg 960ba59ad9 * 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.
2006-12-01 08:20:47 +00:00
David Turner 81e725f513 * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c,
src/autofit/aftypes.h: Misc. auto-hinter improvements
2006-11-23 14:49:48 +00:00
Werner Lemberg 0d0d78dadc formatting 2006-11-14 10:37:10 +00:00
David Turner 8765c71b41 * include/freetype/ftlcdfil.h, include/internal/ftobjs.h,
src/base/ftlcdfilt.c, src/smooth/ftsmooth.c: API change for
       the LCD filter, the FT_LcdFilter value is a enum describing
       which filter to apply, new values FT_LCD_FILTER_LIGHT and
       FT_LCD_FILTER_LEGACY (the latter implements the LibXft original
       algorithm which produces incredible color fringes for everything
       except very-well hinted text)

       * src/autofit/aflatin.c: various tiny improvements that drastically
       improve the handling of serif fonts and of LCD/LCD_V hinting modes.
2006-11-10 16:49:42 +00:00
Werner Lemberg 111b5aefca * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
Formatting
2006-11-03 09:40:12 +00:00
David Turner 91b44e65c2 - improve autofitter's handling of serif fonts (results are much better)
- make GCC 4 happy when compiling our zlib sources
2006-11-02 23:28:09 +00:00
David Turner 4060474815 - fixed a bug in af_compute_direction which generated ugly glyphs
- added more debug/log messages to help improve the auto-fitter
2006-11-02 16:37:35 +00:00
Werner Lemberg 545c4e566e * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
[FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again.


Formatting, documentation fixes.
2006-05-17 22:55:04 +00:00
David Turner 281679de85 * include/freetype/internal/tttypes.h, src/autofit/afangles.c,
src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
        src/autofit/aftypes.h, src/base/ftcalc.c, src/base/ftoutln.c,
        src/gzip/ftgzip.c, src/psaux/psconv.c, src/truetype/ttgload.c,
        src/type1/t1gload.c:

          this is a major patch used to drastically improve the performance
          of loading glyphs. This both speeds up loading the glypn vector
          themselves and the auto-fitter.

          note that we've started using inline assembler with GCC to
          implement FT_MulFix, given that this function is so damn
          important for the engine's performance.

          the resulting speed-up is about 25%.
2006-05-17 13:34:21 +00:00
David Turner 24b9e87bca * src/autofit/aflatin.c (af_latin_metrics_scale): fixed small bug that
crash the auto-hinter (introduce by previous patch). aaah
2006-03-21 16:30:04 +00:00
Werner Lemberg 5a73d8d20f * builds/freetype.mk (CACHE_DIR, CACHE_H): Remove.
(FREETYPE_H): Updated.

* src/cache/rules.mk (CACHE_H_DIR): Remove.
(CACHE_DRV_H): Updated.

Formatting, copyright years.
2006-03-20 16:55:32 +00:00
David Turner e091ce35ff * src/autofit/aflatin.c (af_latin_hints_init):
disable horizontal hinting for italic/oblique fonts
2006-03-20 16:01:28 +00:00
David Turner da95af6cf6 * builds/win32/visualc/freetype.dsp: updating the project file, adding
missing base source files (e.g. ftstroke.c, ftxf86.c, etc...)

    * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
    src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
    src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/truetype/ttpload.c,
    src/truetype/ttpload.h, src/type1/t1afm.c, src/type1/t1objs.c:
      removing compiler warnings when building with Visual C++ 6 and /W4
2006-03-20 13:32:33 +00:00
Wu, Chia-I (吳佳一) 4c507ffa80 * src/autofit/afcjk.c (af_cjk_metrics_init): Fix a stupid bug...
* src/autofit/aflatin.c (af_latin_metrics_init_widths): Use
AF_LatinMetricsRec as the dummy metrics because we cast the metrics to
it later in `af_latin_hints_link_segments'.
2006-02-11 13:22:37 +00:00
Wu, Chia-I (吳佳一) f9a69132a7 * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_CJK): #define
to enable autofit CJK script support. (#define'd by default)

* src/autofit/aflatin.h (AF_LATIN_CONSTANT): New macro.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Make sure that
`edge_distance_threshold' is always set.
(af_latin_hints_link_segments): Potential divide by 0 bug.
Use latin constant in the scoring formula.

* src/autofit/afcjk.c: Minor updates due to the above three changes.

* docs/TODO, docs/CHANGES: Updated.
2006-02-11 12:12:02 +00:00
Wu, Chia-I (吳佳一) 4cdb45c01e 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.
2006-02-09 14:17:04 +00:00
Werner Lemberg 1be9ebf5f9 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add afwarp.c.
Formatting, copyright notices, copyright years.
2006-01-22 06:58:16 +00:00
David Turner bb4edc9235 * 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.
2006-01-21 14:31:45 +00:00
Werner Lemberg b79b513380 Formatting, improving comments. 2005-12-20 12:01:58 +00:00
David Turner 5b5f382b7d * src/autofit/aflatin.c, src/autofit/afhints.c: changed the
implementation of the LIGHT hinting mode to completely disable
        horizontal hinting. This is an experimental effort to integrate
        David Chester's latest patch without fucking the other hinting
        modes as well.

        Note that this doesn't force auto-hinting for all fonts however.
2005-12-14 16:37:15 +00:00
David Turner f582cf3f95 * src/autofit/aflatin.c (af_latin_compute_stem_width): fixed bad
computation of the "vertical" flag, causing ugly things in LCD mode
        and others.
2005-09-26 09:27:09 +00:00
David Turner 99ded0bed7 * src/autofit/aflatin.c (af_latin_hints_init): fixed a bug that
prevented internal hint mode bitflags from being computed correctly
2005-09-23 08:00:51 +00:00
Werner Lemberg 55b0908ef5 * src/autofit/aflatin.c (af_latin_metrics_scale): Initialize
render mode properly.  Reported by chris@dokein.co.uk.
2005-08-24 08:04:56 +00:00
Werner Lemberg 22ad9ef024 Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck
Blaskey).

* src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'.
* src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate.

(tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate,
tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use
`FT_Error' as return type.
(tt_cmap4_validate): Use `FT_Error' as return type.
Return error code for unsorted cmap.
(tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted
cmaps.
(tt_face_build_cmaps): Set `unsorted' variable in cmap.


Minor formatting.
2005-05-09 22:11:36 +00:00
David Turner 750fa961c6 * Jamfile: removing otvalid from the list of compiled modules
* include/freetype/internal/ftserv.h: added compiler pragmas to get rid
    of annoying warnings with Visual C++ compiler in maximum warning mode

  * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c,
    src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c,
    src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c,
    src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c,
    src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: removing compiler warnings
2005-05-01 10:11:32 +00:00
Werner Lemberg a37745bad4 * docs/CHANGES, docs/INSTALL.ANY: Updated.
* include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
Add `OTvalid'.

* src/autofit/aferrors.h: New file.

* src/autofit/afglobal.c, src/autofit/afhints.c,
src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
Include aferrors.h.

* src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.

* src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
2005-03-23 16:45:24 +00:00
Werner Lemberg 35fd84b96a Formatting. 2005-03-08 06:00:35 +00:00
David Turner 8d4ccf5384 * src/autofit/aflatin.c (af_latin_metrics_init): fixing bug #12212
(auto-hinter refuses to work if no Unicode charmap in font)
2005-03-06 10:17:28 +00:00
Werner Lemberg f13516c832 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.
2005-03-03 17:09:08 +00:00
Werner Lemberg b19b0810cd * src/autofit/afdummy.c, src/autofit/afdummy.h
(af_dummy_script_class): Fix type.

* src/autofit/aflatin.c, src/autofit/aflatin.h
(af_latin_script_class): Fix type.

* src/autofit/rules.mk (AUTOF_DRV_SRC): Fix typo.

Formatting.
2005-03-02 11:24:23 +00:00
David Turner b9c22aff61 * 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
2005-03-01 15:48:29 +00:00
David Turner e664efaddd * 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
2004-06-04 17:41:59 +00:00
Werner Lemberg 8bb07e6386 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.
2004-03-27 08:43:17 +00:00
Werner Lemberg dfa46199d2 * Jamfile, vms_make.com, builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype/vcproj, include/freetype/ftmoderr.h:
Add LZW module.

* Jamfile.in: Removed.

* docs/CHANGES: Updated.

* include/freetype/internal/ftobjs.h: s/MIN/FT_MIN/, s/MAX/FT_MAX/,
s/ABS/FT_ABS/.  Updated all callers.

* src/type1/t1load.c (parse_dict), src/pcf/pcfdrivr.c
(PCF_Face_Init): Use FT_ERROR_BASE.



Add support for PCF fonts compressed with LZW (extension .pcf.Z,
created with `compress').

* include/freetype/config/ftoption.h, devel/ftoption.h
(FT_CONFIG_OPTION_USE_LZW): New macro.

* include/freetype/ftlzw.h: New file.
* include/freetype/config/ftheader.h (FT_LZW_H): New macro for
ftlzw.h.

* src/lzw/*: New files.

* src/pcf/pcfdrivr.c: Include FT_LZW_H.
(PCF_Face_Init): Try LZW also.

* src/gzip/ftgzip.c: s/0/Gzip_Err_Ok/ where appropriate.
Beautify.
2004-03-05 09:26:24 +00:00
David Turner 9bfbf79c9f adding support for dummy script, i.e. no-hinting for non latin glyphs 2004-02-23 21:08:37 +00:00
David Turner 1029ed26af * 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 !!
2004-02-23 20:40:30 +00:00
David Turner f546bacdcf * src/sfnt/Jamfile: removing "ttcmap" from the list of sources
* src/cache/*, include/freetype/cache/*: fixing a bug after heavy
        testing. The current sources are now "release candidates" for the
        final version of the cache sub-system

        * Jamfile: updating "refdoc" target, and adding "autohint" to the
        list of modules to build. Both the autohinter and autofitter will be
        built by default. But which one will be used is determined by
        the content of "ftmodule.h"

        * src/autofit/*: much updates, but the code is still buggy as hell.
        Aargh..
2004-02-01 16:59:06 +00:00
David Turner 8ccb4552a9 updates 2004-01-16 09:51:00 +00:00
David Turner cf2c49c80c * fixed compilation problems in the cache sub-system
* partial updates to src/autofit
2003-12-24 18:42:04 +00:00
David Turner 87c0d30fc5 * include/freetype/fttypes.h
src/autofit/afangles.c
        src/autofit/aflatin.c
        src/autohint/ahglyph.c
        src/autohint/ahhint.c
        src/base/ftcalc.c
        src/base/ftgloadr.c
        src/base/ftglyph.c
        src/base/ftobjs.c
        src/base/ftsynth.c
        src/base/fttrigon.c
        src/cff/cffgload.c
        src/cid/cidgload.c
        src/cid/cidload.c
        src/pfr/pfrgload.c
        src/pfr/pfrload.c
        src/pfr/pfrsbit.c
        src/psaux/psobjs.c
        src/pshinter/pshalgo.c
        src/pshinter/pshglob.c
        src/pshinter/pshrec.c
        src/raster/ftrend1.c
        src/sfnt/ttcmap0.c
        src/smooth/ftsmooth.c
        src/truetype/ttdriver.c
        src/truetype/ttgload.c
        src/truetype/ttinterp.c
        src/truetype/ttobjs.c
        src/type1/t1gload.c
        src/winfonts/winfnt.c:

          use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler
          warnings with very pedantic compilers. Hints:  (x) & -64 will
          warn if (x) is not signed.. use (x) & ~63 instead !
2003-12-24 01:10:46 +00:00
David Turner 57ecae22a7 new version of the cache sub-system - still under debugging 2003-12-19 21:23:58 +00:00
David Turner ff9d2415a7 * src/autofit/*: more updates 2003-11-23 21:39:51 +00:00
David Turner d25ad56d78 * 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
2003-10-02 21:07:10 +00:00