[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force X.Org X11 SVN commit: r2571 - in branches/7.1/lib/libxfont: . include/X11/fonts src src/FreeType src/Type1 src/builtins src/fc src/fontfile src/stubs src/util



Author: dparsons
Date: 2006-07-26 23:20:04 -0400 (Wed, 26 Jul 2006)
New Revision: 2571

Modified:
   branches/7.1/lib/libxfont/ChangeLog
   branches/7.1/lib/libxfont/Makefile.am
   branches/7.1/lib/libxfont/Makefile.in
   branches/7.1/lib/libxfont/configure
   branches/7.1/lib/libxfont/configure.ac
   branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h
   branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h.in
   branches/7.1/lib/libxfont/include/X11/fonts/fontmisc.h
   branches/7.1/lib/libxfont/src/FreeType/ftfuncs.c
   branches/7.1/lib/libxfont/src/FreeType/ftfuncs.h
   branches/7.1/lib/libxfont/src/FreeType/ftsystem.c
   branches/7.1/lib/libxfont/src/Makefile.am
   branches/7.1/lib/libxfont/src/Makefile.in
   branches/7.1/lib/libxfont/src/Type1/scanfont.c
   branches/7.1/lib/libxfont/src/builtins/fpe.c
   branches/7.1/lib/libxfont/src/builtins/render.c
   branches/7.1/lib/libxfont/src/fc/fserve.c
   branches/7.1/lib/libxfont/src/fc/fstrans.c
   branches/7.1/lib/libxfont/src/fontfile/fontdir.c
   branches/7.1/lib/libxfont/src/fontfile/fontfile.c
   branches/7.1/lib/libxfont/src/stubs/cauthgen.c
   branches/7.1/lib/libxfont/src/stubs/csignal.c
   branches/7.1/lib/libxfont/src/stubs/delfntcid.c
   branches/7.1/lib/libxfont/src/stubs/errorf.c
   branches/7.1/lib/libxfont/src/stubs/fatalerror.c
   branches/7.1/lib/libxfont/src/stubs/findoldfnt.c
   branches/7.1/lib/libxfont/src/stubs/getcres.c
   branches/7.1/lib/libxfont/src/stubs/getdefptsize.c
   branches/7.1/lib/libxfont/src/stubs/getnewfntcid.c
   branches/7.1/lib/libxfont/src/stubs/gettime.c
   branches/7.1/lib/libxfont/src/stubs/initfshdl.c
   branches/7.1/lib/libxfont/src/stubs/regfpefunc.c
   branches/7.1/lib/libxfont/src/stubs/rmfshdl.c
   branches/7.1/lib/libxfont/src/stubs/servclient.c
   branches/7.1/lib/libxfont/src/stubs/setfntauth.c
   branches/7.1/lib/libxfont/src/stubs/stfntcfnt.c
   branches/7.1/lib/libxfont/src/stubs/stubs.h
   branches/7.1/lib/libxfont/src/stubs/xpstubs.c
   branches/7.1/lib/libxfont/src/util/Makefile.am
   branches/7.1/lib/libxfont/src/util/Makefile.in
   branches/7.1/lib/libxfont/src/util/atom.c
   branches/7.1/lib/libxfont/src/util/miscutil.c
Log:
Upgraded to libXfont 1.2.


Modified: branches/7.1/lib/libxfont/ChangeLog
===================================================================
--- branches/7.1/lib/libxfont/ChangeLog	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/ChangeLog	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,3 +1,36 @@
+2006-06-02  Alan Coopersmith  <alan.coopersmith@sun.com>
+
+	* src/fontfile/fontfile.c (FontFileListOneFontWithInfo): 
+	Coverity #1541: Double free of pointer "ranges" in call to "Xfree"
+
+2006-06-01  Adam Jackson  <ajax@freedesktop.org>
+
+	* include/X11/fonts/fontmisc.h:
+	* src/stubs/cauthgen.c:
+	* src/stubs/csignal.c:
+	* src/stubs/delfntcid.c:
+	* src/stubs/errorf.c:
+	* src/stubs/fatalerror.c:
+	* src/stubs/findoldfnt.c:
+	* src/stubs/getcres.c:
+	* src/stubs/getdefptsize.c:
+	* src/stubs/getnewfntcid.c:
+	* src/stubs/gettime.c:
+	* src/stubs/initfshdl.c:
+	* src/stubs/regfpefunc.c:
+	* src/stubs/rmfshdl.c:
+	* src/stubs/servclient.c:
+	* src/stubs/setfntauth.c:
+	* src/stubs/stfntcfnt.c:
+	* src/stubs/stubs.h:
+	* src/stubs/xpstubs.c:
+	* src/util/Makefile.am:
+	* src/util/atom.c:
+	* src/util/miscutil.c:
+	For the 20-odd symbols defined both in libXfont and the X server,
+	emit them as weak symbols so that the linker will prefer the
+	server's definition when present.
+
 2006-04-01  Adam Jackson  <ajax@freedesktop.org>
 
 	* Makefile.am:

Modified: branches/7.1/lib/libxfont/Makefile.am
===================================================================
--- branches/7.1/lib/libxfont/Makefile.am	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/Makefile.am	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,5 @@
 # 
-#  $Id: Makefile.am,v 1.6 2005/07/02 21:22:31 keithp Exp $
+#  $Id$
 # 
 #  Copyright © 2003 Keith Packard, Noah Levitt
 # 

Modified: branches/7.1/lib/libxfont/Makefile.in
===================================================================
--- branches/7.1/lib/libxfont/Makefile.in	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/Makefile.in	2006-07-27 03:20:04 UTC (rev 2571)
@@ -15,7 +15,7 @@
 @SET_MAKE@
 
 # 
-#  $Id: Makefile.am,v 1.6 2005/07/02 21:22:31 keithp Exp $
+#  $Id$
 # 
 #  Copyright © 2003 Keith Packard, Noah Levitt
 # 

Modified: branches/7.1/lib/libxfont/configure
===================================================================
--- branches/7.1/lib/libxfont/configure	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/configure	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libXfont 1.1.0.
+# Generated by GNU Autoconf 2.59 for libXfont 1.2.0.
 #
 # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
 #
@@ -423,8 +423,8 @@
 # Identity of this package.
 PACKAGE_NAME='libXfont'
 PACKAGE_TARNAME='libXfont'
-PACKAGE_VERSION='1.1.0'
-PACKAGE_STRING='libXfont 1.1.0'
+PACKAGE_VERSION='1.2.0'
+PACKAGE_STRING='libXfont 1.2.0'
 PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
 
 # Factoring default headers for most tests.
@@ -981,7 +981,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libXfont 1.1.0 to adapt to many kinds of systems.
+\`configure' configures libXfont 1.2.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1047,7 +1047,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libXfont 1.1.0:";;
+     short | recursive ) echo "Configuration of libXfont 1.2.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1216,7 +1216,7 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-libXfont configure 1.1.0
+libXfont configure 1.2.0
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1230,7 +1230,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libXfont $as_me 1.1.0, which was
+It was created by libXfont $as_me 1.2.0, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1873,7 +1873,7 @@
 
 # Define the identity of the package.
  PACKAGE='libXfont'
- VERSION='1.1.0'
+ VERSION='1.2.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21008,7 +21008,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by libXfont $as_me 1.1.0, which was
+This file was extended by libXfont $as_me 1.2.0, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21071,7 +21071,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-libXfont config.status 1.1.0
+libXfont config.status 1.2.0
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 

Modified: branches/7.1/lib/libxfont/configure.ac
===================================================================
--- branches/7.1/lib/libxfont/configure.ac	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/configure.ac	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,5 @@
 dnl 
-dnl  $Id: configure.ac,v 1.21 2005/12/09 06:55:26 kem Exp $
+dnl  $Id$
 dnl 
 dnl  Copyright © 2003 Keith Packard
 dnl 
@@ -26,7 +26,7 @@
 AC_PREREQ([2.57])
 
 AC_INIT([libXfont],
-	1.1.0,
+	1.2.0,
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 	libXfont)
 dnl

Modified: branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h
===================================================================
--- branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,6 +1,6 @@
 /* include/X11/fonts/fontconf.h.  Generated by configure.  */
 /*
- * $Id: $
+ * $Id$
  *
  * Copyright © 2005 Keith Packard
  *

Modified: branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h.in
===================================================================
--- branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h.in	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/include/X11/fonts/fontconf.h.in	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,5 @@
 /*
- * $Id: $
+ * $Id$
  *
  * Copyright © 2005 Keith Packard
  *

Modified: branches/7.1/lib/libxfont/include/X11/fonts/fontmisc.h
===================================================================
--- branches/7.1/lib/libxfont/include/X11/fonts/fontmisc.h	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/include/X11/fonts/fontmisc.h	2006-07-27 03:20:04 UTC (rev 2571)
@@ -47,7 +47,7 @@
 
 #endif /* FONTMODULE */
 
-#include "X11/Xdefs.h"
+#include <X11/Xdefs.h>
 
 
 #ifndef LSBFirst

Modified: branches/7.1/lib/libxfont/src/FreeType/ftfuncs.c
===================================================================
--- branches/7.1/lib/libxfont/src/FreeType/ftfuncs.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/FreeType/ftfuncs.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -25,7 +25,7 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
-/* $XdotOrg: lib/Xfont/src/FreeType/ftfuncs.c,v 1.13 2005/10/23 18:32:05 ajax Exp $ */
+/* $XdotOrg: xc/lib/font/FreeType/ftfuncs.c,v 1.11 2005/07/03 07:00:58 daniels Exp $ */
 
 /* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.43 2004/02/07 04:37:18 dawes Exp $ */
 
@@ -54,10 +54,7 @@
 #include FT_TYPE1_TABLES_H
 #include FT_XFREE86_H
 #include FT_BBOX_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
 #include FT_TRUETYPE_TAGS_H
-#include FT_INTERNAL_SFNT_H
-#include FT_INTERNAL_STREAM_H
 /*
  *  If you want to use FT_Outline_Get_CBox instead of 
  *  FT_Outline_Get_BBox, define here.
@@ -123,6 +120,25 @@
 };
 
 
+/* read 2-byte value from a SFNT table */
+static FT_UShort
+sfnt_get_ushort( FT_Face     face,
+                 FT_ULong    table_tag,
+                 FT_ULong    table_offset )
+{
+  FT_Byte    buff[2];
+  FT_ULong   len = sizeof(buff);
+  FT_UShort  result = 0;
+
+  if ( !FT_Load_Sfnt_Table( face, table_tag, table_offset, buff, &len ) );
+    result = (FT_UShort)( (buff[0] << 8) | buff[1] );
+
+  return result;
+}
+
+#define  sfnt_get_short(f,t,o)  ((FT_Short)sfnt_get_ushort((f),(t),(o)))
+
+
 static int ftypeInitP = 0;      /* is the engine initialised? */
 FT_Library ftypeLibrary;
 
@@ -211,6 +227,10 @@
         if(maxp && maxp->maxContours == 0)
             face->bitmap = 1;
     }
+
+    face->num_hmetrics = (FT_UInt) sfnt_get_ushort( face->face,
+                                                    TTAG_hhea, 34 );
+
     /* Insert face in hashtable and return it */
     face->next = faceTable[bucket];
     faceTable[bucket] = face;
@@ -462,6 +482,34 @@
     }
 
     if( FT_IS_SFNT( face->face ) ) {
+#if 1
+        FT_F26Dot6  tt_char_width, tt_char_height, tt_dim_x, tt_dim_y;
+        FT_UInt     nn;
+
+        instance->strike_index=0xFFFFU;
+
+        tt_char_width  = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
+        tt_char_height = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
+
+        tt_dim_x = FLOOR64( ( tt_char_width  * trans->xres + 36 ) / 72 + 32 );
+        tt_dim_y = FLOOR64( ( tt_char_height * trans->yres + 36 ) / 72 + 32 );
+
+	if ( tt_dim_x && !tt_dim_y )
+	    tt_dim_y = tt_dim_x;
+	else if ( !tt_dim_x && tt_dim_y )
+	    tt_dim_x = tt_dim_y;
+
+        for ( nn = 0; nn < face->face->num_fixed_sizes; nn++ )
+        {
+          FT_Bitmap_Size*  sz = &face->face->available_sizes[nn];
+
+          if ( tt_dim_x == FLOOR64(sz->x_ppem + 32) && tt_dim_y == FLOOR64(sz->y_ppem + 32) )
+          {
+            instance->strike_index = nn;
+            break;
+          }
+        }
+#else
 	/* See Set_Char_Sizes() in ttdriver.c */
 	FT_Error err;
 	TT_Face tt_face;
@@ -486,6 +534,7 @@
 	sfnt   = (SFNT_Service)tt_face->sfnt;
 	err = sfnt->set_sbit_strike(tt_face,tt_x_ppem,tt_y_ppem,&instance->strike_index);
 	if ( err ) instance->strike_index=0xFFFFU;
+#endif
     }
 
     /* maintain a linked list of instances */
@@ -803,38 +852,69 @@
  * parse the htmx field in TrueType font.
  */
 
-/* from src/truetype/ttgload.c */
 static void
-tt_get_metrics( TT_HoriHeader*  header,
+tt_get_metrics( FT_Face         face,
 		FT_UInt         idx,
+		FT_UInt         num_hmetrics,
 		FT_Short*       bearing,
 		FT_UShort*      advance )
-/*  Copyright 1996-2001, 2002 by                      */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg. */
 {
-    TT_LongMetrics  longs_m;
-    FT_UShort       k = header->number_Of_HMetrics;
+   /* read the metrics directly from the horizontal header, we
+    * parse the SFNT table directly through the standard FreeType API.
+    * this works with any version of the library and doesn't need to
+    * peek at its internals. Maybe a bit less
+    */
+    FT_UInt  count  = num_hmetrics;
+    FT_ULong length = 0;
+    FT_ULong offset = 0;
+    FT_Error error;
 
-    if ( k == 0 ) {
-	*bearing = *advance = 0;
-	return;
-    }
+    error = FT_Load_Sfnt_Table( face, TTAG_hmtx, 0, NULL, &length );
 
-    if ( idx < (FT_UInt)k ) {
-	longs_m  = (TT_LongMetrics )header->long_metrics + idx;
-	*bearing = longs_m->bearing;
-	*advance = longs_m->advance;
+    if ( count == 0 || error )
+    {
+      *advance = 0;
+      *bearing = 0;
     }
-    else {
-	*bearing = ((TT_ShortMetrics*)header->short_metrics)[idx - k];
-	*advance = ((TT_LongMetrics )header->long_metrics)[k - 1].advance;
+    else if ( idx < count )
+    {
+	offset = idx * 4L;
+	if ( offset + 4 > length )
+	{
+	    *advance = 0;
+	    *bearing = 0;
+	}
+	else
+	{
+	    *advance = sfnt_get_ushort( face, TTAG_hmtx, offset );
+	    *bearing = sfnt_get_short ( face, TTAG_hmtx, offset+2 );
+	}
     }
+    else
+    {
+	offset = 4L * (count - 1);
+	if ( offset + 4 > length )
+	{
+	    *advance = 0;
+	    *bearing = 0;
+	}
+	else
+	{
+	    *advance = sfnt_get_ushort ( face, TTAG_hmtx, offset );
+	    offset += 4 + 2 * ( idx - count );
+	    if ( offset + 2 > length)
+		*bearing = 0;
+	    else
+		*bearing = sfnt_get_short ( face, TTAG_hmtx, offset );
+    }
+    }
 }
 
 static int                   
 ft_get_very_lazy_bbox( FT_UInt index,
 		       FT_Face face,
 		       FT_Size size,
+		       FT_UInt num_hmetrics,
 		       double slant,
 		       FT_Matrix *matrix,
 		       FT_BBox *bbox,
@@ -842,15 +922,14 @@
 		       FT_Long *vertAdvance)
 {
     if ( FT_IS_SFNT( face ) ) {
-	TT_Face   ttface = (TT_Face)face;
 	FT_Size_Metrics *smetrics = &size->metrics;
 	FT_Short  leftBearing = 0;
 	FT_UShort advance = 0;
 	FT_Vector p0, p1, p2, p3;
 
 	/* horizontal */
-	tt_get_metrics(&ttface->horizontal, index,
-		       &leftBearing, &advance);
+	tt_get_metrics( face, index, num_hmetrics,
+		       &leftBearing, &advance );
 
 #if 0
 	fprintf(stderr,"x_scale=%f y_scale=%f\n",
@@ -910,7 +989,27 @@
 		    FT_UShort glyph_index, FT_Glyph_Metrics *metrics_return,
 		    int *sbitchk_incomplete_but_exist )
 {
-#if (FREETYPE_VERSION >= 2001008)
+#if 1
+    if ( strike_index != 0xFFFFU && ft_face->available_sizes != NULL )
+    {
+      FT_Error         error;
+      FT_Bitmap_Size*  sz = &ft_face->available_sizes[strike_index];
+
+      error = FT_Set_Pixel_Sizes( ft_face, sz->x_ppem/64, sz->y_ppem/64 );
+      if ( !error )
+      {
+        error = FT_Load_Glyph( ft_face, glyph_index, FT_LOAD_SBITS_ONLY );
+        if ( !error )
+        {
+          if ( metrics_return != NULL )
+            *metrics_return = ft_face->glyph->metrics;
+
+          return 0;
+        }
+      }
+    }
+    return -1;
+#elif (FREETYPE_VERSION >= 2001008)
     SFNT_Service       sfnt;
     TT_Face            face;
     FT_Error           error;
@@ -1043,6 +1142,7 @@
 	    if( bitmap_metrics == NULL ) {
 		if ( sbitchk_incomplete_but_exist==0 && (instance->ttcap.flags & TTCAP_IS_VERY_LAZY) ) {
 		    if( ft_get_very_lazy_bbox( idx, face->face, instance->size, 
+					       face->num_hmetrics,
 					       instance->ttcap.vl_slant,
 					       &instance->transformation.matrix,
 					       &bbox, &outline_hori_advance, 
@@ -1207,10 +1307,27 @@
 	}
 
 	if( face->face->glyph->format != FT_GLYPH_FORMAT_BITMAP ) {
+#ifdef USE_GET_CBOX
+	    FT_Outline_Get_CBox(&face->face->glyph->outline, &bbox);
+	    ftrc = 0;
+#else
+	    ftrc = FT_Outline_Get_BBox(&face->face->glyph->outline, &bbox);
+#endif
+	    if( ftrc != 0 ) return FTtoXReturnCode(ftrc);
+	    bbox.yMin = FLOOR64( bbox.yMin );
+	    bbox.yMax = CEIL64 ( bbox.yMax );
+	    ht_actual = ( bbox.yMax - bbox.yMin ) >> 6;
+	    /* FreeType think a glyph with 0 height control box is invalid. 
+	     * So just let X to create a empty bitmap instead. */
+	    if ( ht_actual == 0 )
+		is_outline = -1;
+	    else
+	    {
 	    ftrc = FT_Render_Glyph(face->face->glyph,FT_RENDER_MODE_MONO);
 	    if( ftrc != 0 ) return FTtoXReturnCode(ftrc);
 	    is_outline = 1;
 	}
+	}
 	else{
 	    is_outline=0;
 	}
@@ -1221,6 +1338,7 @@
 	if( is_outline == 1 ){
 	    if( correct ){
 		if( ft_get_very_lazy_bbox( idx, face->face, instance->size, 
+					   face->num_hmetrics,
 					   instance->ttcap.vl_slant,
 					   &instance->transformation.matrix,
 					   &bbox, &outline_hori_advance, 

Modified: branches/7.1/lib/libxfont/src/FreeType/ftfuncs.h
===================================================================
--- branches/7.1/lib/libxfont/src/FreeType/ftfuncs.h	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/FreeType/ftfuncs.h	2006-07-27 03:20:04 UTC (rev 2571)
@@ -47,6 +47,7 @@
     char *filename;
     FT_Face face;
     int bitmap;
+    FT_UInt num_hmetrics;
     struct _FTInstance *instances;
     struct _FTInstance *active_instance;
     struct _FTFace *next;       /* link to next face in bucket */

Modified: branches/7.1/lib/libxfont/src/FreeType/ftsystem.c
===================================================================
--- branches/7.1/lib/libxfont/src/FreeType/ftsystem.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/FreeType/ftsystem.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -35,7 +35,6 @@
 #endif
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
-#include FT_INTERNAL_DEBUG_H
 #include FT_SYSTEM_H
 #include FT_ERRORS_H
 #include FT_TYPES_H

Modified: branches/7.1/lib/libxfont/src/Makefile.am
===================================================================
--- branches/7.1/lib/libxfont/src/Makefile.am	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/Makefile.am	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,5 @@
 # 
-#  $Id: Makefile.am,v 1.3 2005/07/14 14:56:13 ajax Exp $
+#  $Id$
 # 
 #  Copyright © 2003 Keith Packard, Noah Levitt
 # 

Modified: branches/7.1/lib/libxfont/src/Makefile.in
===================================================================
--- branches/7.1/lib/libxfont/src/Makefile.in	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/Makefile.in	2006-07-27 03:20:04 UTC (rev 2571)
@@ -15,7 +15,7 @@
 @SET_MAKE@
 
 # 
-#  $Id: Makefile.am,v 1.3 2005/07/14 14:56:13 ajax Exp $
+#  $Id$
 # 
 #  Copyright © 2003 Keith Packard, Noah Levitt
 # 

Modified: branches/7.1/lib/libxfont/src/Type1/scanfont.c
===================================================================
--- branches/7.1/lib/libxfont/src/Type1/scanfont.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/Type1/scanfont.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/Type1/scanfont.c,v 1.5 2005/07/09 23:30:06 keithp Exp $ */
+/* $XdotOrg: xc/lib/font/Type1/scanfont.c,v 1.5 2005/07/09 23:18:27 keithp Exp $ */
 /* $Xorg: scanfont.c,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */
 /* Copyright International Business Machines,Corp. 1991
  * All Rights Reserved

Modified: branches/7.1/lib/libxfont/src/builtins/fpe.c
===================================================================
--- branches/7.1/lib/libxfont/src/builtins/fpe.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/builtins/fpe.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/builtins/fpe.c,v 1.5 2005/07/30 18:56:32 alanc Exp $ */
+/* $XdotOrg: $ */
 /*
  * Id: fpe.c,v 1.2 1999/11/02 06:16:48 keithp Exp $
  *

Modified: branches/7.1/lib/libxfont/src/builtins/render.c
===================================================================
--- branches/7.1/lib/libxfont/src/builtins/render.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/builtins/render.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/builtins/render.c,v 1.5 2005/07/30 18:56:32 alanc Exp $ */
+/* $XdotOrg: $ */
 /*
  * Id: render.c,v 1.2 1999/11/02 06:16:48 keithp Exp $
  *

Modified: branches/7.1/lib/libxfont/src/fc/fserve.c
===================================================================
--- branches/7.1/lib/libxfont/src/fc/fserve.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/fc/fserve.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/fc/fserve.c,v 1.9 2006/02/21 21:35:32 daniels Exp $ */
+/* $XdotOrg: lib/Xfont/src/fc/fserve.c,v 1.8 2005/07/09 06:36:12 keithp Exp $ */
 /* $Xorg: fserve.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */
 /*
 

Modified: branches/7.1/lib/libxfont/src/fc/fstrans.c
===================================================================
--- branches/7.1/lib/libxfont/src/fc/fstrans.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/fc/fstrans.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,5 @@
 /*
- * $Id: fstrans.c,v 1.1 2005/05/27 05:17:52 josh Exp $
+ * $Id$
  *
  * Copyright © 2004 Keith Packard
  *

Modified: branches/7.1/lib/libxfont/src/fontfile/fontdir.c
===================================================================
--- branches/7.1/lib/libxfont/src/fontfile/fontdir.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/fontfile/fontdir.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/fontfile/fontdir.c,v 1.6 2005/11/14 20:40:42 ajax Exp $ */
+/* $XdotOrg: xc/lib/font/fontfile/fontdir.c,v 1.4 2005/07/03 07:01:00 daniels Exp $ */
 /* $Xorg: fontdir.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */
 
 /*

Modified: branches/7.1/lib/libxfont/src/fontfile/fontfile.c
===================================================================
--- branches/7.1/lib/libxfont/src/fontfile/fontfile.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/fontfile/fontfile.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/Xfont/src/fontfile/fontfile.c,v 1.5 2005/07/09 06:36:13 keithp Exp $ */
+/* $XdotOrg: xc/lib/font/fontfile/fontfile.c,v 1.4 2005/07/03 07:01:00 daniels Exp $ */
 /* $Xorg: fontfile.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */
 
 /*
@@ -1010,7 +1010,10 @@
 			ret = (*scalable->renderer->GetInfoScalable)
 			    (fpe, *pFontInfo, entry, &tmpName, fileName, &vals);
 		    }
-		    if (ranges) xfree(ranges);
+		    if (ranges) {
+			xfree(ranges);
+			ranges = NULL;
+		    }
 		}
 	    }
 	    if (ret == Successful) return ret;

Modified: branches/7.1/lib/libxfont/src/stubs/cauthgen.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/cauthgen.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/cauthgen.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int
+weak int
 client_auth_generation(ClientPtr client)
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/csignal.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/csignal.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/csignal.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-Bool
+weak Bool
 ClientSignal(ClientPtr client)
 {
     return True;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/delfntcid.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/delfntcid.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/delfntcid.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,13 +1,9 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-void
+weak void
 DeleteFontClientID(Font id)
 {
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/errorf.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/errorf.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/errorf.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,13 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/errorf.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-void
+weak void
 ErrorF(const char *f, ...)
 {
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/fatalerror.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/fatalerror.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/fatalerror.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,13 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/fatalerror.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-void
+weak void
 FatalError(const char *f, ...)
 {
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/findoldfnt.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/findoldfnt.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/findoldfnt.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-FontPtr
+weak FontPtr
 find_old_font(FSID id)
 {
     return (FontPtr)NULL;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/getcres.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/getcres.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/getcres.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-FontResolutionPtr
+weak FontResolutionPtr
 GetClientResolutions(int *num)
 {
   return (FontResolutionPtr) 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/getdefptsize.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/getdefptsize.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/getdefptsize.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int
+weak int
 GetDefaultPointSize(void)
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/getnewfntcid.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/getnewfntcid.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/getnewfntcid.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-Font
+weak Font
 GetNewFontClientID(void)
 {
     return (Font)0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/gettime.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/gettime.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/gettime.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-unsigned long
+weak unsigned long
 GetTimeInMillis (void)
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/initfshdl.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/initfshdl.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/initfshdl.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,15 +1,11 @@
-/* $XFree86: xc/lib/font/stubs/initfshdl.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int
+weak int
 init_fs_handlers(FontPathElementPtr fpe,
                  BlockHandlerProcPtr block_handler)
 {
   return Successful;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/regfpefunc.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/regfpefunc.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/regfpefunc.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,11 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/regfpefunc.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int 
+weak int 
 RegisterFPEFunctions(NameCheckFunc name_func, 
 		     InitFpeFunc init_func, 
 		     FreeFpeFunc free_func, 
@@ -24,5 +22,3 @@
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/rmfshdl.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/rmfshdl.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/rmfshdl.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,15 +1,11 @@
-/* $XFree86: xc/lib/font/stubs/rmfshdl.c,v 1.1 1999/01/11 05:13:21 dawes Exp $ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-void 
+weak void 
 remove_fs_handlers(FontPathElementPtr fpe,
                    BlockHandlerProcPtr blockHandler,
                    Bool all)
 {
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/servclient.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/servclient.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/servclient.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,3 +1,6 @@
-/* $XFree86$ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "stubs.h"
 
-void *serverClient = 0;
+weak void *serverClient = 0;

Modified: branches/7.1/lib/libxfont/src/stubs/setfntauth.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/setfntauth.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/setfntauth.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int
+weak int
 set_font_authorizations(char **authorizations, int *authlen, ClientPtr client)
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/stfntcfnt.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/stfntcfnt.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/stfntcfnt.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-int
+weak int
 StoreFontClientFont(FontPtr pfont, Font id)
 {
     return 0;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/stubs/stubs.h
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/stubs.h	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/stubs.h	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,12 +1,9 @@
 /* $XFree86: xc/lib/font/stubs/stubs.h,v 1.3 1999/12/15 01:14:36 robin Exp $ */
 
-/* This directory includes dummy entry for bdftopcf and mkfontdir */
-
 #include <stdio.h>
 #include <X11/fonts/fntfilst.h>
 #include <X11/fonts/font.h>
 
-
 #ifndef True
 #define True (-1)
 #endif
@@ -14,6 +11,13 @@
 #define False (0)
 #endif
 
+/* this probably works for Mach-O too, but probably not for PE */
+#if defined(__ELF__) && defined(__GNUC__) && (__GNUC__ >= 3)
+#define weak __attribute__((weak))
+#else
+#define weak
+#endif
+
 extern FontPtr find_old_font ( FSID id );
 extern int set_font_authorizations ( char **authorizations, 
 				     int *authlen, 

Modified: branches/7.1/lib/libxfont/src/stubs/xpstubs.c
===================================================================
--- branches/7.1/lib/libxfont/src/stubs/xpstubs.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/stubs/xpstubs.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,24 +1,16 @@
-/* $XFree86$ */
-
-/*
-  stub for XpClient* functions.
-*/
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "stubs.h"
 
-Bool
+weak Bool
 XpClientIsBitmapClient(ClientPtr client)
 {
     return True;
 }
 
-Bool
+weak Bool
 XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe)
 {
     return False;
 }
-
-/* end of file */

Modified: branches/7.1/lib/libxfont/src/util/Makefile.am
===================================================================
--- branches/7.1/lib/libxfont/src/util/Makefile.am	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/util/Makefile.am	2006-07-27 03:20:04 UTC (rev 2571)
@@ -1,5 +1,6 @@
 INCLUDES =			\
-	-I${top_srcdir}/include
+	-I${top_srcdir}/include \
+	-I$(top_srcdir)/src/stubs
 
 noinst_LTLIBRARIES = libutil.la
 

Modified: branches/7.1/lib/libxfont/src/util/Makefile.in
===================================================================
--- branches/7.1/lib/libxfont/src/util/Makefile.in	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/util/Makefile.in	2006-07-27 03:20:04 UTC (rev 2571)
@@ -203,7 +203,8 @@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 INCLUDES = \
-	-I${top_srcdir}/include
+	-I${top_srcdir}/include \
+	-I$(top_srcdir)/src/stubs
 
 noinst_LTLIBRARIES = libutil.la
 libutil_la_SOURCES = \

Modified: branches/7.1/lib/libxfont/src/util/atom.c
===================================================================
--- branches/7.1/lib/libxfont/src/util/atom.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/util/atom.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -37,6 +37,7 @@
 #include <config.h>
 #endif
 #include <X11/fonts/fontmisc.h>
+#include "stubs.h"
 
 typedef struct _AtomList {
     char		*name;
@@ -145,7 +146,7 @@
     return TRUE;
 }
 
-Atom 
+weak Atom 
 MakeAtom(char *string, unsigned len, int makeit)
 {
     AtomListPtr	a;
@@ -218,13 +219,13 @@
     return a->atom;
 }
 
-int 
+weak int 
 ValidAtom(Atom atom)
 {
     return (atom != None) && (atom <= lastAtom);
 }
 
-char *
+weak char *
 NameForAtom(Atom atom)
 {
     if (atom != None && atom <= lastAtom)

Modified: branches/7.1/lib/libxfont/src/util/miscutil.c
===================================================================
--- branches/7.1/lib/libxfont/src/util/miscutil.c	2006-07-27 03:10:46 UTC (rev 2570)
+++ branches/7.1/lib/libxfont/src/util/miscutil.c	2006-07-27 03:20:04 UTC (rev 2571)
@@ -35,22 +35,22 @@
 #include <X11/Xosdefs.h>
 #include <stdlib.h>
 #include <X11/fonts/fontmisc.h>
+#include "stubs.h"
 
 #define XK_LATIN1
 #include    <X11/keysymdef.h>
-/* #include    <X11/Xmu/CharSet.h> */
 
 /* make sure everything initializes themselves at least once */
 
-long serverGeneration = 1;
+weak long serverGeneration = 1;
 
-void *
+weak void *
 Xalloc (unsigned long m)
 {
     return malloc (m);
 }
 
-void *
+weak void *
 Xrealloc (void *n, unsigned long m)
 {
     if (!n)
@@ -59,20 +59,20 @@
 	return realloc (n, m);
 }
 
-void
+weak void
 Xfree (void *n)
 {
     if (n)
 	free (n);
 }
 
-void *
+weak void *
 Xcalloc (unsigned long n)
 {
     return calloc (n, 1);
 }
 
-void
+weak void
 CopyISOLatin1Lowered (char *dst, char *src, int len)
 {
     register unsigned char *dest, *source;
@@ -93,7 +93,7 @@
     *dest = '\0';
 }
 
-void
+weak void
 register_fpe_functions ()
 {
 }



Reply to: