chromium/src/third_party/freetype2.git
15 months agoMinor. HEAD master VER-2-4-12-beta
Werner Lemberg [Mon, 29 Apr 2013 21:04:57 +0000 (23:04 +0200)]
Minor.

15 months agoREADME: Improved.
Werner Lemberg [Sat, 27 Apr 2013 07:46:10 +0000 (09:46 +0200)]
README: Improved.

15 months agodocs/CHANGES: Add ftdemo changes.
Werner Lemberg [Sat, 27 Apr 2013 06:09:35 +0000 (08:09 +0200)]
docs/CHANGES: Add ftdemo changes.

15 months ago* docs/CHANGES: Updated.
Werner Lemberg [Fri, 26 Apr 2013 12:10:12 +0000 (14:10 +0200)]
* docs/CHANGES: Updated.

16 months ago[cff] Add a new Type 2 interpreter and hinter.
Werner Lemberg [Sat, 13 Apr 2013 16:53:28 +0000 (18:53 +0200)]
[cff] Add a new Type 2 interpreter and hinter.

This work, written by Dave Arnold <darnold@adobe.com> and fully
integrated into FreeType by me, is a donation by Adobe in
collaboration with Google.  It is vastly superior to the old CFF
engine, and it will replace it soon.  Right now, it is still off by
default, and you have to explicitly select it using the new
`hinting-engine' property of the cff driver.

For convenience, (most of) the new files are committed separately.

* include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro.
* include/freetype/ftcffdrv.h: New file to access CFF driver
properties.
* include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error
code.
* include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints',
and `cf2interp'.

* src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'.
* src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine'
and `no_stem_darkening'.
* src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'.

* src/cff/cff.c: Include new files.
* src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
`hinting-engine' and `no-stem-darkening' properties (only the Adobe
engine listens to them).
* src/cff/cffgload.c: Include `cf2ft.h'.
(cff_decoder_prepare): Initialize `current_subfont'.
(cff_build_add_point): Handle Adobe engine which uses 16.16
coordinates.
(cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING
separately.
Choose rendering engine based on `hinting_engine' property.
* src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe
engine.
* src/cff/cffobjs.c: Include FT_CFF_DRIVER_H.
(cff_driver_init): Set default property values.

* src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files.

* src/cff/cf2*.*: New files, containing the Adobe engine.

16 months ago[cff] New files for Adobe's Type 2 interpreter and hinting engine.
Werner Lemberg [Sat, 13 Apr 2013 13:02:31 +0000 (15:02 +0200)]
[cff] New files for Adobe's Type 2 interpreter and hinting engine.

16 months ago[cff] Minor code administration issues.
Werner Lemberg [Fri, 12 Apr 2013 19:13:49 +0000 (21:13 +0200)]
[cff] Minor code administration issues.

* src/cff/cffgload.c (check_points): Rename to...
(cff_check_points): ...this and make it FT_LOCAL.
(cff_builder_add_point, cff_builder_add_point1,
cff_builder_start_point, cff_builder_close_contour,
cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data,
cff_free_glyph_data): Make them FT_LOCAL.

* src/cff/cffgload.h: Updated.

16 months agoAdd output bitmap checksums.
Werner Lemberg [Fri, 12 Apr 2013 18:11:38 +0000 (20:11 +0200)]
Add output bitmap checksums.

Use `FT2_DEBUG=bitmap:3' for tracing.

* src/base/md5.c, src/base/md5.h: New files, taken from

  http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5

* include/freetype/internal/fttrace.h: Add `bitmap'.

* src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c'

(FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing,
convert resulting bitmap to a uniform format and compute a checksum.
Use `bitmap' category for the tracing message.

* src/base/rules.mk (BASE_H): Updated.

* docs/LICENSE.TXT: Updated.

16 months agoAdd framework for CFF properties.
Werner Lemberg [Fri, 12 Apr 2013 17:48:06 +0000 (19:48 +0200)]
Add framework for CFF properties.

* include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC7):
New macro.

* src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H.
(cff_property_set, cff_property_get): New function, still empty.
Define `cff_service_properties' service.
Update `cff_services'.

* src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H.
(CFF_SERVICE_PROPERTIES_GET): New macro.
CffModulePIC: Add `cff_service_properties'.

16 months agoFix Savannah bug #38589.
Werner Lemberg [Wed, 3 Apr 2013 05:37:56 +0000 (07:37 +0200)]
Fix Savannah bug #38589.

* src/bdf/bdflib.c (_bdf_readstream): Thinko.

16 months ago* configure: Use egrep, not grep.
Werner Lemberg [Sun, 31 Mar 2013 07:04:38 +0000 (09:04 +0200)]
* configure: Use egrep, not grep.

Problem reported Mojca Miklavec <mojca.miklavec.lists@gmail.com>.

16 months agoTypo.
Werner Lemberg [Fri, 29 Mar 2013 18:37:49 +0000 (19:37 +0100)]
Typo.

16 months ago* include/freetype/ftlcdfil.h: Add description of color filtering.
Werner Lemberg [Fri, 29 Mar 2013 18:35:39 +0000 (19:35 +0100)]
* include/freetype/ftlcdfil.h: Add description of color filtering.

Based on a contribution from Antti S. Lankila <alankila@bel.fi>.

16 months agoTypo.
Werner Lemberg [Sun, 24 Mar 2013 07:37:12 +0000 (08:37 +0100)]
Typo.

17 months agoWhitespace.
Werner Lemberg [Sat, 23 Mar 2013 13:25:43 +0000 (14:25 +0100)]
Whitespace.

17 months ago[autofit] Minor.
Werner Lemberg [Sat, 23 Mar 2013 13:06:54 +0000 (14:06 +0100)]
[autofit] Minor.

* src/autofit/afmodule.c (af_property_set): Typo.
(af_autofitter_init, af_autofitter_done): Use cast.

17 months ago* configure: Automatically test for `gmake' also.
Werner Lemberg [Thu, 21 Mar 2013 21:58:28 +0000 (22:58 +0100)]
* configure: Automatically test for `gmake' also.

Suggested by Mojca Miklavec <mojca.miklavec.lists@gmail.com>.

17 months agoRespect CONFIG_SHELL from the environment.
Peter Breitenlohner [Thu, 21 Mar 2013 18:58:40 +0000 (19:58 +0100)]
Respect CONFIG_SHELL from the environment.

Some large packages using FreeType have to use a broken (deficient)
/bin/sh.  The configure scripts (as generated by Autoconf) are
clever enough to find a better shell and put that one into the
environment variable CONFIG_SHELL.  If that environment variable is
already set the script skips the test and assumes to be already
running under a good shell.

* builds/unix/detect.mk: Honour CONFIG_SHELL.
* builds/unix/unix-def.in (SHELL): Define.

17 months agoMinor.
Werner Lemberg [Thu, 21 Mar 2013 08:07:44 +0000 (09:07 +0100)]
Minor.

17 months agoFix Savannah patch #7971.
Werner Lemberg [Thu, 21 Mar 2013 08:00:27 +0000 (09:00 +0100)]
Fix Savannah patch #7971.

* configure: Handle MAKE environment variable also.

17 months agoFix Savannah bug #38538.
Werner Lemberg [Sun, 17 Mar 2013 21:42:07 +0000 (22:42 +0100)]
Fix Savannah bug #38538.

* builds/amiga/src/base/ftdebug.c, builds/win32/ftdebug.c,
builds/wince/ftdebug.c (FT_Throw): Add function.

17 months agoWhitespace.
Werner Lemberg [Sun, 17 Mar 2013 07:14:46 +0000 (08:14 +0100)]
Whitespace.

17 months agoRemove dead code.
Werner Lemberg [Sun, 17 Mar 2013 07:09:17 +0000 (08:09 +0100)]
Remove dead code.

* src/raster/rastpic.c (ft_raster1_renderer_class_pic_init)
src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init): Do it.

17 months ago* src/pshinter/pshpic.h (GET_PIC): Use correct container.
Werner Lemberg [Sun, 17 Mar 2013 06:44:35 +0000 (07:44 +0100)]
* src/pshinter/pshpic.h (GET_PIC): Use correct container.

17 months ago* include/freetype/ftmoderr.h: Fix commit from 2013-03-11.
Werner Lemberg [Fri, 15 Mar 2013 07:16:25 +0000 (08:16 +0100)]
* include/freetype/ftmoderr.h: Fix commit from 2013-03-11.

The previous version was not backwards compatible.  Reported by
Behdad.

17 months ago*/*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate.
Werner Lemberg [Thu, 14 Mar 2013 16:50:49 +0000 (17:50 +0100)]
*/*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate.

FT_Err_XXX and friends are no longer directly used in the source
code.

17 months agoNew error management macros.
Werner Lemberg [Thu, 14 Mar 2013 14:49:49 +0000 (15:49 +0100)]
New error management macros.

* include/freetype/fterrors.h (FT_ERR_XCAT, FT_ERR_CAT): Move to...
* include/freetype/fttypes.h: ... this file.
(FT_ERR, FT_ERR_EQ, FT_ERR_NEQ, FT_MODERR_EQ, FT_MODERR_NEQ): New
macros.

* include/freetype/freetype.h: Updated.

17 months ago*/*: Use FT_Err_Ok only.
Werner Lemberg [Thu, 14 Mar 2013 10:21:17 +0000 (11:21 +0100)]
*/*: Use FT_Err_Ok only.

This is a purely mechanical conversion.

17 months ago*/*: Use `FT_THROW'.
Werner Lemberg [Thu, 14 Mar 2013 09:27:35 +0000 (10:27 +0100)]
*/*: Use `FT_THROW'.

This is essentially a mechanical conversion, adding inclusion of
`FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
stand-alone compiling modes of the rasterizer modules.

To convert the remaining occurrences of FT_Err_XXX and friends it is
necessary to rewrite the code.  Note, however, that it doesn't harm
if some cases are not handled since FT_THROW is a no-op.

17 months agoIntroduce `FT_THROW' macro.
Werner Lemberg [Wed, 13 Mar 2013 10:06:39 +0000 (11:06 +0100)]
Introduce `FT_THROW' macro.

The idea is to replace code like

  return FT_Err_Foo_Bar;

or

  return CFF_Err_Foo_Bar;

with

  return FT_THROW( Foo_Bar );

The FT_THROW macro has two functions:

  . It hides the module specific prefix.

  . In debug mode, it calls the empty function `FT_Throw' which can
    be thus used to set a breakpoint.

* include/freetype/internal/ftdebug.h (FT_THROW): New macro.
(FT_Throw): New prototype.
* src/base/ftdebug.c (FT_Throw): New function.

17 months agoRemove `FT_KEEP_ERR_PREFIX'.
Werner Lemberg [Tue, 12 Mar 2013 10:42:20 +0000 (11:42 +0100)]
Remove `FT_KEEP_ERR_PREFIX'.

The idea is to always have FT_ERR_PREFIX available internally.

* include/freetype/fterrors.h: Use FT2_BUILD_LIBRARY to guard
undefinition of FT_ERR_PREFIX

* src/gxvalid/gxverror.h, src/otvalid/otverror.h,
src/sfnt/sferrors.h: Updated.

17 months ago[gxvalid] Fix module error.
Werner Lemberg [Mon, 11 Mar 2013 09:11:57 +0000 (10:11 +0100)]
[gxvalid] Fix module error.

* src/gxvalid/gxverror.h (FT_ERR_BASE): Define as
FT_Mod_Err_GXvalid.
* include/freetype/ftmoderr.h: Add module error for `GXvalid'.

17 months agoAlways use module related error codes.
Werner Lemberg [Mon, 11 Mar 2013 08:50:53 +0000 (09:50 +0100)]
Always use module related error codes.

* src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use
`FT_ERROR_BASE'.

* src/type1/t1load.c (parse_encoding): Use
T1_Err_Unknown_File_Format.

17 months agoMinor.
Werner Lemberg [Fri, 8 Mar 2013 20:25:45 +0000 (21:25 +0100)]
Minor.

17 months ago[cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also.
Werner Lemberg [Fri, 8 Mar 2013 20:23:45 +0000 (21:23 +0100)]
[cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also.

* src/cff/cffgload.c (cff_slot_load): Implement it.

17 months ago[base] Fix commit ab02d9e8.
Alexei Podtelezhnikov [Sat, 23 Feb 2013 04:58:57 +0000 (23:58 -0500)]
[base] Fix commit ab02d9e8.

* src/base/ftbbox.c (BBox_Cubic_Check): Change scaling to msb of 22.

18 months ago[base] New bisecting BBox_Cubic_Check (disabled).
Alexei Podtelezhnikov [Wed, 20 Feb 2013 02:27:18 +0000 (21:27 -0500)]
[base] New bisecting BBox_Cubic_Check (disabled).

* src/base/ftbbox.c (BBox_Cubic_Check): New bisecting algorithm
for extremum search built around simple condition that defines
which half contains the extremum.

18 months ago[tools] Update BBox testing tool.
Alexei Podtelezhnikov [Tue, 19 Feb 2013 01:41:56 +0000 (20:41 -0500)]
[tools] Update BBox testing tool.

* src/tools/test_bbox.c: Add another cubic outline with exact BBox.
(REPEAT): Increase the number of benchmarking cycles.
(profile_outline): Tweak output formatting.

18 months agoFix Savannah bug #38235.
Werner Lemberg [Fri, 8 Feb 2013 11:49:41 +0000 (12:49 +0100)]
Fix Savannah bug #38235.

* builds/unix/configure.raw: Don't generate `freetype-config' and
`freetype.pc'.

* builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ,
build_libtool_libs, ft_version): New variables to be substituted.
(freetype-config, freetype.pc): New rules to generate those files.

* builds/unix/freetype-config.in: Remove code for handling `rpath'.
The use of $rpath has been accidentally removed in a patch from
2009-12-22, and apparently noone has missed it since.
Use `%' instead of `@' as a variable substitution marker.
Use quotes.

* builds/unix/freetype.in: Use `%' instead of `@' as a variable
substitution marker.
Use quotes.

18 months ago* src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.
Werner Lemberg [Thu, 7 Feb 2013 18:49:12 +0000 (19:49 +0100)]
* src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.

BTW, Greg agrees that the OpenType specification is missing the list
of GS variables which will always be reset to the default values
after the `prep' table has been executed.

18 months ago* src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.
Werner Lemberg [Wed, 6 Feb 2013 07:47:29 +0000 (08:47 +0100)]
* src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.

Up to now, we simply took a snapshot of the Graphics State after the
`prep' table has been executed, and right before a glyph's bytecode
was run it got reloaded.  However, as Greg Hitchcock has told us in
private communication, reference points get reset to zero in the MS
rasterizer and we follow in due course.  While reasonable, this is
undocumented behaviour.

Most notably, this fixes the rendering of Arial's `x' glyph in
subpixel hinting mode.

18 months ago[truetype] A better fix for Savannah bug #38211.
Werner Lemberg [Tue, 5 Feb 2013 18:23:16 +0000 (19:23 +0100)]
[truetype] A better fix for Savannah bug #38211.

* src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to
MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).

18 months ago[pcf] Streamline parsing of PCF encoding table.
Alexei Podtelezhnikov [Sat, 2 Feb 2013 01:24:00 +0000 (20:24 -0500)]
[pcf] Streamline parsing of PCF encoding table.

* src/pcf/pcfread.c (pcf_get_encodings): Use simpler double for-loop.
Reallocate array instead of using temporary storage.

18 months agoFix Savannah bug #38227.
Werner Lemberg [Fri, 1 Feb 2013 22:45:04 +0000 (23:45 +0100)]
Fix Savannah bug #38227.

* builds/unix/freetype-config.in: Set LC_ALL.

18 months agoFix Savannah bug #38221.
Werner Lemberg [Fri, 1 Feb 2013 13:50:08 +0000 (14:50 +0100)]
Fix Savannah bug #38221.

This complements commit 83c0ebab.

* src/base/ftcalc.c (FT_MulDiv_No_Round): Don't enclose with
`TT_USE_BYTECODE_INTERPRETER'.

18 months ago[truetype] Fix Savannah bug #38211.
Werner Lemberg [Fri, 1 Feb 2013 11:55:44 +0000 (12:55 +0100)]
[truetype] Fix Savannah bug #38211.

* src/truetype/ttinterp.c (Ins_IP): Make FreeType behave identical
to other interpreters if rp1 == rp2 (which is invalid).

18 months agoImprove comments.
Alexei Podtelezhnikov [Thu, 31 Jan 2013 01:14:18 +0000 (20:14 -0500)]
Improve comments.

18 months agoAdd an important comment.
Alexei Podtelezhnikov [Tue, 29 Jan 2013 03:29:51 +0000 (22:29 -0500)]
Add an important comment.

Thanks to Hin-Tak Leung for the analysis.

18 months agoFormatting, comment improvements.
Werner Lemberg [Mon, 28 Jan 2013 12:56:23 +0000 (13:56 +0100)]
Formatting, comment improvements.

18 months ago[base] Small optimization of BBox calculation.
Alexei Podtelezhnikov [Mon, 28 Jan 2013 11:35:19 +0000 (06:35 -0500)]
[base] Small optimization of BBox calculation.

* src/base/ftbbox.c (BBox_Cubic_Check): Use FT_MSB function in
scaling algorithm.

18 months ago[truetype] Minor formatting fix.
Infinality [Sat, 26 Jan 2013 23:40:44 +0000 (17:40 -0600)]
[truetype] Minor formatting fix.

18 months ago[truetype] Fix rasterizer_version logic in sph.
Infinality [Sat, 26 Jan 2013 23:05:40 +0000 (17:05 -0600)]
[truetype] Fix rasterizer_version logic in sph.

18 months ago[truetype] Align more to ClearType whitepaper for sph.
Infinality [Sat, 26 Jan 2013 18:29:52 +0000 (12:29 -0600)]
[truetype] Align more to ClearType whitepaper for sph.

18 months ago[base] Fix broken emboldening at small sizes.
Alexei Podtelezhnikov [Sat, 26 Jan 2013 04:33:00 +0000 (23:33 -0500)]
[base] Fix broken emboldening at small sizes.

* src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to
normalize zero-length vectors.

18 months agoFix Savannah bug #38167.
Werner Lemberg [Fri, 25 Jan 2013 15:41:24 +0000 (16:41 +0100)]
Fix Savannah bug #38167.

This fixes commit 83c0ebab from 2012-06-27.

* src/truetype/ttinterp.h:
s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.

18 months ago[sfnt] Fix broken pointer overflow checks.
Xi Wang [Thu, 24 Jan 2013 23:57:09 +0000 (00:57 +0100)]
[sfnt] Fix broken pointer overflow checks.

Many compilers such as gcc and clang optimize away pointer overflow
checks `p + n < p', because pointer overflow is undefined behavior.
Use a safe form `n > p_limit - p' instead.

Also avoid possible integer overflow issues, for example, using
`num_glyphs > ( p_limit - p ) / 2' rather than `num_glyphs * 2'
given a large `num_glyphs'.

* src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Implement it.

18 months agoFix `make multi'
Werner Lemberg [Thu, 24 Jan 2013 23:40:56 +0000 (00:40 +0100)]
Fix `make multi'

* src/base/ftoutln.c, src/base/fttrigon.c: Include
FT_INTERNAL_CALC_H.

18 months ago[truetype] Fix C++ compilation.
David 'Digit' Turner [Thu, 24 Jan 2013 23:36:35 +0000 (00:36 +0100)]
[truetype] Fix C++ compilation.

* src/truetype/ttsubpix.h: Updated.
(SPH_X_SCALING_RULES_SIZE): Moved and renamed to...
* src/truetype/ttsubpix.c (X_SCALING_RULES_SIZE): This.
(sph_X_SCALING_Rules): Removed.
(scale_test_tweak): Make function static.
(sph_test_tweak_x_scaling): New function.

* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Updated.

18 months agoRemove trailing whitespace.
Werner Lemberg [Thu, 24 Jan 2013 12:33:06 +0000 (13:33 +0100)]
Remove trailing whitespace.

18 months ago[base] Make `FT_Hypot' really internal.
Werner Lemberg [Thu, 24 Jan 2013 08:12:56 +0000 (09:12 +0100)]
[base] Make `FT_Hypot' really internal.

* include/freetype/fttrigon.h (FT_Hypot): Move to...
* include/freetype/internal/ftcalc.h: This file.

* src/base/fttrigon.c (FT_Hypot): Move to...
* src/base/ftcalc.c: This file.
Include FT_TRIGONOMETRY_H.

* src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H.

18 months agoMinor.
Werner Lemberg [Thu, 24 Jan 2013 07:45:29 +0000 (08:45 +0100)]
Minor.

18 months ago[truetype] Revert change from 2013-01-22.
Werner Lemberg [Thu, 24 Jan 2013 07:39:43 +0000 (08:39 +0100)]
[truetype] Revert change from 2013-01-22.

FreeType's `height' value is the baseline-to-baseline distance...

* src/truetype/ttobjs.c (tt_size_reset): Undo.

18 months ago[base, truetype] New internal FT_Hypot function.
Alexei Podtelezhnikov [Thu, 24 Jan 2013 04:31:41 +0000 (23:31 -0500)]
[base, truetype] New internal FT_Hypot function.

* include/freetype/fttrigon.h (FT_Hypot): Declare it.
* src/base/fttrigon.c (FT_Hypot): Define it.
* src/truetype/ttgload.c (TT_Process_Composite_Component): Use it
instead of explicit expressions.
* src/truetype/ttinterp.c (Current_Ratio, Normalize): Use it instead
of TT_VecLen.
(TT_VecLen): Removed.

18 months agoTypo.
Alexei Podtelezhnikov [Thu, 24 Jan 2013 04:09:59 +0000 (23:09 -0500)]
Typo.

18 months ago[base] Fix integer overflow.
Alexei Podtelezhnikov [Thu, 24 Jan 2013 01:11:40 +0000 (20:11 -0500)]
[base] Fix integer overflow.

* src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
outgoing vectors and use fixed point arithmetic.

18 months ago[base] Fix integer overflow.
Alexei Podtelezhnikov [Thu, 24 Jan 2013 00:51:28 +0000 (19:51 -0500)]
[base] Fix integer overflow.

* src/base/ftoutln.c (FT_Outline_Get_Orientation): Scale the
coordinates down to avoid overflow.

18 months ago[base] Split out MSB function.
Alexei Podtelezhnikov [Thu, 24 Jan 2013 00:43:28 +0000 (19:43 -0500)]
[base] Split out MSB function.

* src/base/fttrigon.c (ft_trig_prenorm): Borrow from here.
* include/freetype/internal/ftcalc.h (FT_MSB): Declare here.
* src/base/ftcalc.c (FT_MSB): Define here.

18 months ago[truetype] Fix font height.
Werner Lemberg [Tue, 22 Jan 2013 10:07:07 +0000 (11:07 +0100)]
[truetype] Fix font height.

* src/truetype/ttobjs.c (tt_size_reset): The Windows rendering
engine uses rounded values of the ascender and descender to compute
the TrueType font height.

19 months agoMinor.
Werner Lemberg [Wed, 16 Jan 2013 19:08:35 +0000 (20:08 +0100)]
Minor.

19 months ago[sfnt] Fix optimized sbit loader.
Werner Lemberg [Wed, 16 Jan 2013 18:56:08 +0000 (19:56 +0100)]
[sfnt] Fix optimized sbit loader.

It was not taking bit_depth into consideration when blitting!

* src/sfnt/ttsbit0.c (tt_sbit_decoder_load_byte_aligned,
* tt_sbit_decoder_load_bit_aligned): Handle bit
depth.

19 months ago[truetype] Improve sub-pixel code.
David Turner [Wed, 16 Jan 2013 18:48:31 +0000 (19:48 +0100)]
[truetype] Improve sub-pixel code.

This patches fixes many issues with the ttsubpix implementation.

1. Data tables are defined, instead of declared, in the header, and
   thus copied into each source file that includes it.

2. These tables were defined as global, mutable, visible variables,
   and thus costing private RAM to every process that loads the
   library (> 50 KB / process, this is huge!).

   Additionally, this also made the library export the symbols
   completely needlessly.

3. Missing `sph_' and `SPH_' prefixes to some of the definitions.

Note that this doesn't try to fix the incredibly inefficient storage
format for the data tables used by the code.  This one will require
another pass in the future.

* src/truetype/ttinterp.h (MAX_NAME_SIZE, MAX_CLASS_MEMBERS):
Renamed to...
(SPH_MAX_NAME_SIZE, SPH_MAX_CLASS_MEMBERS): This.
Update all users.

(SPH_TweakRule, SPH_ScaleRule): Decorate with `const' where
appropriate.

(Font_Class): Rename to...
(SPH_Font_Class): This.  Decorate with `const' where appropriate.

* src/truetype/ttsubpix.h (scale_test_tweak, sph_test_tweak):
Decorate arguments with `const' where appropriate.

Move font tweaking tables to...

* src/truetype/ttsubpic.c: This file and decorate them with `static'
and `const' where appropriate.

(X_SCALING_Rules, X_SCALING_RULES_SIZE): Renamed to...
(spu_X_SCALING_Rules, SPH_X_SCALING_RULES_SIZE): This.
Update all users.

19 months ago[truetype] Improve accuracy of normalization of short vectors.
Alexei Podtelezhnikov [Sun, 13 Jan 2013 04:05:55 +0000 (23:05 -0500)]
[truetype] Improve accuracy of normalization of short vectors.

Unit vector components are stored as 2.14 fixed-point numbers. In
order to calculate all 14 bits accurately, a short vector to be
normalized has to be upscaled to at least 14 bits before its length
is calculated. This has been safe since accurate CORDIC algorithms
were adopted.

* src/truetype/ttinterp.c (Normalize): Scale short vectors by 0x4000.

19 months ago[truetype] Kill very old vector normalization hacks.
Alexei Podtelezhnikov [Sun, 13 Jan 2013 03:36:37 +0000 (22:36 -0500)]
[truetype] Kill very old vector normalization hacks.

Back in the days, vector length calculations were not very accurate
and the vector normalization function, Normalize, had to meticulously
correct the errors for long vectors [commit b7ef2b096867]. It was no
longer necessary after accurate CORDIC algorithms were adopted, but
the code remained. It is time to kill it.

* src/truetype/ttinterp.c (Normalize): Remove error compensation.
(TT_VecLen): Remove any mention of old less accurate implementation.

19 months agoCall it fixed-point.
Alexei Podtelezhnikov [Sun, 13 Jan 2013 00:17:05 +0000 (19:17 -0500)]
Call it fixed-point.

19 months agoDisable FT_CONFIG_OPTION_OLD_INTERNALS.
Werner Lemberg [Fri, 11 Jan 2013 08:02:22 +0000 (09:02 +0100)]
Disable FT_CONFIG_OPTION_OLD_INTERNALS.

After the next release we are going to remove the code completely.

* devel/ftoption.h, include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_OLD_INTERNALS): Comment out.
* docs/CHANGES: Document it.

19 months agoTypos, whitespace.
Werner Lemberg [Fri, 11 Jan 2013 07:29:22 +0000 (08:29 +0100)]
Typos, whitespace.

19 months ago[base] Update the overflow protection bit.
Alexei Podtelezhnikov [Fri, 11 Jan 2013 03:29:07 +0000 (22:29 -0500)]
[base] Update the overflow protection bit.

The recent optimizations of CORDIC iterations drastically reduce
the expansion factor. The vector components with MSB of 29 are now
safe from overflow.

* src/base/fttrigon.c (FT_TRIG_SAFE_MSB): New macro.
(ft_trig_prenorm): Use it and remove dead code.

19 months agoMinor comment improvements.
Werner Lemberg [Thu, 10 Jan 2013 19:16:20 +0000 (20:16 +0100)]
Minor comment improvements.

19 months ago[base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability.
Alexei Podtelezhnikov [Wed, 9 Jan 2013 05:25:32 +0000 (00:25 -0500)]
[base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability.

* src/base/ftbbox.c: Updated.
* src/base/ftobjs.c: Updated.
* src/base/fttrigon.c: Updated.
* src/pshinter/pshalgo.c: Updated.
* src/pshinter/pshrec.c: Updated.

19 months ago[base] Clean up trigonometric core.
Alexei Podtelezhnikov [Wed, 9 Jan 2013 04:29:44 +0000 (23:29 -0500)]
[base] Clean up trigonometric core.

* src/base/fttrigon.c: Document the algorithm in a large comment.
(FT_TRIG_COSCALE): Remove macro.
(FT_Tan: Use `FT_TRIG_SCALE' instead.
(FT_Cos, FT_Vector_Unit): Ditto and round the return values.

19 months ago[base] Use rounding in CORDIC iterations.
Alexei Podtelezhnikov [Thu, 3 Jan 2013 04:45:14 +0000 (23:45 -0500)]
[base] Use rounding in CORDIC iterations.

* src/base/fttrigon.c (ft_trig_pseudo_rotate,
ft_trig_pseudo_polarize): Improve accuracy by rounding.

19 months ago[base] Reduce trigonometric algorithms.
Alexei Podtelezhnikov [Thu, 3 Jan 2013 03:21:37 +0000 (22:21 -0500)]
[base] Reduce trigonometric algorithms.

After we get within 45 degrees by means of true 90-degree rotations,
we can remove initial 45-degree CORDIC iteration and start from
atan(1/2) pseudorotation, reducing expansion factor thereby.

* src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macros.
(ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Update.

* src/tools/cordic.py: Bring up to date with trigonometric core.

* docs/CHANGES: Old typo.

19 months ago* src/pshinter/pshalgo.h: Remove unused code.
Alexei Podtelezhnikov [Thu, 3 Jan 2013 01:31:56 +0000 (20:31 -0500)]
* src/pshinter/pshalgo.h: Remove unused code.

19 months ago* src/truetype/ttgload.c (tt_loader_init): Add more tracing.
Werner Lemberg [Thu, 27 Dec 2012 00:08:24 +0000 (01:08 +0100)]
* src/truetype/ttgload.c (tt_loader_init): Add more tracing.

19 months ago[type1] Fix handling of /FontBBox in MM fonts.
Werner Lemberg [Sun, 23 Dec 2012 20:14:37 +0000 (21:14 +0100)]
[type1] Fix handling of /FontBBox in MM fonts.
Problem reported by Del Merritt <del@alum.mit.edu>

If we have

  /FontBBox { { 11 12 13 14 15 16 17 18 }
              { 21 22 23 24 25 26 27 28 }
              { 31 32 33 34 35 36 37 38 }
              { 41 42 43 44 45 46 47 48 } }

in the /Blend dictionary,  then the first BBox is { 11 21 31 41 },
the second { 12 22 32 42 }, etc.

* include/freetype/internal/psaux.h (T1_FieldType): Add
`T1_FIELD_TYPE_MM_BBOX' (for temporary use).

* src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
Implement it.

19 months agoFormatting, minor internal documentation improvement.
Werner Lemberg [Sun, 23 Dec 2012 17:30:34 +0000 (18:30 +0100)]
Formatting, minor internal documentation improvement.

20 months ago* src/tools/cordic.py: Bring up to date with trigonometric core.
Alexei Podtelezhnikov [Fri, 21 Dec 2012 19:20:25 +0000 (14:20 -0500)]
* src/tools/cordic.py: Bring up to date with trigonometric core.

20 months agoCheck parameters of `FT_Outline_New'.
Werner Lemberg [Fri, 21 Dec 2012 15:45:27 +0000 (16:45 +0100)]
Check parameters of `FT_Outline_New'.
Problem reported by Robin Watts <robin.watts@artifex.com>.

* src/base/ftoutln.c (FT_Outline_New_Internal): Ensure that
`numContours' and `numPoints' fit into FT_Outline's `n_points' and
`n_contours', respectively.

20 months ago* Version 2.4.11 released. VER-2-4-11
Werner Lemberg [Thu, 20 Dec 2012 07:31:56 +0000 (08:31 +0100)]
* Version 2.4.11 released.
==========================

Tag sources with `VER-2-4-11'.

* docs/CHANGES, docs/release: Updated.

* docs/VERSION.DLL: Update documentation and bump version number to
2.4.11.

* README, Jamfile (RefDoc),
builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj,
builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
builds/win32/visualce/freetype.vcproj,
builds/win32/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.4.10/2.4.11/, s/2410/2411/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.

* builds/unix/configure.raw (version_info): Set to 16:0:10.

* builds/toplevel.mk (dist): Don't include `.mailmap'.

20 months ago[base] Improve trigonometric core.
Alexei Podtelezhnikov [Thu, 20 Dec 2012 06:03:22 +0000 (01:03 -0500)]
[base] Improve trigonometric core.

FreeType used to rely on a 24-step iteration CORDIC algorithm to
calculate trigonometric functions and rotate vectors. It turns out
that once the vector is in the right half-plane, the initial rotation
by 63 degrees is not necessary. The algorithm is perfectly capable
to converge to any angle starting from the second 45 degree rotation.
This patch removes the first rotation and makes it a 23-step CORDIC
algorithm.

* src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macro
values.
(ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Remove initial
rotation.

20 months ago* src/base/ftobjs.c (ft_property_do): Fix compiler warning.
Werner Lemberg [Thu, 20 Dec 2012 05:08:23 +0000 (06:08 +0100)]
* src/base/ftobjs.c (ft_property_do): Fix compiler warning.

20 months agoFormatting.
Werner Lemberg [Thu, 20 Dec 2012 05:07:33 +0000 (06:07 +0100)]
Formatting.

20 months ago* src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters.
Alexei Podtelezhnikov [Thu, 20 Dec 2012 04:05:32 +0000 (23:05 -0500)]
* src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters.

20 months ago[base] Clean up trigonometric core.
Alexei Podtelezhnikov [Thu, 20 Dec 2012 03:46:27 +0000 (22:46 -0500)]
[base] Clean up trigonometric core.

* src/base/fttrrigon.c (ft_trig_pseudo_polarize): Align algorithm
with `ft_trig_pseudo_rotate'.

20 months ago[truetype] Minor performance enhancement.
Infinality [Tue, 18 Dec 2012 13:23:09 +0000 (07:23 -0600)]
[truetype] Minor performance enhancement.

20 months ago[truetype] Remove unusued code and variables.
Infinality [Tue, 18 Dec 2012 01:17:30 +0000 (19:17 -0600)]
[truetype] Remove unusued code and variables.

20 months agoVarious compiler warning fixes.
Werner Lemberg [Mon, 17 Dec 2012 08:08:09 +0000 (09:08 +0100)]
Various compiler warning fixes.

* include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use
`logical not' operator instead of negation.  The idea is that `~'
returns exactly the data type enforced by the cast to a pointer (be
it 32bit or 64bit or whatever), while a negative integer has not
this flexibility.
* src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto.
* src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto.
* src/type/t1load.c (T1_Get_MM_Var): Ditto.
(parse_blend_axis_types): Use cast.
* src/bdf/bdflib.c (_bdf_readstream): Use cast.

20 months agoMerge branch 'master' of ssh://git.sv.nongnu.org/srv/git/freetype/freetype2
Infinality [Mon, 17 Dec 2012 02:02:42 +0000 (20:02 -0600)]
Merge branch 'master' of ssh://git.sv.nongnu.org/srv/git/freetype/freetype2

Conflicts:
src/truetype/ttinterp.c

20 months ago[truetype ] Remove unusued code. Add minor fixes.
Infinality [Mon, 17 Dec 2012 01:52:01 +0000 (19:52 -0600)]
[truetype ] Remove unusued code.  Add minor fixes.

20 months ago[truetype] Remove dead code.
Alexei Podtelezhnikov [Mon, 17 Dec 2012 01:19:56 +0000 (20:19 -0500)]
[truetype] Remove dead code.