summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/autofit/aflatin.c3
-rw-r--r--src/autofit/aflatin2.c3
-rw-r--r--src/autofit/afloader.c8
-rw-r--r--src/base/ftoutln.c224
-rw-r--r--src/base/ftsynth.c23
-rw-r--r--src/pshinter/pshalgo.c5
-rw-r--r--src/raster/ftmisc.h21
-rw-r--r--src/raster/ftraster.c11
-rw-r--r--src/sfnt/sfobjs.c14
-rw-r--r--src/sfnt/ttload.c15
-rw-r--r--src/sfnt/ttmtx.c4
-rw-r--r--src/smooth/ftgrays.c2
-rw-r--r--src/truetype/ttgload.c9
-rw-r--r--src/truetype/ttinterp.c19
-rw-r--r--src/truetype/ttobjs.c22
15 files changed, 224 insertions, 159 deletions
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 0fd3045..30145a2 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
-/* Copyright 2003-2012 by */
+/* Copyright 2003-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -705,7 +705,6 @@
{
metrics->root.scaler.render_mode = scaler->render_mode;
metrics->root.scaler.face = scaler->face;
- metrics->root.scaler.flags = scaler->flags;
af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 927cce7..ea6af8d 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
-/* Copyright 2003-2012 by */
+/* Copyright 2003-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -658,7 +658,6 @@
{
metrics->root.scaler.render_mode = scaler->render_mode;
metrics->root.scaler.face = scaler->face;
- metrics->root.scaler.flags = scaler->flags;
af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index dabd619..34ef9d8 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -104,11 +104,9 @@
AF_GlyphHints hints = &loader->hints;
FT_GlyphSlot slot = face->glyph;
FT_Slot_Internal internal = slot->internal;
- FT_Int32 flags;
- flags = load_flags | FT_LOAD_LINEAR_DESIGN;
- error = FT_Load_Glyph( face, glyph_index, flags );
+ error = FT_Load_Glyph( face, glyph_index, load_flags );
if ( error )
goto Exit;
@@ -126,6 +124,10 @@
FT_Vector_Transform( &loader->trans_delta, &inverse );
}
+ /* set linear metrics */
+ slot->linearHoriAdvance = slot->metrics.horiAdvance;
+ slot->linearVertAdvance = slot->metrics.vertAdvance;
+
switch ( slot->format )
{
case FT_GLYPH_FORMAT_OUTLINE:
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 76e2b04..9ae276d 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -882,19 +882,9 @@
FT_Outline_Embolden( FT_Outline* outline,
FT_Pos strength )
{
- return FT_Outline_EmboldenXY( outline, strength, strength );
- }
-
-
- /* documentation is in ftoutln.h */
-
- FT_EXPORT_DEF( FT_Error )
- FT_Outline_EmboldenXY( FT_Outline* outline,
- FT_Pos xstrength,
- FT_Pos ystrength )
- {
FT_Vector* points;
FT_Vector v_prev, v_first, v_next, v_cur;
+ FT_Angle rotate, angle_in, angle_out;
FT_Int c, n, first;
FT_Int orientation;
@@ -902,9 +892,8 @@
if ( !outline )
return FT_Err_Invalid_Argument;
- xstrength /= 2;
- ystrength /= 2;
- if ( xstrength == 0 && ystrength == 0 )
+ strength /= 2;
+ if ( strength == 0 )
return FT_Err_Ok;
orientation = FT_Outline_Get_Orientation( outline );
@@ -916,63 +905,62 @@
return FT_Err_Ok;
}
+ if ( orientation == FT_ORIENTATION_TRUETYPE )
+ rotate = -FT_ANGLE_PI2;
+ else
+ rotate = FT_ANGLE_PI2;
+
points = outline->points;
first = 0;
for ( c = 0; c < outline->n_contours; c++ )
{
- FT_Vector in, out, shift;
- FT_Fixed l_in, l_out, d;
- int last = outline->contours[c];
+ int last = outline->contours[c];
v_first = points[first];
v_prev = points[last];
v_cur = v_first;
- /* compute the incoming vector and its length */
- in.x = v_cur.x - v_prev.x;
- in.y = v_cur.y - v_prev.y;
- l_in = FT_Vector_Length( &in );
-
for ( n = first; n <= last; n++ )
{
+ FT_Vector in, out;
+ FT_Angle angle_diff;
+ FT_Pos d;
+ FT_Fixed scale;
+
+
if ( n < last )
v_next = points[n + 1];
else
v_next = v_first;
- /* compute the outgoing vector and its length */
+ /* compute the in and out vectors */
+ in.x = v_cur.x - v_prev.x;
+ in.y = v_cur.y - v_prev.y;
+
out.x = v_next.x - v_cur.x;
out.y = v_next.y - v_cur.y;
- l_out = FT_Vector_Length( &out );
- d = l_in * l_out + in.x * out.x + in.y * out.y;
+ angle_in = FT_Atan2( in.x, in.y );
+ angle_out = FT_Atan2( out.x, out.y );
+ angle_diff = FT_Angle_Diff( angle_in, angle_out );
+ scale = FT_Cos( angle_diff / 2 );
- /* shift only if turn is less then ~160 degrees */
- if ( 16 * d > l_in * l_out )
+ if ( scale < 0x4000L && scale > -0x4000L )
+ in.x = in.y = 0;
+ else
{
- /* shift components are rotated */
- shift.x = FT_DivFix( l_out * in.y + l_in * out.y, d );
- shift.y = FT_DivFix( l_out * in.x + l_in * out.x, d );
+ d = FT_DivFix( strength, scale );
- if ( orientation == FT_ORIENTATION_TRUETYPE )
- shift.x = -shift.x;
- else
- shift.y = -shift.y;
-
- shift.x = FT_MulFix( xstrength, shift.x );
- shift.y = FT_MulFix( ystrength, shift.y );
+ FT_Vector_From_Polar( &in, d, angle_in + angle_diff / 2 - rotate );
}
- else
- shift.x = shift.y = 0;
- outline->points[n].x = v_cur.x + xstrength + shift.x;
- outline->points[n].y = v_cur.y + ystrength + shift.y;
+ outline->points[n].x = v_cur.x + strength + in.x;
+ outline->points[n].y = v_cur.y + strength + in.y;
- in = out;
- l_in = l_out;
- v_cur = v_next;
+ v_prev = v_cur;
+ v_cur = v_next;
}
first = last + 1;
@@ -987,10 +975,23 @@
FT_EXPORT_DEF( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline )
{
- FT_Vector* points;
- FT_Vector v_prev, v_cur;
- FT_Int c, n, first;
- FT_Pos area = 0;
+ FT_Pos xmin = 32768L;
+ FT_Pos xmin_ymin = 32768L;
+ FT_Pos xmin_ymax = -32768L;
+ FT_Vector* xmin_first = NULL;
+ FT_Vector* xmin_last = NULL;
+
+ short* contour;
+
+ FT_Vector* first;
+ FT_Vector* last;
+ FT_Vector* prev;
+ FT_Vector* point;
+
+ int i;
+ FT_Pos ray_y[3];
+ FT_Orientation result[3] =
+ { FT_ORIENTATION_NONE, FT_ORIENTATION_NONE, FT_ORIENTATION_NONE };
if ( !outline || outline->n_points <= 0 )
@@ -1001,32 +1002,127 @@
/* cubic or quadratic curves, this test deals with the polygon */
/* only which is spanned up by the control points. */
- points = outline->points;
-
- first = 0;
- for ( c = 0; c < outline->n_contours; c++ )
+ first = outline->points;
+ for ( contour = outline->contours;
+ contour < outline->contours + outline->n_contours;
+ contour++, first = last + 1 )
{
- FT_Int last = outline->contours[c];
+ FT_Pos contour_xmin = 32768L;
+ FT_Pos contour_xmax = -32768L;
+ FT_Pos contour_ymin = 32768L;
+ FT_Pos contour_ymax = -32768L;
- v_prev = points[last];
+ last = outline->points + *contour;
- for ( n = first; n <= last; n++ )
+ /* skip degenerate contours */
+ if ( last < first + 2 )
+ continue;
+
+ for ( point = first; point <= last; ++point )
{
- v_cur = points[n];
- area += ( v_cur.y - v_prev.y ) * ( v_cur.x + v_prev.x );
- v_prev = v_cur;
+ if ( point->x < contour_xmin )
+ contour_xmin = point->x;
+
+ if ( point->x > contour_xmax )
+ contour_xmax = point->x;
+
+ if ( point->y < contour_ymin )
+ contour_ymin = point->y;
+
+ if ( point->y > contour_ymax )
+ contour_ymax = point->y;
}
- first = last + 1;
+ if ( contour_xmin < xmin &&
+ contour_xmin != contour_xmax &&
+ contour_ymin != contour_ymax )
+ {
+ xmin = contour_xmin;
+ xmin_ymin = contour_ymin;
+ xmin_ymax = contour_ymax;
+ xmin_first = first;
+ xmin_last = last;
+ }
}
- if ( area > 0 )
- return FT_ORIENTATION_POSTSCRIPT;
- else if ( area < 0 )
+ if ( xmin == 32768L )
return FT_ORIENTATION_TRUETYPE;
- else
- return FT_ORIENTATION_NONE;
+
+ ray_y[0] = ( xmin_ymin * 3 + xmin_ymax ) >> 2;
+ ray_y[1] = ( xmin_ymin + xmin_ymax ) >> 1;
+ ray_y[2] = ( xmin_ymin + xmin_ymax * 3 ) >> 2;
+
+ for ( i = 0; i < 3; i++ )
+ {
+ FT_Pos left_x;
+ FT_Pos right_x;
+ FT_Vector* left1;
+ FT_Vector* left2;
+ FT_Vector* right1;
+ FT_Vector* right2;
+
+
+ RedoRay:
+ left_x = 32768L;
+ right_x = -32768L;
+
+ left1 = left2 = right1 = right2 = NULL;
+
+ prev = xmin_last;
+ for ( point = xmin_first; point <= xmin_last; prev = point, ++point )
+ {
+ FT_Pos tmp_x;
+
+
+ if ( point->y == ray_y[i] || prev->y == ray_y[i] )
+ {
+ ray_y[i]++;
+ goto RedoRay;
+ }
+
+ if ( ( point->y < ray_y[i] && prev->y < ray_y[i] ) ||
+ ( point->y > ray_y[i] && prev->y > ray_y[i] ) )
+ continue;
+
+ tmp_x = FT_MulDiv( point->x - prev->x,
+ ray_y[i] - prev->y,
+ point->y - prev->y ) + prev->x;
+
+ if ( tmp_x < left_x )
+ {
+ left_x = tmp_x;
+ left1 = prev;
+ left2 = point;
+ }
+
+ if ( tmp_x > right_x )
+ {
+ right_x = tmp_x;
+ right1 = prev;
+ right2 = point;
+ }
+ }
+
+ if ( left1 && right1 )
+ {
+ if ( left1->y < left2->y && right1->y > right2->y )
+ result[i] = FT_ORIENTATION_TRUETYPE;
+ else if ( left1->y > left2->y && right1->y < right2->y )
+ result[i] = FT_ORIENTATION_POSTSCRIPT;
+ else
+ result[i] = FT_ORIENTATION_NONE;
+ }
+ }
+
+ if ( result[0] != FT_ORIENTATION_NONE &&
+ ( result[0] == result[1] || result[0] == result[2] ) )
+ return result[0];
+
+ if ( result[1] != FT_ORIENTATION_NONE && result[1] == result[2] )
+ return result[1];
+
+ return FT_ORIENTATION_TRUETYPE;
}
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
index 81e2ed2..d4ec0da 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
-/* Copyright 2000-2006, 2010, 2012 by */
+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -33,7 +33,6 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_synth
-
/*************************************************************************/
/*************************************************************************/
/**** ****/
@@ -73,7 +72,7 @@
/*************************************************************************/
/*************************************************************************/
/**** ****/
- /**** EXPERIMENTAL EMBOLDENING SUPPORT ****/
+ /**** EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
@@ -102,7 +101,12 @@
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
/* ignore error */
- (void)FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
+ (void)FT_Outline_Embolden( &slot->outline, xstr );
+
+ /* this is more than enough for most glyphs; if you need accurate */
+ /* values, you have to call FT_Outline_Get_CBox */
+ xstr = xstr * 2;
+ ystr = xstr;
}
else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
{
@@ -139,10 +143,13 @@
if ( slot->advance.y )
slot->advance.y += ystr;
- slot->metrics.width += xstr;
- slot->metrics.height += ystr;
- slot->metrics.horiAdvance += xstr;
- slot->metrics.vertAdvance += ystr;
+ slot->metrics.width += xstr;
+ slot->metrics.height += ystr;
+ slot->metrics.horiBearingY += ystr;
+ slot->metrics.horiAdvance += xstr;
+ slot->metrics.vertBearingX -= xstr / 2;
+ slot->metrics.vertBearingY += ystr;
+ slot->metrics.vertAdvance += ystr;
/* XXX: 16-bit overflow case must be excluded before here */
if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index f4fbb4d..d798978 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -4,7 +4,8 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
-/* Copyright 2001-2010, 2012 by */
+/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 */
+/* by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -562,7 +563,7 @@
else if ( len > 0 )
{
/* This is a very small stem; we simply align it to the
- * pixel grid, trying to find the minimum displacement.
+ * pixel grid, trying to find the minimal displacement.
*
* left = pos
* right = pos + len
diff --git a/src/raster/ftmisc.h b/src/raster/ftmisc.h
index 703155a..7773924 100644
--- a/src/raster/ftmisc.h
+++ b/src/raster/ftmisc.h
@@ -115,27 +115,6 @@
return ( s > 0 ) ? d : -d;
}
-
- static FT_Long
- FT_MulDiv_No_Round( FT_Long a,
- FT_Long b,
- FT_Long c )
- {
- FT_Int s;
- FT_Long d;
-
-
- s = 1;
- if ( a < 0 ) { a = -a; s = -1; }
- if ( b < 0 ) { b = -b; s = -s; }
- if ( c < 0 ) { c = -c; s = -s; }
-
- d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
- : 0x7FFFFFFFL );
-
- return ( s > 0 ) ? d : -d;
- }
-
#endif /* __FTMISC_H__ */
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 7d5bcae..f85845e 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -60,7 +60,7 @@
#include <ft2build.h>
#include "ftraster.h"
-#include FT_INTERNAL_CALC_H /* for FT_MulDiv and FT_MulDiv_No_Round */
+#include FT_INTERNAL_CALC_H /* for FT_MulDiv only */
#include "rastpic.h"
@@ -255,8 +255,7 @@
/* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */
/* for clipping computations. It simply uses the FT_MulDiv() function */
/* defined in `ftcalc.h'. */
-#define SMulDiv FT_MulDiv
-#define SMulDiv_No_Round FT_MulDiv_No_Round
+#define SMulDiv FT_MulDiv
/* The rasterizer is a very general purpose component; please leave */
/* the following redefinitions there (you never know your target */
@@ -1151,14 +1150,14 @@
if ( Dx > 0 )
{
- Ix = SMulDiv_No_Round( ras.precision, Dx, Dy );
+ Ix = SMulDiv( ras.precision, Dx, Dy);
Rx = ( ras.precision * Dx ) % Dy;
Dx = 1;
}
else
{
- Ix = -SMulDiv_No_Round( ras.precision, -Dx, Dy );
- Rx = ( ras.precision * -Dx ) % Dy;
+ Ix = SMulDiv( ras.precision, -Dx, Dy) * -1;
+ Rx = ( ras.precision * -Dx ) % Dy;
Dx = -1;
}
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 2bc4bd9..d7be631 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
-/* Copyright 1996-2008, 2010-2012 by */
+/* Copyright 1996-2008, 2010-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -64,17 +64,13 @@
for ( n = 0; n < len; n++ )
{
code = FT_NEXT_USHORT( read );
-
- if ( code == 0 )
- break;
-
if ( code < 32 || code > 127 )
code = '?';
string[n] = (char)code;
}
- string[n] = 0;
+ string[len] = 0;
return string;
}
@@ -99,17 +95,13 @@
for ( n = 0; n < len; n++ )
{
code = *read++;
-
- if ( code == 0 )
- break;
-
if ( code < 32 || code > 127 )
code = '?';
string[n] = (char)code;
}
- string[n] = 0;
+ string[len] = 0;
return string;
}
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 2beb57b..5fb9aea 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -5,7 +5,8 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
-/* Copyright 1996-2010, 2012 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
+/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -623,7 +624,7 @@
FT_Error error;
TT_MaxProfile* maxProfile = &face->max_profile;
- static const FT_Frame_Field maxp_fields[] =
+ const FT_Frame_Field maxp_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_MaxProfile
@@ -634,7 +635,7 @@
FT_FRAME_END
};
- static const FT_Frame_Field maxp_fields_extra[] =
+ const FT_Frame_Field maxp_fields_extra[] =
{
FT_FRAME_START( 26 ),
FT_FRAME_USHORT( maxPoints ),
@@ -720,7 +721,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* tt_face_load_name */
+ /* tt_face_load_names */
/* */
/* <Description> */
/* Loads the name records. */
@@ -951,7 +952,7 @@
FT_Error error;
TT_OS2* os2;
- static const FT_Frame_Field os2_fields[] =
+ const FT_Frame_Field os2_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_OS2
@@ -1003,7 +1004,7 @@
FT_FRAME_END
};
- static const FT_Frame_Field os2_fields_extra[] =
+ const FT_Frame_Field os2_fields_extra[] =
{
FT_FRAME_START( 8 ),
FT_FRAME_ULONG( ulCodePageRange1 ),
@@ -1011,7 +1012,7 @@
FT_FRAME_END
};
- static const FT_Frame_Field os2_fields_extra2[] =
+ const FT_Frame_Field os2_fields_extra2[] =
{
FT_FRAME_START( 10 ),
FT_FRAME_SHORT ( sxHeight ),
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index 8f7b2a9..73ac8b2 100644
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2009, 2011-2012 by */
+/* Copyright 2006-2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -260,7 +260,7 @@
FT_Error error;
TT_HoriHeader* header;
- static const FT_Frame_Field metrics_header_fields[] =
+ const FT_Frame_Field metrics_header_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_HoriHeader
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 926020a..4c0eea5 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -312,7 +312,7 @@ typedef ptrdiff_t FT_PtrDist;
#endif /* PIXEL_BITS >= 8 */
- /* maximum number of gray spans in a call to the span callback */
+ /* maximal number of gray spans in a call to the span callback */
#define FT_MAX_GRAY_SPANS 32
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 22cbc09..ce8c888 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1983,11 +1983,13 @@
FT_UInt glyph_index,
FT_Int32 load_flags )
{
+ TT_Face face;
FT_Error error;
TT_LoaderRec loader;
- error = TT_Err_Ok;
+ face = (TT_Face)glyph->face;
+ error = TT_Err_Ok;
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
@@ -2001,7 +2003,10 @@
error = load_sbit_image( size, glyph, glyph_index, load_flags );
if ( !error )
{
- if ( FT_IS_SCALABLE( glyph->face ) )
+ FT_Face root = &face->root;
+
+
+ if ( FT_IS_SCALABLE( root ) )
{
/* for the bbox we need the header only */
(void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 3a8680f..3acb24a 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -52,7 +52,7 @@
/* */
/* In order to detect infinite loops in the code, we set up a counter */
/* within the run loop. A single stroke of interpretation is now */
- /* limited to a maximum number of opcodes defined below. */
+ /* limited to a maximal number of opcodes defined below. */
/* */
#define MAX_RUNNABLE_OPCODES 1000000L
@@ -1463,7 +1463,7 @@
#else
- /* compute (a*b)/2^14 with maximum accuracy and rounding */
+ /* compute (a*b)/2^14 with maximal accuracy and rounding */
static FT_Int32
TT_MulFix14( FT_Int32 a,
FT_Int b )
@@ -1493,7 +1493,7 @@
#endif
- /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */
+ /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
static FT_Int32
TT_DotFix14( FT_Int32 ax,
FT_Int32 ay,
@@ -3110,9 +3110,14 @@
CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
-#define DO_SSW \
- CUR.GS.single_width_value = TT_MULFIX( args[0], \
- CUR.tt_metrics.scale );
+ /* XXX: UNDOCUMENTED! or bug in the Windows engine? */
+ /* */
+ /* It seems that the value that is read here is */
+ /* expressed in 16.16 format rather than in font */
+ /* units. */
+ /* */
+#define DO_SSW \
+ CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 );
#define DO_FLIPON \
@@ -5767,7 +5772,7 @@
/* */
/* UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual) */
/* contour in the twilight zone, namely contour number */
- /* zero which includes all points of it. */
+ /* zero. */
/* */
static void
Ins_SHC( INS_ARG )
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 1f8a768..814c713 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -244,7 +244,7 @@
tt_check_trickyness_sfnt_ids( TT_Face face )
{
#define TRICK_SFNT_IDS_PER_FACE 3
-#define TRICK_SFNT_IDS_NUM_FACES 17
+#define TRICK_SFNT_IDS_NUM_FACES 13
static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
[TRICK_SFNT_IDS_PER_FACE] = {
@@ -317,26 +317,6 @@
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x0d3de9cb, 0x00000141 }, /* fpgm */
{ 0xd4127766, 0x00002280 } /* prep */
- },
- { /* NEC FA-Gothic, 1996 */
- { 0x00000000, 0x00000000 }, /* cvt */
- { 0x4a692698, 0x000001f0 }, /* fpgm */
- { 0x340d4346, 0x00001fca } /* prep */
- },
- { /* NEC FA-Minchou, 1996 */
- { 0x00000000, 0x00000000 }, /* cvt */
- { 0xcd34c604, 0x00000166 }, /* fpgm */
- { 0x6cf31046, 0x000022b0 } /* prep */
- },
- { /* NEC FA-RoundGothicB, 1996 */
- { 0x00000000, 0x00000000 }, /* cvt */
- { 0x5da75315, 0x0000019d }, /* fpgm */
- { 0x40745a5f, 0x000022e0 } /* prep */
- },
- { /* NEC FA-RoundGothicM, 1996 */
- { 0x00000000, 0x00000000 }, /* cvt */
- { 0xf055fc48, 0x000001c2 }, /* fpgm */
- { 0x3900ded3, 0x00001e18 } /* prep */
}
};