* src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
Formatting
This commit is contained in:
parent
91b44e65c2
commit
111b5aefca
55
ChangeLog
55
ChangeLog
|
@ -1,14 +1,53 @@
|
||||||
|
2006-11-03 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
* src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
|
||||||
|
|
||||||
2006-11-02 David Turner <david@freetype.org>
|
2006-11-02 David Turner <david@freetype.org>
|
||||||
|
|
||||||
* src/autofit/aflatin.c: adding a few tweaks to better handle
|
Add a few tweaks to better handle serif fonts.
|
||||||
serif fonts (we now ignore vertical segments that are less than
|
Add more debugging messages.
|
||||||
1 pixels in height, which get rids of *many* corner cases with
|
|
||||||
serifs)
|
|
||||||
|
|
||||||
* src/autofit/afhints.c, src/autofit/afmodule.c,
|
* src/autofit/aflatin.c (af_latin_hints_compute_edges): Ignore
|
||||||
src/autofit/aftypes.h: adding more debug messages and fixing a small
|
segments that are less than 1.5 pixels high. This gets rid of
|
||||||
bug in af_compute_direction which produced garbage by missing lots of
|
*many* corner cases with serifs.
|
||||||
segments
|
(af_latin_align_linked_edge): Add logging message.
|
||||||
|
(af_latin_hint_edges): Use AF_HINTS_DO_BLUES.
|
||||||
|
Add logging messages.
|
||||||
|
Handle AF_EDGE_FLAG flag specially.
|
||||||
|
|
||||||
|
* src/autofit/afmodule.c [AF_DEBUG]: Add _af_debug,
|
||||||
|
_af_debug_disable_blue_hints, and _af_debug_hints variables.
|
||||||
|
|
||||||
|
* src/autofit/aftypes.h (AF_LOG) [AF_DEBUG]: Use _af_debug.
|
||||||
|
Update external declarations.
|
||||||
|
(af_corner_orientation, af_corner_is_flat): Replaced by...
|
||||||
|
|
||||||
|
* include/freetype/internal/ftcalc.h (ft_corner_orientation,
|
||||||
|
ft_corner_is_flat): These declarations.
|
||||||
|
|
||||||
|
* src/autofit/afangles.c (af_corner_orientation, af_corner_is_flat):
|
||||||
|
Comment out. Replaced by...
|
||||||
|
|
||||||
|
* src/base/ftcalc.h (ft_corner_orientation, ft_corner_is_flat):
|
||||||
|
These functions. Update all callers.
|
||||||
|
(FT_Add64) [!FT_LONG64]: Simplify.
|
||||||
|
|
||||||
|
* src/autofit/afhints.c: Include FT_INTERNAL_CALC_H.
|
||||||
|
(af_direction_compute): Add a missing FT_ABS call. This bug caused
|
||||||
|
production of garbage by missing lots of segments.
|
||||||
|
|
||||||
|
* src/autofit/afhints.h (AF_HINTS_DO_BLUES): New macro.
|
||||||
|
|
||||||
|
* src/autofit/afloader.c (af_loader_init, af_loader_done)
|
||||||
|
[AF_DEBUG]: Set _af_debug_hints.
|
||||||
|
|
||||||
|
|
||||||
|
* src/pshinter/pshalgo.c: Include FT_INTERNAL_CALC_H.
|
||||||
|
(psh_corner_is_flat, psh_corner_orientation): Use ft_corner_is_flat
|
||||||
|
and ft_corner_orientation.
|
||||||
|
|
||||||
|
|
||||||
|
* src/gzip/inftrees.c (huft_build): Remove compiler warning.
|
||||||
|
|
||||||
2006-10-24 Werner Lemberg <wl@gnu.org>
|
2006-10-24 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -110,17 +110,18 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return -1, 0, or +1, depending on the orientation of a given corner.
|
* Return -1, 0, or +1, depending on the orientation of a given corner.
|
||||||
* We use the Cartesian coordinate system, with positive vertical values
|
* We use the Cartesian coordinate system, with positive vertical values
|
||||||
* going upwards. The function returns +1 when the corner turns to the
|
* going upwards. The function returns +1 if the corner turns to the
|
||||||
* left, -1 to the right, and 0 for undecided.
|
* left, -1 to the right, and 0 for undecidable cases.
|
||||||
*/
|
*/
|
||||||
FT_BASE( FT_Int )
|
FT_BASE( FT_Int )
|
||||||
ft_corner_orientation( FT_Pos in_x,
|
ft_corner_orientation( FT_Pos in_x,
|
||||||
FT_Pos in_y,
|
FT_Pos in_y,
|
||||||
FT_Pos out_x,
|
FT_Pos out_x,
|
||||||
FT_Pos out_y );
|
FT_Pos out_y );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
|
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
|
||||||
|
@ -128,10 +129,11 @@ FT_BEGIN_HEADER
|
||||||
* very small.
|
* very small.
|
||||||
*/
|
*/
|
||||||
FT_BASE( FT_Int )
|
FT_BASE( FT_Int )
|
||||||
ft_corner_is_flat( FT_Pos in_x,
|
ft_corner_is_flat( FT_Pos in_x,
|
||||||
FT_Pos in_y,
|
FT_Pos in_y,
|
||||||
FT_Pos out_x,
|
FT_Pos out_x,
|
||||||
FT_Pos out_y );
|
FT_Pos out_y );
|
||||||
|
|
||||||
|
|
||||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
||||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
|
|
||||||
#include "aftypes.h"
|
#include "aftypes.h"
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Int )
|
FT_LOCAL_DEF( FT_Int )
|
||||||
af_corner_is_flat( FT_Pos x_in,
|
af_corner_is_flat( FT_Pos x_in,
|
||||||
FT_Pos y_in,
|
FT_Pos y_in,
|
||||||
|
@ -74,8 +76,10 @@
|
||||||
else
|
else
|
||||||
return 1 - 2 * ( delta < 0 );
|
return 1 - 2 * ( delta < 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are not using `af_angle_atan' anymore, but we keep the source
|
* We are not using `af_angle_atan' anymore, but we keep the source
|
||||||
* code below just in case...
|
* code below just in case...
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "aferrors.h"
|
#include "aferrors.h"
|
||||||
#include FT_INTERNAL_CALC_H
|
#include FT_INTERNAL_CALC_H
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
af_axis_hints_new_segment( AF_AxisHints axis,
|
af_axis_hints_new_segment( AF_AxisHints axis,
|
||||||
FT_Memory memory,
|
FT_Memory memory,
|
||||||
|
|
|
@ -227,7 +227,7 @@ FT_BEGIN_HEADER
|
||||||
#define AF_HINTS_DO_ADVANCE( h ) \
|
#define AF_HINTS_DO_ADVANCE( h ) \
|
||||||
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
|
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
|
||||||
|
|
||||||
#define AF_HINTS_DO_BLUES( h ) ( !_af_debug_disable_blue_hints )
|
#define AF_HINTS_DO_BLUES( h ) ( !_af_debug_disable_blue_hints )
|
||||||
|
|
||||||
#else /* !AF_DEBUG */
|
#else /* !AF_DEBUG */
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ FT_BEGIN_HEADER
|
||||||
#define AF_HINTS_DO_ADVANCE( h ) \
|
#define AF_HINTS_DO_ADVANCE( h ) \
|
||||||
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
|
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
|
||||||
|
|
||||||
#define AF_HINTS_DO_BLUES( h ) 1
|
#define AF_HINTS_DO_BLUES( h ) 1
|
||||||
|
|
||||||
#endif /* !AF_DEBUG */
|
#endif /* !AF_DEBUG */
|
||||||
|
|
||||||
|
|
|
@ -960,10 +960,10 @@
|
||||||
up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP
|
up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP
|
||||||
: AF_DIR_RIGHT;
|
: AF_DIR_RIGHT;
|
||||||
|
|
||||||
/* we want to ignore all segments that are less than 1.5
|
/*
|
||||||
* pixels in length, to avoid many problems with serif
|
* We ignore all segments that are less than 1.5 pixels in length,
|
||||||
* fonts. we compute the corresponding threshold in font
|
* to avoid many problems with serif fonts. We compute the
|
||||||
* units
|
* corresponding threshold in font units.
|
||||||
*/
|
*/
|
||||||
if ( dim == AF_DIMENSION_VERT )
|
if ( dim == AF_DIMENSION_VERT )
|
||||||
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
|
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
|
||||||
|
@ -999,6 +999,7 @@
|
||||||
AF_Edge found = 0;
|
AF_Edge found = 0;
|
||||||
FT_Int ee;
|
FT_Int ee;
|
||||||
|
|
||||||
|
|
||||||
if ( seg->max_coord - seg->min_coord < segment_length_threshold )
|
if ( seg->max_coord - seg->min_coord < segment_length_threshold )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1119,10 +1120,11 @@
|
||||||
|
|
||||||
/* check for links -- if seg->serif is set, then seg->link must */
|
/* check for links -- if seg->serif is set, then seg->link must */
|
||||||
/* be ignored */
|
/* be ignored */
|
||||||
is_serif = (FT_Bool)( seg->serif && seg->serif->edge &&
|
is_serif = (FT_Bool)( seg->serif &&
|
||||||
|
seg->serif->edge &&
|
||||||
seg->serif->edge != edge );
|
seg->serif->edge != edge );
|
||||||
|
|
||||||
if ( (seg->link && seg->link->edge != NULL) || is_serif )
|
if ( ( seg->link && seg->link->edge != NULL ) || is_serif )
|
||||||
{
|
{
|
||||||
AF_Edge edge2;
|
AF_Edge edge2;
|
||||||
AF_Segment seg2;
|
AF_Segment seg2;
|
||||||
|
@ -1600,11 +1602,13 @@
|
||||||
(AF_Edge_Flags)base_edge->flags,
|
(AF_Edge_Flags)base_edge->flags,
|
||||||
(AF_Edge_Flags)stem_edge->flags );
|
(AF_Edge_Flags)stem_edge->flags );
|
||||||
|
|
||||||
|
|
||||||
stem_edge->pos = base_edge->pos + fitted_width;
|
stem_edge->pos = base_edge->pos + fitted_width;
|
||||||
|
|
||||||
AF_LOG(( "LINK: edge %d (opos=%.2f) linked to (%.2f), dist was %.2f now %.2f\n",
|
AF_LOG(( "LINK: edge %d (opos=%.2f) linked to (%.2f), "
|
||||||
stem_edge-hints->axis[dim].edges, stem_edge->opos/64.0,
|
"dist was %.2f, now %.2f\n",
|
||||||
stem_edge->pos/64.0, dist/64., fitted_width/64. ));
|
stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
|
||||||
|
stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1646,7 +1650,7 @@
|
||||||
/* we begin by aligning all stems relative to the blue zone */
|
/* we begin by aligning all stems relative to the blue zone */
|
||||||
/* if needed -- that's only for horizontal edges */
|
/* if needed -- that's only for horizontal edges */
|
||||||
|
|
||||||
if ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_BLUES(hints) )
|
if ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_BLUES( hints ) )
|
||||||
{
|
{
|
||||||
for ( edge = edges; edge < edge_limit; edge++ )
|
for ( edge = edges; edge < edge_limit; edge++ )
|
||||||
{
|
{
|
||||||
|
@ -1675,8 +1679,11 @@
|
||||||
if ( !edge1 )
|
if ( !edge1 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AF_LOG(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f) was (%.2f)\n",
|
AF_LOG(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f), "
|
||||||
edge1-edges, edge1->opos/64., blue->fit/64., edge1->pos/64.0 ));
|
"was (%.2f)\n",
|
||||||
|
edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,
|
||||||
|
edge1->pos / 64.0 ));
|
||||||
|
|
||||||
edge1->pos = blue->fit;
|
edge1->pos = blue->fit;
|
||||||
edge1->flags |= AF_EDGE_DONE;
|
edge1->flags |= AF_EDGE_DONE;
|
||||||
|
|
||||||
|
@ -1714,7 +1721,8 @@
|
||||||
/* this should not happen, but it's better to be safe */
|
/* this should not happen, but it's better to be safe */
|
||||||
if ( edge2->blue_edge || edge2 < edge )
|
if ( edge2->blue_edge || edge2 < edge )
|
||||||
{
|
{
|
||||||
AF_LOG(( "ASSERT FAILED for edge %d\n", edge2-edges ));
|
AF_LOG(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
|
||||||
|
|
||||||
af_latin_align_linked_edge( hints, dim, edge2, edge );
|
af_latin_align_linked_edge( hints, dim, edge2, edge );
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
continue;
|
continue;
|
||||||
|
@ -1766,7 +1774,7 @@
|
||||||
edge->pos = FT_PIX_ROUND( edge->opos );
|
edge->pos = FT_PIX_ROUND( edge->opos );
|
||||||
|
|
||||||
AF_LOG(( "ANCHOR: edge %d (opos=%.2f) snapped to (%.2f)\n",
|
AF_LOG(( "ANCHOR: edge %d (opos=%.2f) snapped to (%.2f)\n",
|
||||||
edge-edges, edge->opos/64., edge->pos/64. ));
|
edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
|
||||||
anchor = edge;
|
anchor = edge;
|
||||||
|
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
|
@ -1789,9 +1797,8 @@
|
||||||
(AF_Edge_Flags)edge2->flags );
|
(AF_Edge_Flags)edge2->flags );
|
||||||
|
|
||||||
if ( edge2->flags & AF_EDGE_DONE )
|
if ( edge2->flags & AF_EDGE_DONE )
|
||||||
{
|
edge->pos = edge2->pos - cur_len;
|
||||||
edge->pos = edge2->pos - cur_len;
|
|
||||||
}
|
|
||||||
else if ( cur_len < 96 )
|
else if ( cur_len < 96 )
|
||||||
{
|
{
|
||||||
FT_Pos u_off, d_off;
|
FT_Pos u_off, d_off;
|
||||||
|
@ -1822,10 +1829,14 @@
|
||||||
|
|
||||||
edge->pos = cur_pos1 - cur_len / 2;
|
edge->pos = cur_pos1 - cur_len / 2;
|
||||||
edge2->pos = cur_pos1 + cur_len / 2;
|
edge2->pos = cur_pos1 + cur_len / 2;
|
||||||
AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) snapped to (%.2f) and (%.2f)\n",
|
|
||||||
edge-edges, edge->opos/64., edge2-edges, edge2->opos/64.,
|
AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) "
|
||||||
edge->pos/64., edge2->pos/64. ));
|
"snapped to (%.2f) and (%.2f)\n",
|
||||||
|
edge-edges, edge->opos / 64.0,
|
||||||
|
edge2-edges, edge2->opos / 64.0,
|
||||||
|
edge->pos / 64.0, edge2->pos / 64.0 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
org_pos = anchor->pos + ( edge->opos - anchor->opos );
|
org_pos = anchor->pos + ( edge->opos - anchor->opos );
|
||||||
|
@ -1850,9 +1861,11 @@
|
||||||
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
|
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
|
||||||
edge2->pos = edge->pos + cur_len;
|
edge2->pos = edge->pos + cur_len;
|
||||||
|
|
||||||
AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) snapped to (%.2f) and (%.2f)\n",
|
AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) "
|
||||||
edge-edges, edge->opos/64., edge2-edges, edge2->opos/64.,
|
"snapped to (%.2f) and (%.2f)\n",
|
||||||
edge->pos/64., edge2->pos/64. ));
|
edge-edges, edge->opos / 64.0,
|
||||||
|
edge2-edges, edge2->opos / 64.0,
|
||||||
|
edge->pos / 64.0, edge2->pos / 64.0 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
|
@ -1860,8 +1873,8 @@
|
||||||
|
|
||||||
if ( edge > edges && edge->pos < edge[-1].pos )
|
if ( edge > edges && edge->pos < edge[-1].pos )
|
||||||
{
|
{
|
||||||
AF_LOG(( "BOUND: %d (pos=%.2f) to (%.2f)\n", edge-edges,
|
AF_LOG(( "BOUND: %d (pos=%.2f) to (%.2f)\n",
|
||||||
edge->pos/64., edge[-1].pos/64. ));
|
edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
|
||||||
edge->pos = edge[-1].pos;
|
edge->pos = edge[-1].pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* Auto-fitter module implementation (body). */
|
/* Auto-fitter module implementation (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2003, 2004, 2005 by */
|
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -20,10 +20,10 @@
|
||||||
#include "afloader.h"
|
#include "afloader.h"
|
||||||
|
|
||||||
#ifdef AF_DEBUG
|
#ifdef AF_DEBUG
|
||||||
int _af_debug;
|
int _af_debug;
|
||||||
int _af_debug_disable_horz_hints;
|
int _af_debug_disable_horz_hints;
|
||||||
int _af_debug_disable_vert_hints;
|
int _af_debug_disable_vert_hints;
|
||||||
int _af_debug_disable_blue_hints;
|
int _af_debug_disable_blue_hints;
|
||||||
void* _af_debug_hints;
|
void* _af_debug_hints;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -58,18 +58,18 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
#ifdef AF_DEBUG
|
#ifdef AF_DEBUG
|
||||||
|
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# define AF_LOG( x ) do { if (_af_debug) printf x ; } while (0)
|
#define AF_LOG( x ) do { if ( _af_debug ) printf x; } while ( 0 )
|
||||||
|
|
||||||
extern int _af_debug;
|
extern int _af_debug;
|
||||||
extern int _af_debug_disable_horz_hints;
|
extern int _af_debug_disable_horz_hints;
|
||||||
extern int _af_debug_disable_vert_hints;
|
extern int _af_debug_disable_vert_hints;
|
||||||
extern int _af_debug_disable_blue_hints;
|
extern int _af_debug_disable_blue_hints;
|
||||||
extern void* _af_debug_hints;
|
extern void* _af_debug_hints;
|
||||||
|
|
||||||
#else /* !AF_DEBUG */
|
#else /* !AF_DEBUG */
|
||||||
|
|
||||||
# define AF_LOG( x ) do ; while ( 0 ) /* nothing */
|
#define AF_LOG( x ) do ; while ( 0 ) /* nothing */
|
||||||
|
|
||||||
#endif /* !AF_DEBUG */
|
#endif /* !AF_DEBUG */
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#else /* FT_LONG64 */
|
#else /* !FT_LONG64 */
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -305,8 +305,8 @@
|
||||||
register FT_UInt32 lo, hi;
|
register FT_UInt32 lo, hi;
|
||||||
|
|
||||||
|
|
||||||
lo = x->lo + y->lo;
|
lo = x->lo + y->lo;
|
||||||
hi = x->hi + y->hi + ( lo < x->lo );
|
hi = x->hi + y->hi + ( lo < x->lo );
|
||||||
|
|
||||||
z->lo = lo;
|
z->lo = lo;
|
||||||
z->hi = hi;
|
z->hi = hi;
|
||||||
|
@ -684,12 +684,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* documentation is in ftcalc.h */
|
||||||
|
|
||||||
FT_BASE_DEF( FT_Int )
|
FT_BASE_DEF( FT_Int )
|
||||||
ft_corner_orientation( FT_Pos in_x,
|
ft_corner_orientation( FT_Pos in_x,
|
||||||
FT_Pos in_y,
|
FT_Pos in_y,
|
||||||
FT_Pos out_x,
|
FT_Pos out_x,
|
||||||
FT_Pos out_y )
|
FT_Pos out_y )
|
||||||
{
|
{
|
||||||
FT_Int result;
|
FT_Int result;
|
||||||
|
|
||||||
|
@ -725,15 +726,21 @@
|
||||||
}
|
}
|
||||||
else /* general case */
|
else /* general case */
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef FT_LONG64
|
#ifdef FT_LONG64
|
||||||
FT_Int64 delta = (long long)in_x * out_y - (long long)in_y * out_x;
|
|
||||||
|
FT_Int64 delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
|
||||||
|
|
||||||
|
|
||||||
if ( delta == 0 )
|
if ( delta == 0 )
|
||||||
result = 0;
|
result = 0;
|
||||||
else
|
else
|
||||||
result = 1 - 2 * ( delta < 0 );
|
result = 1 - 2 * ( delta < 0 );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
FT_Int64 z1, z2;
|
|
||||||
|
FT_Int64 z1, z2;
|
||||||
|
|
||||||
|
|
||||||
ft_multo64( in_x, out_y, &z1 );
|
ft_multo64( in_x, out_y, &z1 );
|
||||||
ft_multo64( in_y, out_x, &z2 );
|
ft_multo64( in_y, out_x, &z2 );
|
||||||
|
@ -748,6 +755,7 @@
|
||||||
result = -1;
|
result = -1;
|
||||||
else
|
else
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,6 +763,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* documentation is in ftcalc.h */
|
||||||
|
|
||||||
FT_BASE_DEF( FT_Int )
|
FT_BASE_DEF( FT_Int )
|
||||||
ft_corner_is_flat( FT_Pos in_x,
|
ft_corner_is_flat( FT_Pos in_x,
|
||||||
FT_Pos in_y,
|
FT_Pos in_y,
|
||||||
|
@ -791,4 +801,6 @@
|
||||||
|
|
||||||
return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
|
return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
@ -886,6 +886,7 @@
|
||||||
#define psh_corner_orientation ft_corner_orientation
|
#define psh_corner_orientation ft_corner_orientation
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Int )
|
FT_LOCAL_DEF( FT_Int )
|
||||||
psh_corner_is_flat( FT_Pos x_in,
|
psh_corner_is_flat( FT_Pos x_in,
|
||||||
FT_Pos y_in,
|
FT_Pos y_in,
|
||||||
|
@ -974,7 +975,8 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* !1 */
|
||||||
|
|
||||||
|
|
||||||
#ifdef COMPUTE_INFLEXS
|
#ifdef COMPUTE_INFLEXS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue