Commit Graph

2482 Commits

Author SHA1 Message Date
Just Fill Bugs 07598339f7 Fix Savannah bug #33246.
* src/truetype/ttobjs.c (tt_check_single_notdef): New function.
(tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE.
2011-07-02 18:41:36 +02:00
Werner Lemberg 9ae6c7c54d * docs/CHANGES: Updated. 2011-07-02 12:15:10 +02:00
David Bevan aecbfe1ba7 [ftstroke] Major revision.
The main problems
-----------------

  o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter
    joins (not bevel joins) were generated.  Indeed, the meanings of
    `miter' and `bevel' were incorrectly reversed (consistently) in
    both the code and comments.

  o The way bevel joins were constructed (whether specified
    explicitly, or created as a result of exceeding the miter limit)
    did not match what is required for stroked text in PostScript or
    PDF.

The main fixes
--------------

  o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected.

  o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been
    introduced to support PostScript and PDF miter joins.

  o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an
    alias for FT_STROKER_LINEJOIN_MITER.

Additionally, a variety of stroking errors have been fixed.  These
would cause various artifacts (including points `at infinity'),
especially when stroking poor quality fonts.

See

  http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html

for example documents.  The FreeType stroker now produces results
very similar to that produced by GhostScript and Distiller for these
fonts.

Other problems
--------------

The following problems have been resolved:

  o Inside corners could be generated incorrectly.  Intersecting the
    inside corner could cause a missing triangular area and other
    effects.

    The intersection point can only be used if the join is between
    two lines and both lines are long enough.  The `optimization'
    condition in `ft_stroker_inside' has been corrected; this
    requires the line length to be passed into various functions and
    stored in `FT_StrokerRec'.

  o Incorrect cubic curves could be generated.  The angle
    calculations in `FT_Stroker_CubicTo' have been corrected to
    handle the case of the curve crossing the +/-PI direction.

  o If the border radius was greater than the radius of curvature of
    a curve, then the negative sector would end up outside (not
    inside) the border.  This situation is now recognized and the
    negative sector is circumnavigated in the opposite direction.
    (If round line joins are being used, this code is disabled
    because the line join will always cover the negative sector.)

  o When a curve is split, the arcs may not join smoothly (especially
    if the curve turns sharply back on itself).  Changes in
    direction between adjacent arcs were not handled.  A round
    corner is now added if the deviation from one arc to the next is
    greater than a suitable threshold.

  o The current direction wasn't retained if a the outline contained
    a zero length lineto or a curve that was determined to be
    `basically a point'.  This could cause a spurious join to be
    added.

  o Cubics with close control points could be mishandled.  All eight
    cases are now distinguished correctly.

Other improvements
------------------

o Borders for cubic curves could be too `flat'.
  FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent
  this.

o The handling and use of movable points has been simplified a
  little.

o Various values are now computed only if the results are actually
  needed.

o The directions of the outer and inner borders have been swapped,
  as recommended by Graham Asher.

* src/base/ftstroke.c: Revised.
* include/freetype/ftstroke.h: Updated.
2011-07-02 12:09:52 +02:00
Werner Lemberg ee5d3b5947 * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'. 2011-06-30 15:08:15 +02:00
Werner Lemberg 54f187ab1a Document last commit. 2011-06-29 10:01:42 +02:00
Werner Lemberg 96ddc679be Fix Savannah bug #33663.
* src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for
ENCODING correctly.
2011-06-29 09:15:54 +02:00
Werner Lemberg da9dbf89c8 * Version 2.4.5 released.
=========================

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

* docs/CHANGES: Updated.

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

* 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.4/2.4.5/, s/244/245/.

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

* builds/unix/configure.raw (version_info): Set to 13:0:7.
2011-06-25 07:16:22 +02:00
Werner Lemberg 3ae2c70dc6 Minor documentation fixes. 2011-06-24 13:18:41 +02:00
Werner Lemberg 397461947c Merge branch 'master' of git.sv.gnu.org:/srv/git/freetype/freetype2
Conflicts:
	ChangeLog
2011-06-20 19:20:50 +02: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
suzuki toshiya c7e8028f3f [gxvalid] make the `prop' validation tracing verbose.
* src/gxvalid/gxvprop.c: Add tracing messages for errors.
2011-06-19 23:00:11 +09:00
suzuki toshiya c63c6f7265 [autogen.sh] Reflect environment variable LIBTOOLIZE. 2011-06-19 22:54:40 +09:00
Werner Lemberg ea79b84621 Update license documentation.
* docs/GPL.TXT: Renamed to...
* docs/GPLv2.TXT: This.

* docs/LICENSE.TXT: Updated.
2011-06-18 08:06:57 +02:00
suzuki toshiya e62c876bb0 Fix g++4.6 compiler warnings in module drivers.
The background is same with previous commit.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints):
Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
`delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* src/cff/cffdrivr.c (cff_ps_get_font_info): Init
`font_info'.
* src/cff/cffload.c (cff_index_get_pointers): Init `t'.
(cff_font_load): Init `sub'.
* src/cff/cffobjs.c (cff_size_init): Init `internal'.
(cff_face_init): Init `cff'.
* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
Init `snaps'.
* src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
(pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
Init `tmpEncoding'.
* src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
* src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
* src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
* src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
`zip_buff'.
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
2011-06-15 02:48:33 +09:00
suzuki toshiya dc185ee2c2 Fix misleading comment, s/buffer allocator/FT_NEW() families/g 2011-06-15 02:36:52 +09:00
suzuki toshiya 65a449887d [base] Fix g++4.6 compiler warnings in src/base/*.c.
Passing uninitialized pointer to the buffer allocator is
not problematic theoretically (as far as the returned
pointer is checked before writing), but g++4.6 dislikes
it and warns by -Wuninitialized.  Initialize them by NULL.

* src/base/ftobjs.c (FT_Stream_New): Init `stream'.
(new_memory_stream): Ditto.
(FT_New_GlyphSlot): Init `slot'.
(FT_CMap_New): Init `cmap'.
(open_face_PS_from_sfnt_stream): Init `sfnt_ps'.
(Mac_Read_POST_Resource): Init `pfb_data'.
(Mac_Read_sfnt_Resource): Init `sfnt_data'.
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets):
Init `offsets_internal' and `ref'.
(raccess_guess_darwin_hfsplus): Init `newpath'.
(raccess_guess_darwin_newvfs): Ditto.
* src/base/ftbitmap.c (ft_bitmap_assure_buffer):
Init `buffer'.
* src/base/ftstroke.c (FT_Stroker_New): Init `stroker'.
2011-06-15 01:44:24 +09:00
suzuki toshiya 75b91a49aa [gxvalid] Cleanup.
Some invalid, overrunning, unrecommended non-zero values
are cared in paranoid validation mode only.  There are
many lines looking like:

  if ( valid->root->level >= FT_VALIDATE_PARANOID )
    FT_INVALID_xxx;

To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is
introduced for more paranoid validation in future.

* src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION):
New macro to assure valid->root->level is more or
equal to FT_VALIDATE_PARANOID.  (GXV_SET_ERR_IF_PARANOID):
New macro to raise an error if in paranoid validation.
* src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID().
* src/gxvalid/gxvfeat.c: Ditto.
* src/gxvalid/gxvjust.c: Ditto.
* src/gxvalid/gxvkern.c: Ditto.
* src/gxvalid/gxvmort.c: Ditto.
* src/gxvalid/gxvmort0.c: Ditto.
* src/gxvalid/gxvmort1.c: Ditto.
* src/gxvalid/gxvmort2.c: Ditto.
* src/gxvalid/gxvmorx1.c: Ditto.
* src/gxvalid/gxvmorx2.c: Ditto.
2011-06-15 01:12:04 +09:00
suzuki toshiya f6f9b66781 [gxvalid] Fix gcc4.6 compiler warnings in gxvtrak.c.
* src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate):
Check different entries pointing same traking value.
(gxv_trak_validate): Remove unused variable `table_size'.
2011-06-14 23:55:57 +09:00
suzuki toshiya 05fc72c5c7 [gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.

* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.

* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.

* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.

* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array.  (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 23:54:10 +09:00
suzuki toshiya 56be3ac9b1 [gxvalid] Fix gcc4.6 compiler warnings in gxvmort*.c.
* src/gxvalid/gxvmort.c (gxv_mort_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_mort_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.

* src/gxvalid/gxmort0.c
(gxv_mort_subtable_type0_entry_validate): Check the
conflict of the marks for the glyphs.

* src/gxvalid/gxmort1.c
(gxv_mort_subtable_type1_offset_to_subst_validate):
Local variables `min_gid', `max_gid' are replaced by
variables in the validator.
(gxv_mort_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
(gxv_mort_subtable_type1_substTable_validate):
Validate the GID by the min/max GIDs in the validator.

* src/gxvalid/gxvmort2.c
(gxv_mort_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_mort_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance'.
(gxv_mort_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.

* src/gxvalid/gxvmort5.c
(gxv_mort_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array.  (gxv_mort_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 23:53:12 +09:00
suzuki toshiya 20c126c1ac [gxvalid] Fix gcc4.6 compiler warnings in gxvkern.c.
* src/gxvalid/gxvkern.c
(gxv_kern_subtable_fmt0_pairs_validate): Conditionalize
unvalidated variable `kernValue'.
(gxv_kern_subtable_fmt1_entry_validate): Conditionalize
unvalidated variables; `push', `dontAdvance', `kernAction',
`kernValue'.
(gxv_kern_coverage_new_apple_validate): Conditionalize
trace-only variables; `kernVertical', `kernCrossStream',
`kernVariation'.
(gxv_kern_coverage_classic_apple_validate): Conditionalize
trace-only variables; `horizontal', `cross_stream'.
(gxv_kern_coverage_classic_microsoft_validate):
Conditionalize trace-only variables; `horizontal',
`minimum', `cross_stream', `override'.
(gxv_kern_subtable_validate): Conditionalize trace-only
variables; `version', `tupleIndex'.
2011-06-14 23:50:39 +09:00
suzuki toshiya ce015ec8da [gxvalid] Fix gcc4.6 compiler warnings in gxvjust.c.
* src/gxvalid/gxvjust.c (gxv_just_check_max_gid):
New function to unify the checks of too large GID.
(gxv_just_wdp_entry_validate): Conditionalize unvalidated
variables; `beforeGrowLimit', `beforeShrinkGrowLimit',
`afterGrowLimit', `afterShrinkGrowLimit', `growFlags',
`shrinkFlags'.  Additional check for non-zero values in
unused storage `justClass' is added.
(gxv_just_actSubrecord_type0_validate): Conditionalize
unvalidated variable `order'.  GID is checked by
gxv_just_check_max_gid().  Additional check for upside-down
relationship between `lowerLimit' and `upperLimit' is added.
(gxv_just_actSubrecord_type1_validate): GID is checked by
gxv_just_check_max_gid().
(gxv_just_actSubrecord_type2_validate): Conditionalize
unvalidated variable `substThreshhold'.  GID is checked by
gxv_just_check_max_gid().
(gxv_just_actSubrecord_type5_validate): GID is checked by
gxv_just_check_max_gid().
(gxv_just_classTable_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance',
`markClass', `currentClass'.
2011-06-14 23:49:34 +09:00
suzuki toshiya 248aa63973 [gxvalid] Preparation to fix gcc4.6 compiler warnings.
* src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to
conditionalize the variable which is only used for trace messages.
Automatically set by FT_DEBUG_LEVEL_TRACE.
(GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of
unvalidated variables.  Undefined by default to calm gcc4.6 warning.
(GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined
GID ranges, for the comparison of GID ranges in different subtables.
2011-06-14 23:47:21 +09: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 fe0f16d295 Fix comments. 2011-06-01 10:36:04 +02:00
Werner Lemberg 849bde1fa0 Merge branch 'master' of git.sv.gnu.org:/srv/git/freetype/freetype2
Conflicts:
	ChangeLog
2011-05-30 07:29:04 +02:00
Werner Lemberg 6b19fd5c14 Fix g++ 4.6 compilation.
* src/autofit/afhints.c (af_glyph_hints_dump_segments,
af_glyph_hints_dump_edges): Use cast.
2011-05-30 07:27:59 +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
suzuki toshiya c32d54c949 [mac] Conditionalize the inclusion of "AvailabilityMacros.h".
The native SDK on earliest Mac OS X (10.0-10.1) did not have
"AvailabilityMacros.h".  To prevent the inclusion of missing
header file, ECANCELED (introduced in 10.2) in POSIX header
file <errno.h> is checked to detect the system version.

* include/freetype/config/ftconfig.h: Conditionalize the
inclusion of "AvailabilityMacros.h".
* builds/unix/ftconfig.in: Ditto.
* builds/vms/ftconfig.h: Ditto.
2011-05-29 01:33:34 +09: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
Daniel Zimmermann 3ad8f35537 Reduce warnings for MS Visual Studio 2010.
* src/autofit/afhints.c (af_glyph_hints_get_num_segments,
af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide
return value.
* src/cff/cffgload.c (cff_slot_load): Add cast.
* src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper
loop variable type.
2011-05-24 06:22:32 +02:00
suzuki toshiya ebd14a599d Automake component `builds/unix/install-sh' is removed.
* builds/unix/install-sh: Removed.  It is not needed to
include repository, because autogen.sh installs it.
* builds/unix/.gitignore: Register install-sh.
2011-05-16 12:47:25 +09:00
sssa 4e8f9de9a0 [autofit] Make trace message for CJK bluezone more verbose. 2011-05-12 14:30:15 +09:00
suzuki toshiya 084abf0469 [autofit] Add bluezones for CJK Ideographs.
To remove extremas of vertical strokes of CJK Ideographs at
low resolution and make the top and bottom horizontal stems
aligned, bluezones for CJK Ideographs are calculated from
sample glyphs.  At present, vertical bluezones (bluezones
to align vertical stems) are disabled by default.  For detail, see
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html
http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html

* include/freetype/internal/fttrace.h: New trace component `afcjk'.
* src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version
for AF_Latin{Blue,Axis,Metric}Rec.
(af_cjk_metrics_check_digits): Ditto, shared with Indic module.
(af_cjk_metrics_init_widths): Ditto.
(af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric.
(af_cjk_metrics_scale): Ditto (declaration).
(af_cjk_hints_init): Ditto (declaration).
(af_cjk_hints_apply): Ditto (declaration).
* src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body).
(af_cjk_hints_init): Ditto (body).
(af_cjk_hints_apply): Ditto (body).
(af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths.
(af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits.
(af_cjk_metrics_init): Call CJK bluezone initializer.
(af_cjk_metrics_scale_dim): Add code to scale bluezones.
(af_cjk_hints_compute_blue_edges): New function, CJK version of
af_latin_hints_compute_blue_edges.
(af_cjk_metrics_init_blues): New function, CJK version of
af_latin_metrics_init_blues.
(af_cjk_hints_edges): Add code to align the edge stems to blue zones.

* src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric
instead of AF_LatinMetric, and initialize as af_cjk_metrics_init.
However bluezones are not initialized.
(af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric.
(af_indic_hints_init): Ditto.
(af_indic_hints_apply): Ditto.

* docs/CHANGES: Note about CJK bluezone support.
2011-05-08 19:22:32 +09:00
Werner Lemberg d2e82aa07e [autofit] Remove unused struct member.
* src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'.
2011-05-06 19:04:30 +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 3a0844c8ef [autofit] Add more debugging functions.
* src/autofit/afhints.c (af_glyph_hints_get_num_segments,
af_glyph_hints_get_segment_offset): New functions.
2011-05-01 13:44:44 +02:00
suzuki toshiya 7c6da3d73a Add new option `--disable-mmap' to configure script.
* builds/unix/configure.raw: New option `--disable-mmap'
is added.  It is for the developers to simulate the systems
without mmap() (like 4.3BSD, minix etc) on POSIX systems.
2011-05-01 19:06:24 +09:00
suzuki toshiya 58cb359335 [truetype] Recalculate the sfnt table checksum always.
* src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate
the sfnt table checksum even if non-zero value is writte in
the TrueType font header.  Some bad PDF generators write
wrong values.  For detail, see examples and benchmark tests
of the latency by recalculation:
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
2011-05-01 00:47:43 +09:00
suzuki toshiya 1e89d15a27 [truetype] Register a set of tricky fonts, NEC FA family.
* src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids):
Add 8 checksum sets for NEC FA family.  For the tricky fonts
without some tables (e.g. NEC FA fonts lack cvt table),
extra check is added to assure that 0-length table in the
registry is not included in the font.
2011-04-30 17:55:57 +09:00
suzuki toshiya 89208861ef [truetype] Fix a bug in the sfnt table checksum getter.
* src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the
return value of face->goto_table() correctly.
2011-04-30 00:11:07 +09: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
suzuki toshiya 86b7b2f614 [truetype] Revert the reordering of trickyness checking.
Trickyness check by the family name is faster than that by
the checksum.
2011-04-26 03:46:12 +09:00
suzuki toshiya abc47aa136 [truetype] Always check the checksum to identify tricky fonts.
Some PDF generators mangle the family name badly, prioritize
the check by the sfnt table checksums than the check by the
family name.  For sample PDF, see
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html

* src/truetype/ttobjs.c (tt_check_trickyness): Exchange the order
of tt_check_trickyness_family() and tt_check_trickyness_sfnt_ids().
2011-04-25 23:51:04 +09:00
suzuki toshiya 233f9d5dd2 [autofit] Add more Indic scripts with hanging baseline.
* src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu,
Sundanese, Meetei Mayak, Syloti Nagri and Sharada scripts are
added.
2011-04-22 10:14:07 +09:00
Behdad Esfahbod 8c82ec5b17 Always ignore global advance.
This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant,
deprecated, and ignored.  The new behavior is what every major user
of FreeType has been requesting.  Global advance is broken in many
CJK fonts.  Just ignoring it by default makes most sense.

* src/truetype/ttdriver.c (tt_get_advances),
src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics,
tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph),
src/truetype/ttgload.h: Implement it.

* docs/CHANGES: Updated.
2011-04-21 08:21:37 +02:00
suzuki toshiya a345c0e1d5 [autofit] Blur CJK stems if too many to preserve their gaps 2011-04-21 10:58:33 +09: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 575078d2b4 Formatting nits. 2011-04-18 15:33:17 +02:00
Werner Lemberg 149f5438c4 Synchronize config files.
* builds/unix/ftconfig.in: Copy missing assembler routines from
include/freetype/config/ftconfig.h.
2011-04-18 15:09:38 +02:00
Werner Lemberg 9b00875093 Fix Savannah bug #33047.
Patch submitted by anonymous reporter.

* src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer
difference.
2011-04-13 13:37:37 +02:00
Kan-Ru Chen 21b1a0de7c Fix reading of signed integers from files on 64bit platforms.
Previously, signed integers were converted to unsigned integers, but
this can fail because of sign extension.  For example, 0xa344a1eb
becomes 0xffffffffa344a1eb.

We now do the reverse which is always correct because the integer
size is the same during the cast from unsigned to signed.

* include/freetype/internal/ftstream.h, src/base/ftstream.c
(FT_Stream_Get*): Replace with...
(FT_Stream_GetU*): Functions which read unsigned integers.
Update all macros accordingly.

* src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
2011-04-12 09:26:43 +02:00
Werner Lemberg 7f03a2465c Update Unicode ranges for CJK autofitter; in particular, add Hangul.
* src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0.
2011-04-07 07:20:38 +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 ef11551868 * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused. 2011-03-30 09:29:05 +02:00
Werner Lemberg 360646c968 * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256.
This limit is given on p. 37 of Adobe Tech Note #5014.
2011-03-24 09:29:23 +01:00
Werner Lemberg 01caf4a7a9 * src/truetype/ttpload.c(tt_face_load_loca): Fix mismatch warning. 2011-03-23 05:19:59 +01:00
Werner Lemberg af7b8b1a9f * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts. 2011-03-20 07:51:57 +01:00
Werner Lemberg 8bd77f9030 More C++ compilation fixes.
* src/autofit/afhints.c (af_glyph_hints_dump_points,
af_glyph_hints_dump_segments, af_glyph_hints_dump_edges)
[__cplusplus]: Protect with `extern "C"'.
2011-03-19 15:27:04 +01: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
Alexei Podtelezhnikov 8fb8841430 A better fix for Savannah bug #32671.
* src/smooth/ftgrays.c (gray_render_conic): Clean up code and
replace WHILE loop with a more natural DO-WHILE construct.
2011-03-17 20:24:57 +01:00
Werner Lemberg 437fb8ebf8 * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field.
Suggested by Graham Asher.
2011-03-16 08:54:02 +01:00
Werner Lemberg cecd912747 Make FT_Sfnt_Table_Info return the number of SFNT tables.
* src/sfnt/sfdriver.c (sfnt_table_info): Implement it.
* include/freetype/tttables.h: Update documentation.
* docs/CHANGES: Updated.
2011-03-09 06:18:28 +01:00
Bram Tassyns 3fd158d0ce Fix Savannah bug #27988.
* src/cff/cffobjs.c (remove_style): New function.
(cff_face_init): Use it to strip off the style part of the family
name.
2011-03-07 09:33:53 +01:00
Werner Lemberg 9c111b0179 * docs/CHANGES: Updated. 2011-03-07 06:07:53 +01:00
Werner Lemberg 6c045535ea Quick fix for Savannah bug #32671.
This isn't the optimal solution yet, but it restores the previous
rendering quality (more or less).

* src/smooth/ftgrays.c (gray_render_conic): Do more splitting.
2011-03-07 05:40:42 +01:00
Werner Lemberg c9bdfa7e65 Fix autohinting fallback.
* src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
ignoring CFF-based OTFs.
2011-03-06 18:35:37 +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 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 e7d1fb3142 * docs/PROBLEMS: Mention rendering differences on different
platforms.
Suggested and worded by Jason Owen <jason.a.owen@gmail.com>.
2011-02-24 20:01:00 +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 f42cc539e0 * src/autofit/afhints.h (AF_GlyphHints): Remove unused field. 2011-02-24 05:18:46 +01:00
suzuki toshiya ae6d1d7b98 [cache] Fix an off-by-one bug in FTC_Manager_RemoveFaceID().
Found by <ychen1392001@yahoo.com.cn>, see detail in

  http://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html

* src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node
buckets[cache->p + cache->mask] too.
2011-02-20 19:14:25 +09:00
Kevin Kofler ff8095077c Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
This is Savannah patch #7471.

* src/base/ftobjs.c (FT_Load_Glyph): Implement it.
2011-02-19 23:09:26 +01:00
John Tytgat 18fffa456e [cff] Fix subset prefix removal.
* src/cff/cffobjs.c (remove_subset_prefix): Update length after
subset prefix removal.
2011-02-19 07:11:17 +01:00
Bradley Grainger 70f7db113e Add inline assembly version of FT_MulFix for MSVC.
* include/freetype/config/ftconfig.h: Ported the FT_MulFix_i386
function from GNU inline assembly syntax (see #ifdef __GNUC__ block
above) to MASM syntax for Microsoft Visual C++.
2011-02-14 08:32:24 +01:00
Bradley Grainger d2731e104c Add project and solution files in Visual Studio 2010 format.
* builds/win32/.gitignore: Ignore user-specific cache files.
* builds/win32/vc2010/: Add VS2010 project & solution files, created
by upgrading builds/win32/vc2008/freetype.vcproj.
* objs/.gitignore: Ignore Visual Studio output files.
2011-02-14 08:32:24 +01:00
Werner Lemberg 713faece86 * src/autofit/afdummy.c: Include `aferrors.h'.
Problem reported by Chris Liddel <chris.liddell@artifex.com>.
2011-02-03 19:47:13 +01:00
Werner Lemberg 75df70600f [cff] Ignore unknown operators in charstrings.
Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.

* src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
message for unknown operators and continue instead of exiting with a
syntax error.
2011-02-01 07:36:27 +01:00
Werner Lemberg 18931a5a5d [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also.
* src/truetype/ttgload.c (tt_loader_init): Handle
`FT_LOAD_PEDANTIC'.
* src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,
tt_size_init_bytecode, tt_size_ready_bytecode): New argument to
handle pedantic mode.
* src/truetype/ttobjs.h: Updated.
2011-02-01 07:08:43 +01:00
Werner Lemberg f1a981b5ce [truetype] Protect jump instructions against endless loops.
* src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error
if offset is zero.
2011-01-31 22:26:53 +01:00
Werner Lemberg d6a213f8ea [truetype] Improve handling of invalid references.
* src/truetype/interp.c: Set even more TT_Err_Invalid_Reference
error codes only if pedantic hinting is active.  At the same time,
try to provide sane values which hopefully allow useful
continuation.  Exception to this is CALL and LOOPCALL – due to
possible stack corruption it is necessary to bail out.
2011-01-31 18:51:07 +01:00
Werner Lemberg 96f0456483 [truetype] Improve handling of stack underflow.
* src/truetype/ttinterp.c (TT_RunIns, Ins_FLIPPT, Ins_DELTAP,
Ins_DELTAC): Exit with error only if `pedantic_hinting' is set.
Otherwise, try to do something sane.
2011-01-31 10:24:32 +01:00
Werner Lemberg 0682251e9f * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message. 2011-01-30 16:38:09 +01:00
LIU Sun-Liang c61b3596d4 [truetype]: Fix behaviour of MIAP for invalid arguments.
* src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in
case of error.
2011-01-30 16:29:45 +01:00
Werner Lemberg dcdb3167dc [truetype] Fix handling of MIRP instruction.
Thanks to Greg Hitchcock who explained the issue.

* src/truetype/ttinterp.c (Ins_MIRP): Replace a `>=' operator with
`>' since the description in the specification is incorrect.
This fixes, for example, glyph `two' in font `Helvetica Neue LT Com
65 medium' at 15ppem.
2011-01-18 07:35:26 +01:00
suzuki toshiya 17f54bc66c Fix ARM assembly code in include/freetype/config/ftconfig.h.
* include/freetype/config/ftconfig.h (FT_MulFix_arm):
Copy the maintained code from builds/unix/ftconfig.in.
Old GNU binutils could not accept the reduced syntax
`orr %0, %2, lsl #16'.  Un-omitted syntax like RVCT,
`orr %0, %0, %2, lsl #16' is better.  Reported by
Johnson Y. Yan.  The bug report by Qt developers is
considered too.

http://bugreports.qt.nokia.com/browse/QTBUG-6521
2011-01-15 21:53:32 +09:00
Werner Lemberg 21bdca7907 [raster] Make bbox handling the same as with Microsoft's rasterizer.
Right before B/W rasterizing, the bbox gets simply rounded to
integers.  This fixes, for example, glyph `three' in font `Helvetica
Neue LT Com 65 Medium' at 11ppem.

Thanks to Greg Hitchcock who explained this behaviour.

* src/raster/ftrend1.c (ft_raster1_render): Implement it.
2011-01-15 09:46:13 +01:00
suzuki toshiya a2ef6647ae Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS.
* builds/unix/configure.raw: Consider recent gcc-standard
flags to specify architecture in CFLAGS & LDFLAGS
harmonization.  Requested by Savannah bug #32114, to
support multilib feature of BuildRoot SDK correctly.
2011-01-15 13:33:28 +09:00
suzuki toshiya c68a82d8fc Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer.
* builds/unix/configure.raw: Some important options that
included in CFLAGS but not in LDFLAGS are copied to
LDFLAGS, but the last option in CFLAGS was not checked.
2011-01-15 13:21:32 +09:00
Werner Lemberg 0039d0120e [raster] Add undocumented drop-out rule to the other bbox side also.
* src/raster/ftraster.c (Vertical_Sweep_Drop,
Horizontal_Sweep_Drop): Implement it.
2011-01-14 19:44:29 +01:00
Werner Lemberg c02485cb72 [raster] Reduce jitter value.
This catches a rendering problem with glyph `x' from Tahoma at
10ppem.  It seems that the increase of the precision in the change
from 2009-06-11 makes a larger jitter value unnecessary.

* src/raster/ftraster.c (Set_High_Precision): Implement it.
2011-01-13 21:55:08 +01:00
Werner Lemberg 29bc310563 [raster] Handle drop-outs at glyph borders according to Microsoft.
If a drop-out rule would switch on a pixel outside of the glyph's
bounding box, use the right (or top) pixel instead.  This is an
undocumented feature, but some fonts like `Helvetica Neue LT Com 65
Medium' heavily rely on it.

Thanks to Greg Hitchcock who explained this behaviour.

* src/raster/ftraster.c (Vertical_Sweep_Drop,
Horizontal_Sweep_Drop): Implement it.
2011-01-13 12:22:55 +01:00
Werner Lemberg 3757b1e1c1 Cleanup/formatting. 2011-01-13 10:33:04 +01:00
suzuki toshiya 6b3bef2b20 Correct wrong years about recent commits in ChangeLog. 2011-01-09 23:11:18 +09:00
suzuki toshiya 5e7ad208e3 [cache] Fix Savannah bug #31923, patch drafted by Harsha.
When a node comparator changes the cached nodes during the
search of a node matching with queried properties, the
pointers obtained before the functon should be updated to
prevent the dereference to freed or reallocated nodes.
To minimize the rescan of the linked list, the update is
executed when the comparator notifies the change of cached
nodes. This change depends previous change:
38b272ffbb

* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Rescan the
top node if the cached nodes are changed.
* src/cache/ftccache.c (FTC_Cache_Lookup): Ditto.
2011-01-09 23:09:36 +09:00
suzuki toshiya 38b272ffbb [cache] Notice if a cache query induced the node list change.
Some node comparators (comparing the cache node content and
the properties specified by the query) can flush the cache
node to prevent the cache inflation.  The change may
invalidate the pointers to the node obtained before the node
comparison, so the change should be noticed to the caller.
The problem caused by the cache node changing is reported by
Harsha, see Savannah bug #31923.

* src/cache/ftccache.h (FTC_Node_CompareFunc): Add new
argument `FT_Bool* list_changed' to indicate the change of
the cached nodes to the caller.
(FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes
by `_list_changed'.
(FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed'
and update it when FTC_Manager_FlushN() flushes any nodes.

* src/cache/ftccback.h (ftc_snode_compare): Updated to fit
with new FTC_Node_CompareFunc type.  (ftc_gnode_compare): Ditto.

* src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_basic_gnode_compare_faceid):
New argument `FT_Bool* list_changed' to indicate the change
of the cache nodes, anyway, it is always FALSE.

* src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_cmap_node_compare):
New argument `FT_Bool* list_changed' to indicate the change
of the cache nodes, anyway, it is always FALSE.
(ftc_cmap_node_remove_faceid): Ditto.

* src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL
pointer to FTC_CACHE_TRYLOOP_END(), because the result is
not needed.  (FTC_Cache_Lookup): Watch the change of the cache
nodes by `list_changed'.  (FTC_Cache_RemoveFaceID): Ditto.

* src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_gnode_compare): New argument
`FT_Bool* list_changed' to indicate the change of the cache
nodes, anyway, it is always FALSE.  (FTC_GNode_Compare):
New argument `FT_Bool* list_changed' to be passed to
ftc_gnode_compare().
* src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.

* src/cache/ftcsbits.c (ftc_snode_compare): New argument
`FT_Bool* list_changed' to indicate the change of the cache
nodes, anyway. It is updated by FTC_CACHE_TRYLOOP().
(FTC_SNode_Compare): New argument `FT_Bool* list_changed'
to be passed to ftc_snode_compare().
* src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
2011-01-09 22:52:24 +09:00
suzuki toshiya 62d116f8d6 [cache] Fit FTC_GNode_Compare() to FTC_Node_CompareFunc.
* src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd
argument `FTC_Cache  cache' to fit FTC_Node_CompareFunc
prototype.
* src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway,
`cache' is not used by its child ftc_gnode_compare().
2011-01-09 22:38:10 +09:00
suzuki toshiya 9a2e255b23 [cache] Deduplicate the code to get the top node by a hash.
There are several duplicated codes getting the top node
from a cache by a given hash, like:

    idx = hash & cache->mask;
    if ( idx < cache->p )
      idx = hash & ( cache->mask * 2 + 1 );
    pnode = cache->buckets + idx;

To deduplicate them, a cpp-macro to do same work
FTC_NODE__TOP_FOR_HASH( cache, hash ) is introduced.
For non-inlined config, non-ftc_get_top_node_for_hash() is
also introduced.

* src/cache/ftccache.h (FTC_NODE__TOP_FOR_HASH): Declare
and implement inlined version.
(FTC_CACHE_LOOKUP_CMP): Use FTC_NODE__TOP_FOR_HASH().
* src/cache/ftccache.c (ftc_get_top_node_for_hash): Non-
inlined version.
(ftc_node_hash_unlink): Use FTC_NODE__TOP_FOR_HASH().
(ftc_node_hash_link): Ditto.
(FTC_Cache_Lookup): Ditto.
2011-01-09 21:09:58 +09:00
suzuki toshiya 52a1e47a5c [cache] inline-specific functions are conditionalized.
* src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized
for inlined config.  This function is a thin wrapper of
ftc_gnode_compare() for inlined FTC_CACHE_LOOKUP_CMP()
(see `nodecmp' argument).  Under non-inlined config,
ftc_gnode_compare() is invoked by FTC_Cache_Lookup(),
via FTC_Cache->clazz.node_compare().

* src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
* src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto,
for ftc_snode_compare().
* src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
2011-01-09 20:49:21 +09:00