aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/base
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-04-02 14:12:40 +0000
committermarha <marha@users.sourceforge.net>2010-04-02 14:12:40 +0000
commit83fa9a9811e2c18cffd83a020757f7fb51ffddaa (patch)
treed71b6212a53834b53334c3bd14c63eeafd88ad20 /freetype/src/base
parent1d59691fe77c20ecb010ea8589a940c4ea6ac356 (diff)
downloadvcxsrv-83fa9a9811e2c18cffd83a020757f7fb51ffddaa.tar.gz
vcxsrv-83fa9a9811e2c18cffd83a020757f7fb51ffddaa.tar.bz2
vcxsrv-83fa9a9811e2c18cffd83a020757f7fb51ffddaa.zip
Updated to following packages:
freetype-2.3.12
Diffstat (limited to 'freetype/src/base')
-rw-r--r--freetype/src/base/ftbase.h6
-rw-r--r--freetype/src/base/ftbbox.c6
-rw-r--r--freetype/src/base/ftdbgmem.c2
-rw-r--r--freetype/src/base/ftglyph.c6
-rw-r--r--freetype/src/base/ftinit.c4
-rw-r--r--freetype/src/base/ftobjs.c28
-rw-r--r--freetype/src/base/ftoutln.c8
-rw-r--r--freetype/src/base/ftpatent.c9
-rw-r--r--freetype/src/base/ftstroke.c14
-rw-r--r--freetype/src/base/ftsynth.c4
10 files changed, 56 insertions, 31 deletions
diff --git a/freetype/src/base/ftbase.h b/freetype/src/base/ftbase.h
index 9cae85da9..1dc49f3bd 100644
--- a/freetype/src/base/ftbase.h
+++ b/freetype/src/base/ftbase.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private functions used in base module (specification). */
/* */
-/* Copyright 2008 by */
+/* Copyright 2008, 2010 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,7 +29,7 @@ FT_BEGIN_HEADER
/* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
/* font, and try to load a face specified by the face_index. */
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
@@ -40,7 +40,7 @@ FT_BEGIN_HEADER
/* Create a new FT_Face given a buffer and a driver name. */
/* From ftmac.c. */
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
open_face_from_buffer( FT_Library library,
FT_Byte* base,
FT_ULong size,
diff --git a/freetype/src/base/ftbbox.c b/freetype/src/base/ftbbox.c
index 8136ccc1e..4b8e9112f 100644
--- a/freetype/src/base/ftbbox.c
+++ b/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
/* */
/* FreeType bbox computation (body). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2006 by */
+/* Copyright 1996-2001, 2002, 2004, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -140,7 +140,7 @@
/* */
/* <Description> */
/* This function is used as a `conic_to' emitter during */
- /* FT_Raster_Decompose(). It checks a conic Bezier curve with the */
+ /* FT_Outline_Decompose(). It checks a conic Bezier curve with the */
/* current bounding box, and computes its extrema if necessary to */
/* update it. */
/* */
@@ -507,7 +507,7 @@
/* */
/* <Description> */
/* This function is used as a `cubic_to' emitter during */
- /* FT_Raster_Decompose(). It checks a cubic Bezier curve with the */
+ /* FT_Outline_Decompose(). It checks a cubic Bezier curve with the */
/* current bounding box, and computes its extrema if necessary to */
/* update it. */
/* */
diff --git a/freetype/src/base/ftdbgmem.c b/freetype/src/base/ftdbgmem.c
index 677f24208..160269d19 100644
--- a/freetype/src/base/ftdbgmem.c
+++ b/freetype/src/base/ftdbgmem.c
@@ -989,7 +989,7 @@
#else /* !FT_DEBUG_MEMORY */
/* ANSI C doesn't like empty source files */
- static const FT_Byte _debug_mem_dummy = 0;
+ typedef int _debug_mem_dummy;
#endif /* !FT_DEBUG_MEMORY */
diff --git a/freetype/src/base/ftglyph.c b/freetype/src/base/ftglyph.c
index ef61d45df..3505d6dde 100644
--- a/freetype/src/base/ftglyph.c
+++ b/freetype/src/base/ftglyph.c
@@ -372,7 +372,7 @@
if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
clazz = FT_BITMAP_GLYPH_CLASS_GET;
- /* it it is an outline too */
+ /* if it is an outline */
else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
clazz = FT_OUTLINE_GLYPH_CLASS_GET;
@@ -515,6 +515,10 @@
const FT_Glyph_Class* clazz;
+#ifdef FT_CONFIG_OPTION_PIC
+ FT_Library library = FT_GLYPH( glyph )->library;
+#endif
+
/* check argument */
if ( !the_glyph )
diff --git a/freetype/src/base/ftinit.c b/freetype/src/base/ftinit.c
index ef1350386..f94f25a83 100644
--- a/freetype/src/base/ftinit.c
+++ b/freetype/src/base/ftinit.c
@@ -115,7 +115,7 @@
FT_Module_Class** classes;
FT_Memory memory;
FT_UInt i;
- BasePIC* pic_container = library->pic_container.base;
+ BasePIC* pic_container = (BasePIC*)library->pic_container.base;
if ( !pic_container->default_module_classes )
return;
@@ -145,7 +145,7 @@
FT_Module_Class** classes;
FT_Module_Class* clazz;
FT_UInt i;
- BasePIC* pic_container = library->pic_container.base;
+ BasePIC* pic_container = (BasePIC*)library->pic_container.base;
memory = library->memory;
pic_container->default_module_classes = 0;
diff --git a/freetype/src/base/ftobjs.c b/freetype/src/base/ftobjs.c
index 421540c8d..46bcd3bb8 100644
--- a/freetype/src/base/ftobjs.c
+++ b/freetype/src/base/ftobjs.c
@@ -4,7 +4,8 @@
/* */
/* The FreeType private base classes (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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, */
@@ -37,7 +38,9 @@
#include FT_SERVICE_KERNING_H
#include FT_SERVICE_TRUETYPE_ENGINE_H
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
#include "ftbase.h"
+#endif
#define GRID_FIT_METRICS
@@ -708,8 +711,8 @@
}
/* compute the linear advance in 16.16 pixels */
- if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
- ( FT_IS_SCALABLE( face ) ) )
+ if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
+ ( FT_IS_SCALABLE( face ) ) )
{
FT_Size_Metrics* metrics = &face->size->metrics;
@@ -739,11 +742,30 @@
renderer, slot,
&internal->transform_matrix,
&internal->transform_delta );
+ else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
+ {
+ /* apply `standard' transformation if no renderer is available */
+ if ( &internal->transform_matrix )
+ FT_Outline_Transform( &slot->outline,
+ &internal->transform_matrix );
+
+ if ( &internal->transform_delta )
+ FT_Outline_Translate( &slot->outline,
+ internal->transform_delta.x,
+ internal->transform_delta.y );
+ }
+
/* transform advance */
FT_Vector_Transform( &slot->advance, &internal->transform_matrix );
}
}
+ FT_TRACE5(( " x advance: %d\n" , slot->advance.x ));
+ FT_TRACE5(( " y advance: %d\n" , slot->advance.y ));
+
+ FT_TRACE5(( " linear x advance: %d\n" , slot->linearHoriAdvance ));
+ FT_TRACE5(( " linear y advance: %d\n" , slot->linearVertAdvance ));
+
/* do we need to render the image now? */
if ( !error &&
slot->format != FT_GLYPH_FORMAT_BITMAP &&
diff --git a/freetype/src/base/ftoutln.c b/freetype/src/base/ftoutln.c
index 49ef82e27..b69df84c0 100644
--- a/freetype/src/base/ftoutln.c
+++ b/freetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -304,9 +304,9 @@
*anoutline = null_outline;
- if ( FT_NEW_ARRAY( anoutline->points, numPoints * 2L ) ||
- FT_NEW_ARRAY( anoutline->tags, numPoints ) ||
- FT_NEW_ARRAY( anoutline->contours, numContours ) )
+ if ( FT_NEW_ARRAY( anoutline->points, numPoints ) ||
+ FT_NEW_ARRAY( anoutline->tags, numPoints ) ||
+ FT_NEW_ARRAY( anoutline->contours, numContours ) )
goto Fail;
anoutline->n_points = (FT_UShort)numPoints;
diff --git a/freetype/src/base/ftpatent.c b/freetype/src/base/ftpatent.c
index 236d9a674..501cab52c 100644
--- a/freetype/src/base/ftpatent.c
+++ b/freetype/src/base/ftpatent.c
@@ -5,7 +5,7 @@
/* FreeType API for checking patented TrueType bytecode instructions */
/* (body). */
/* */
-/* Copyright 2007, 2008 by David Turner. */
+/* Copyright 2007, 2008, 2010 by David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -114,7 +114,7 @@
FT_ULong tag )
{
FT_Stream stream = face->stream;
- FT_Error error = FT_Err_Ok;
+ FT_Error error = FT_Err_Ok;
FT_Service_SFNT_Table service;
FT_Bool result = FALSE;
@@ -124,13 +124,14 @@
if ( service )
{
FT_UInt i = 0;
- FT_ULong tag_i = 0, offset_i, length_i;
+ FT_ULong tag_i = 0, offset_i = 0, length_i = 0;
+
for ( i = 0; !error && tag_i != tag ; i++ )
error = service->table_info( face, i,
&tag_i, &offset_i, &length_i );
- if ( error ||
+ if ( error ||
FT_STREAM_SEEK( offset_i ) )
goto Exit;
diff --git a/freetype/src/base/ftstroke.c b/freetype/src/base/ftstroke.c
index 0978b0ed9..75bcbded6 100644
--- a/freetype/src/base/ftstroke.c
+++ b/freetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (body). */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
+/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -979,7 +979,8 @@
thcos = FT_Cos( theta );
sigma = FT_MulFix( stroker->miter_limit, thcos );
- if ( sigma >= 0x10000L )
+ /* FT_Sin(x) = 0 for x <= 57 */
+ if ( sigma >= 0x10000L || ft_pos_abs( theta ) <= 57 )
miter = FALSE;
if ( miter ) /* this is a miter (broken angle) */
@@ -1360,7 +1361,7 @@
phi1 = (angle_mid + angle_in ) / 2;
phi2 = (angle_mid + angle_out ) / 2;
length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) );
- length2 = FT_DivFix( stroker->radius, FT_Cos(theta2) );
+ length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) );
for ( side = 0; side <= 1; side++ )
{
@@ -1735,13 +1736,10 @@
}
else
{
- /* if both first and last points are conic, */
- /* start at their middle and record its position */
- /* for closure */
+ /* if both first and last points are conic, */
+ /* start at their middle */
v_start.x = ( v_start.x + v_last.x ) / 2;
v_start.y = ( v_start.y + v_last.y ) / 2;
-
- v_last = v_start;
}
point--;
tags--;
diff --git a/freetype/src/base/ftsynth.c b/freetype/src/base/ftsynth.c
index 326d8e73e..ba3c633e2 100644
--- a/freetype/src/base/ftsynth.c
+++ b/freetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 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, */
@@ -100,8 +100,8 @@
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
- error = FT_Outline_Embolden( &slot->outline, xstr );
/* ignore error */
+ (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 */