[xorg-commit-diffs] xc/extras/freetype2/src/pfr Jamfile, 1.1.4.1, 1.1.4.2 pfrdrivr.c, 1.1.4.1, 1.1.4.2 pfrload.c, 1.1.4.1, 1.1.4.2 pfrobjs.c, 1.1.4.2, 1.1.4.3 pfrobjs.h, 1.1.4.1, 1.1.4.2 pfrsbit.c, 1.1, 1.1.4.1 pfrtypes.h, 1.1.4.1, 1.1.4.2 rules.mk, 1.1, 1.1.4.1

Egbert Eich xorg-commit at pdx.freedesktop.org
Thu Apr 15 03:14:42 PDT 2004


Committed by: eich

Update of /cvs/xorg/xc/extras/freetype2/src/pfr
In directory pdx:/home/eich/tstbuild/xc/extras/freetype2/src/pfr

Modified Files:
      Tag: XORG-CURRENT
	Jamfile pfrdrivr.c pfrload.c pfrobjs.c pfrobjs.h pfrsbit.c 
	pfrtypes.h rules.mk 
Log Message:
2004-04-15  Egbert Eich  <eich at freedesktop.org>
        Merged changes from RELEASE-1 branch
	


Index: Jamfile
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/Jamfile,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/Jamfile	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/Jamfile	15 Apr 2004 10:14:38 -0000	1.1.4.2
@@ -8,7 +8,7 @@
 
   if $(FT2_MULTI)
   {
-    _sources = pfrdrivr  pfrgload  pfrload  pfrobjs pfrcmap pfrsbit ;
+    _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ;
   }
   else
   {

Index: pfrdrivr.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrdrivr.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/pfrdrivr.c	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pfrdrivr.c	15 Apr 2004 10:14:38 -0000	1.1.4.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -19,10 +19,12 @@
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_PFR_H
+#include FT_SERVICE_PFR_H
+#include FT_SERVICE_XFREE86_NAME_H
 #include "pfrdrivr.h"
 #include "pfrobjs.h"
 
+#include "pfrerror.h"
 
   static FT_Error
   pfr_get_kerning( PFR_Face    face,
@@ -30,41 +32,45 @@
                    FT_UInt     right,
                    FT_Vector  *avector )
   {
-    FT_Error  error;
+    PFR_PhyFont  phys = &face->phy_font;
 
-    error = pfr_face_get_kerning( face, left, right, avector );
-    if ( !error )
-    {
-      PFR_PhyFont  phys = &face->phy_font;
 
-      /* convert from metrics to outline units when necessary */
-      if ( phys->outline_resolution != phys->metrics_resolution )
-      {
-        if ( avector->x != 0 )
-          avector->x = FT_MulDiv( avector->x, phys->outline_resolution,
-                                              phys->metrics_resolution );
+    pfr_face_get_kerning( face, left, right, avector );
 
-        if ( avector->y != 0 )
-          avector->y = FT_MulDiv( avector->x, phys->outline_resolution,
-                                              phys->metrics_resolution );
-      }
+    /* convert from metrics to outline units when necessary */
+    if ( phys->outline_resolution != phys->metrics_resolution )
+    {
+      if ( avector->x != 0 )
+        avector->x = FT_MulDiv( avector->x, phys->outline_resolution,
+                                            phys->metrics_resolution );
+
+      if ( avector->y != 0 )
+        avector->y = FT_MulDiv( avector->x, phys->outline_resolution,
+                                            phys->metrics_resolution );
     }
-    return error;
+
+    return PFR_Err_Ok;
   }
 
+ /*
+  *  PFR METRICS SERVICE
+  *
+  */
 
   static FT_Error
   pfr_get_advance( PFR_Face   face,
                    FT_UInt    gindex,
                    FT_Pos    *aadvance )
   {
-    FT_Error     error = FT_Err_Bad_Argument;
+    FT_Error  error = PFR_Err_Bad_Argument;
+
 
     *aadvance = 0;
     if ( face )
     {
       PFR_PhyFont  phys  = &face->phy_font;
 
+
       if ( gindex < phys->num_chars )
       {
         *aadvance = phys->chars[ gindex ].advance;
@@ -87,6 +93,7 @@
     FT_Fixed     x_scale, y_scale;
     FT_Size      size = face->root.size;
 
+
     if ( aoutline_resolution )
       *aoutline_resolution = phys->outline_resolution;
 
@@ -116,20 +123,42 @@
 
 
   FT_CALLBACK_TABLE_DEF
-  const FT_PFR_ServiceRec  pfr_service_rec =
+  const FT_Service_PfrMetricsRec  pfr_metrics_service_rec =
   {
-    (FT_PFR_GetMetricsFunc)  pfr_get_metrics,
-    (FT_PFR_GetKerningFunc)  pfr_get_kerning,
-    (FT_PFR_GetAdvanceFunc)  pfr_get_advance
+    (FT_PFR_GetMetricsFunc)pfr_get_metrics,
+    (FT_PFR_GetKerningFunc)pfr_face_get_kerning,
+    (FT_PFR_GetAdvanceFunc)pfr_get_advance
   };
 
+ /*
+  *  SERVICE LIST
+  *
+  */
+
+  static const FT_ServiceDescRec  pfr_services[] =
+  {
+    { FT_SERVICE_ID_PFR_METRICS, & pfr_metrics_service_rec },
+    { FT_SERVICE_ID_XF86_NAME,   FT_XF86_FORMAT_PFR },
+    { NULL, NULL }
+  };
+
+
+  static FT_Module_Interface
+  pfr_get_service( FT_Driver         driver,
+                   const FT_String*  service_id )
+  {
+    FT_UNUSED( driver );
+
+    return ft_service_list_lookup( pfr_services, service_id );
+  }
+
 
   FT_CALLBACK_TABLE_DEF
   const FT_Driver_ClassRec  pfr_driver_class =
   {
     {
-      ft_module_font_driver      |
-      ft_module_driver_scalable,
+      FT_MODULE_FONT_DRIVER     |
+      FT_MODULE_DRIVER_SCALABLE,
 
       sizeof( FT_DriverRec ),
 
@@ -137,11 +166,11 @@
       0x10000L,
       0x20000L,
 
-      (FT_PFR_Service)  &pfr_service_rec,   /* format interface */
+      NULL,
 
       (FT_Module_Constructor)NULL,
       (FT_Module_Destructor) NULL,
-      (FT_Module_Requester)  NULL
+      (FT_Module_Requester)  pfr_get_service
     },
 
     sizeof( PFR_FaceRec ),

Index: pfrload.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrload.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/pfrload.c	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pfrload.c	15 Apr 2004 10:14:38 -0000	1.1.4.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR loader (body).                                          */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -153,7 +153,7 @@
   pfr_header_load( PFR_Header  header,
                    FT_Stream   stream )
   {
-    FT_Error   error;
+    FT_Error  error;
 
 
     /* read header directly */
@@ -201,9 +201,9 @@
                       FT_UInt32  section_offset,
                       FT_UInt   *acount )
   {
-    FT_Error   error;
-    FT_UInt    count;
-    FT_UInt    result = 0;
+    FT_Error  error;
+    FT_UInt   count;
+    FT_UInt   result = 0;
 
 
     if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) )
@@ -239,8 +239,8 @@
       return PFR_Err_Invalid_Argument;
 
     if ( FT_STREAM_SKIP( idx * 5 ) ||
-         FT_READ_USHORT( size )      ||
-         FT_READ_UOFF3 ( offset )    )
+         FT_READ_USHORT( size )    ||
+         FT_READ_UOFF3 ( offset )  )
       goto Exit;
 
     /* save logical font size and offset */
@@ -365,7 +365,8 @@
     /* re-allocate when needed */
     if ( phy_font->num_strikes + count > phy_font->max_strikes )
     {
-      FT_UInt  new_max = (phy_font->num_strikes + count + 3) & -4;
+      FT_UInt  new_max = ( phy_font->num_strikes + count + 3 ) & -4;
+
 
       if ( FT_RENEW_ARRAY( phy_font->strikes,
                            phy_font->num_strikes,
@@ -432,30 +433,30 @@
   }
 
 
- /* load font ID, this is a so-called "unique" name that is rather
-  * long and descriptive (like "Tiresias ScreenFont v7.51").
-  *
-  * note that a PFR font's family name is contained in an *undocumented*
-  * string of the "auxiliary data" portion of a physical font record. this
-  * may also contain the "real" style name !
-  *
-  * if no family name is present, the font id is used instead for the
-  * family
-  */
+  /* Load font ID.  This is a so-called "unique" name that is rather
+   * long and descriptive (like "Tiresias ScreenFont v7.51").
+   *
+   * Note that a PFR font's family name is contained in an *undocumented*
+   * string of the "auxiliary data" portion of a physical font record.  This
+   * may also contain the "real" style name!
+   *
+   * If no family name is present, the font ID is used instead for the
+   * family.
+   */
   FT_CALLBACK_DEF( FT_Error )
   pfr_extra_item_load_font_id( FT_Byte*     p,
                                FT_Byte*     limit,
                                PFR_PhyFont  phy_font )
   {
-    FT_Error   error  = 0;
-    FT_Memory  memory = phy_font->memory;
-    FT_UInt    len    = (FT_UInt)( limit - p );
+    FT_Error    error  = 0;
+    FT_Memory   memory = phy_font->memory;
+    FT_PtrDist  len    = limit - p;
 
 
     if ( phy_font->font_id != NULL )
       goto Exit;
 
-    if ( FT_ALLOC( phy_font->font_id, len+1 ) )
+    if ( FT_ALLOC( phy_font->font_id, len + 1 ) )
       goto Exit;
 
     /* copy font ID name, and terminate it for safety */
@@ -510,89 +511,6 @@
   }
 
 
-#if 0
-
-  /* load kerning pair data */
-  FT_CALLBACK_DEF( FT_Error )
-  pfr_extra_item_load_kerning_pairs( FT_Byte*     p,
-                                     FT_Byte*     limit,
-                                     PFR_PhyFont  phy_font )
-  {
-    FT_Int        count;
-    FT_UShort     base_adj;
-    FT_UInt       flags;
-    FT_UInt       num_pairs;
-    PFR_KernPair  pairs;
-    FT_Error      error  = 0;
-    FT_Memory     memory = phy_font->memory;
-
-
-    /* allocate a new kerning item */
-    /* XXX: there may be multiple extra items for kerning */
-    if ( phy_font->kern_pairs != NULL )
-      goto Exit;
-
-    FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" ));
-
-    PFR_CHECK( 4 );
-
-    num_pairs = PFR_NEXT_BYTE( p );
-    base_adj  = PFR_NEXT_SHORT( p );
-    flags     = PFR_NEXT_BYTE( p );
-
-#ifndef PFR_CONFIG_NO_CHECKS
-    count = 3;
-
-    if ( flags & PFR_KERN_2BYTE_CHAR )
-      count += 2;
-
-    if ( flags & PFR_KERN_2BYTE_ADJ )
-      count += 1;
-
-    PFR_CHECK( num_pairs * count );
-#endif
-
-    if ( FT_NEW_ARRAY( pairs, num_pairs ) )
-      goto Exit;
-
-    phy_font->num_kern_pairs = num_pairs;
-    phy_font->kern_pairs     = pairs;
-
-    for (count = num_pairs ; count > 0; count--, pairs++ )
-    {
-      if ( flags & PFR_KERN_2BYTE_CHAR )
-      {
-        pairs->glyph1 = PFR_NEXT_USHORT( p );
-        pairs->glyph2 = PFR_NEXT_USHORT( p );
-      }
-      else
-      {
-        pairs->glyph1 = PFR_NEXT_BYTE( p );
-        pairs->glyph2 = PFR_NEXT_BYTE( p );
-      }
-
-      if ( flags & PFR_KERN_2BYTE_ADJ )
-        pairs->kerning.x = base_adj + PFR_NEXT_SHORT( p );
-      else
-        pairs->kerning.x = base_adj + PFR_NEXT_INT8( p );
-
-      pairs->kerning.y = 0;
-
-      FT_TRACE2(( "kerning %d <-> %d : %ld\n",
-                   pairs->glyph1, pairs->glyph2, pairs->kerning.x ));
-    }
-
-  Exit:
-    return error;
-
-  Too_Short:
-    error = PFR_Err_Invalid_Table;
-    FT_ERROR(( "pfr_extra_item_load_kerning_pairs: "
-               "invalid kerning pairs table\n" ));
-    goto Exit;
-  }
-
-#else /* 0 */
 
   /* load kerning pair data */
   FT_CALLBACK_DEF( FT_Error )
@@ -689,22 +607,161 @@
                "invalid kerning pairs table\n" ));
     goto Exit;
   }
-#endif /* 0 */
+
+
+ /*
+  *  The kerning data embedded in a PFR font are (charcode,charcode)
+  *  pairs; we need to translate them to (gindex,gindex) and sort
+  *  the resulting array.
+  */
+  static FT_UInt
+  pfr_get_gindex( PFR_Char  chars,
+                  FT_UInt   count,
+                  FT_UInt   charcode )
+  {
+    FT_UInt  min = 0;
+    FT_UInt  max = count;
+
+
+    while ( min < max )
+    {
+      FT_UInt   mid = ( min + max ) >> 1;
+      PFR_Char  c   = chars + mid;
+
+
+      if ( c->char_code == charcode )
+        return mid + 1;
+
+      if ( c->char_code < charcode )
+        min = mid + 1;
+      else
+        max = mid;
+    }
+    return 0;
+  }
+
+
+  FT_CALLBACK_DEF( int )
+  pfr_compare_kern_pairs( const void*  pair1,
+                          const void*  pair2 )
+  {
+    FT_UInt32  p1 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair1 );
+    FT_UInt32  p2 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair2 );
+
+
+    if ( p1 < p2 )
+      return -1;
+    if ( p1 > p2 )
+      return 1;
+    return 0;
+  }
+
+
+  static FT_Error
+  pfr_sort_kerning_pairs( FT_Stream    stream,
+                          PFR_PhyFont  phy_font )
+  {
+    FT_Error      error;
+    FT_Memory     memory = stream->memory;
+    PFR_KernPair  pairs;
+    PFR_KernItem  item;
+    PFR_Char      chars     = phy_font->chars;
+    FT_UInt       num_chars = phy_font->num_chars;
+    FT_UInt       count;
+
+
+   /* create kerning pairs array
+    */
+    if ( FT_NEW_ARRAY( phy_font->kern_pairs, phy_font->num_kern_pairs ) )
+      goto Exit;
+
+   /* load all kerning items into the array,
+    * converting character codes into glyph indices
+    */
+    pairs = phy_font->kern_pairs;
+    item  = phy_font->kern_items;
+    count = 0;
+
+    for ( ; item; item = item->next )
+    {
+      FT_UInt   limit = count + item->pair_count;
+      FT_Byte*  p;
+
+
+      if ( limit > phy_font->num_kern_pairs )
+      {
+        error = PFR_Err_Invalid_Table;
+        goto Exit;
+      }
+
+      if ( FT_STREAM_SEEK( item->offset )                       ||
+           FT_FRAME_ENTER( item->pair_count * item->pair_size ) )
+        goto Exit;
+
+      p = stream->cursor;
+
+      for ( ; count < limit; count++ )
+      {
+        PFR_KernPair  pair = pairs + count;
+        FT_UInt       char1, char2;
+        FT_Int        kerning;
+
+
+        if ( item->flags & PFR_KERN_2BYTE_CHAR )
+        {
+          char1 = FT_NEXT_USHORT( p );
+          char2 = FT_NEXT_USHORT( p );
+        }
+        else
+        {
+          char1 = FT_NEXT_BYTE( p );
+          char2 = FT_NEXT_BYTE( p );
+        }
+
+        if ( item->flags & PFR_KERN_2BYTE_ADJ )
+          kerning = item->base_adj + FT_NEXT_SHORT( p );
+        else
+          kerning = item->base_adj + FT_NEXT_CHAR( p );
+
+        pair->glyph1  = pfr_get_gindex( chars, num_chars, char1 );
+        pair->glyph2  = pfr_get_gindex( chars, num_chars, char2 );
+        pair->kerning = kerning;
+      }
+
+      FT_FRAME_EXIT();
+    }
+
+   /* sort the resulting array
+    */
+    ft_qsort( pairs, count,
+              sizeof ( PFR_KernPairRec ),
+              pfr_compare_kern_pairs );
+
+  Exit:
+    if ( error )
+    {
+     /* disable kerning data in case of error
+      */
+      phy_font->num_kern_pairs = 0;
+    }
+
+    return error;
+  }
 
 
   static const PFR_ExtraItemRec  pfr_phy_font_extra_items[] =
   {
-    { 1, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_bitmap_info },
-    { 2, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_font_id },
-    { 3, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_stem_snaps },
-    { 4, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_kerning_pairs },
+    { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info },
+    { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id },
+    { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps },
+    { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs },
     { 0, NULL }
   };
 
 
- /* loads a name from the auxiliary data. Since this extracts undocumented
-  * strings from the font file, we need to be careful here
-  */
+  /* Loads a name from the auxiliary data.  Since this extracts undocumented
+   * strings from the font file, we need to be careful here.
+   */
   static FT_Error
   pfr_aux_name_load( FT_Byte*     p,
                      FT_UInt      len,
@@ -715,13 +772,14 @@
     FT_String*  result = NULL;
     FT_UInt     n, ok;
 
-    if ( len > 0 && p[len-1] == 0 )
+
+    if ( len > 0 && p[len - 1] == 0 )
       len--;
 
-   /* check that each character is ASCII, that's to be sure
-    * to not load garbage..
-    */
-    ok = (len > 0);
+    /* check that each character is ASCII for making sure not to
+       load garbage
+     */
+    ok = ( len > 0 );
     for ( n = 0; n < len; n++ )
       if ( p[n] < 32 || p[n] > 127 )
       {
@@ -731,7 +789,7 @@
 
     if ( ok )
     {
-      if ( FT_ALLOC( result, len+1 ) )
+      if ( FT_ALLOC( result, len + 1 ) )
         goto Exit;
 
       FT_MEM_COPY( result, p, len );
@@ -768,6 +826,7 @@
     FT_FREE( phy_font->blue_values );
     phy_font->num_blue_values = 0;
 
+    FT_FREE( phy_font->kern_pairs );
     {
       PFR_KernItem  item, next;
 
@@ -787,7 +846,6 @@
   }
 
 
-
   FT_LOCAL_DEF( FT_Error )
   pfr_phy_font_load( PFR_PhyFont  phy_font,
                      FT_Stream    stream,
@@ -842,9 +900,9 @@
         goto Fail;
     }
 
-    /* in certain fonts, the auxiliary bytes contain interesting  */
+    /* In certain fonts, the auxiliary bytes contain interesting  */
     /* information. These are not in the specification but can be */
-    /* guessed by looking at the content of a few PFR0 fonts      */
+    /* guessed by looking at the content of a few PFR0 fonts.     */
     PFR_CHECK( 3 );
     num_aux = PFR_NEXT_ULONG( p );
 
@@ -853,6 +911,7 @@
       FT_Byte*  q = p;
       FT_Byte*  q2;
 
+
       PFR_CHECK( num_aux );
       p += num_aux;
 
@@ -860,58 +919,54 @@
       {
         FT_UInt  length, type;
 
+
         if ( q + 4 > p )
           break;
 
-        length = PFR_NEXT_USHORT(q);
+        length = PFR_NEXT_USHORT( q );
         if ( length < 4 || length > num_aux )
           break;
 
         q2   = q + length - 2;
-        type = PFR_NEXT_USHORT(q);
+        type = PFR_NEXT_USHORT( q );
 
         switch ( type )
         {
-          case 1:
-            {
-             /* this seems to correspond to the font's family name,
-              * padded to 16-bits with one zero when necessary
-              */
-              error = pfr_aux_name_load( q, length-4U, memory,
-                                         &phy_font->family_name );
-              if ( error )
-                goto Exit;
-            }
-            break;
-
-          case 2:
-            {
-              if ( q + 32 > q2 )
-                break;
+        case 1:
+          /* this seems to correspond to the font's family name,
+           * padded to 16-bits with one zero when necessary
+           */
+          error = pfr_aux_name_load( q, length - 4U, memory,
+                                     &phy_font->family_name );
+          if ( error )
+            goto Exit;
+          break;
 
-              q += 10;
-              phy_font->ascent  = PFR_NEXT_SHORT(q);
-              phy_font->descent = PFR_NEXT_SHORT(q);
-              phy_font->leading = PFR_NEXT_SHORT(q);
-              q += 16;
-            }
+        case 2:
+          if ( q + 32 > q2 )
             break;
 
-          case 3:
-            {
-             /* this seems to correspond to the font's style name,
-              * padded to 16-bits with one zero when necessary
-              */
-              error = pfr_aux_name_load( q, length-4U, memory,
-                                         &phy_font->style_name );
-              if ( error )
-                goto Exit;
-            }
-            break;
+          q += 10;
+          phy_font->ascent  = PFR_NEXT_SHORT( q );
+          phy_font->descent = PFR_NEXT_SHORT( q );
+          phy_font->leading = PFR_NEXT_SHORT( q );
+          q += 16;
+          break;
 
-          default:
-            ;
+        case 3:
+          /* this seems to correspond to the font's style name,
+           * padded to 16-bits with one zero when necessary
+           */
+          error = pfr_aux_name_load( q, length - 4U, memory,
+                                     &phy_font->style_name );
+          if ( error )
+            goto Exit;
+          break;
+
+        default:
+          ;
         }
+
         q        = q2;
         num_aux -= length;
       }
@@ -921,6 +976,7 @@
     {
       FT_UInt  n, count;
 
+
       PFR_CHECK( 1 );
       phy_font->num_blue_values = count = PFR_NEXT_BYTE( p );
 
@@ -1000,7 +1056,8 @@
       }
     }
 
-    /* that's it !! */
+    /* that's it! */
+
   Fail:
     FT_FRAME_EXIT();
 
@@ -1008,6 +1065,9 @@
     phy_font->bct_offset = FT_STREAM_POS();
     phy_font->cursor     = NULL;
 
+    /* now sort kerning pairs */
+    error = pfr_sort_kerning_pairs( stream, phy_font );
+
   Exit:
     return error;
 

Index: pfrobjs.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrobjs.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/pfrobjs.c	5 Mar 2004 13:38:43 -0000	1.1.4.2
+++ b/pfrobjs.c	15 Apr 2004 10:14:38 -0000	1.1.4.3
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -14,7 +14,6 @@
 /*  understand and accept it fully.                                        */
 /*                                                                         */
 /***************************************************************************/
-/* $XFree86$ */
 
 #include "pfrobjs.h"
 #include "pfrload.h"
@@ -41,12 +40,13 @@
   FT_LOCAL_DEF( void )
   pfr_face_done( PFR_Face  face )
   {
-    FT_Memory   memory = face->root.driver->root.memory;
+    FT_Memory  memory = face->root.driver->root.memory;
+
 
     /* we don't want dangling pointers */
     face->root.family_name = NULL;
     face->root.style_name  = NULL;
-
+    
     /* finalize the physical font record */
     pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );
 
@@ -113,127 +113,127 @@
       goto Exit;
 
     /* now load the physical font descriptor */
-     error = pfr_phy_font_load( &face->phy_font, stream,
-                                 face->log_font.phys_offset,
-                                 face->log_font.phys_size );
-     if ( error )
-       goto Exit;
+    error = pfr_phy_font_load( &face->phy_font, stream,
+                               face->log_font.phys_offset,
+                               face->log_font.phys_size );
+    if ( error )
+      goto Exit;
 
-     /* now, set-up all root face fields */
-     {
-       FT_Face      root     = FT_FACE( face );
-       PFR_PhyFont  phy_font = &face->phy_font;
+    /* now, set-up all root face fields */
+    {
+      FT_Face      root     = FT_FACE( face );
+      PFR_PhyFont  phy_font = &face->phy_font;
 
 
-       root->face_index = face_index;
-       root->num_glyphs = phy_font->num_chars;
-       root->face_flags = FT_FACE_FLAG_SCALABLE;
+      root->face_index = face_index;
+      root->num_glyphs = phy_font->num_chars;
+      root->face_flags = FT_FACE_FLAG_SCALABLE;
 
-       if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
-         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
+      if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
+        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
-       if ( phy_font->flags & PFR_PHY_VERTICAL )
-         root->face_flags |= FT_FACE_FLAG_VERTICAL;
-       else
-         root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
+      if ( phy_font->flags & PFR_PHY_VERTICAL )
+        root->face_flags |= FT_FACE_FLAG_VERTICAL;
+      else
+        root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
-       if ( phy_font->num_strikes > 0 )
-         root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
+      if ( phy_font->num_strikes > 0 )
+        root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
 
-       if ( phy_font->num_kern_pairs > 0 )
-         root->face_flags |= FT_FACE_FLAG_KERNING;
+      if ( phy_font->num_kern_pairs > 0 )
+        root->face_flags |= FT_FACE_FLAG_KERNING;
 
-      /* if no family name was found in the "undocumented" auxiliary
-       * data, use the font ID instead. This sucks but is better than
-       * nothing
+      /* If no family name was found in the "undocumented" auxiliary
+       * data, use the font ID instead.  This sucks but is better than
+       * nothing.
        */
-       root->family_name = phy_font->family_name;
-       if ( root->family_name == NULL )
-         root->family_name = phy_font->font_id;
+      root->family_name = phy_font->family_name;
+      if ( root->family_name == NULL )
+        root->family_name = phy_font->font_id;
 
       /* note that the style name can be NULL in certain PFR fonts,
        * probably meaning "Regular"
        */
-       root->style_name  = phy_font->style_name;
-
-       root->num_fixed_sizes = 0;
-       root->available_sizes = 0;
-
-       root->bbox         = phy_font->bbox;
-       root->units_per_EM = (FT_UShort)phy_font->outline_resolution;
-       root->ascender     = (FT_Short) phy_font->bbox.yMax;
-       root->descender    = (FT_Short) phy_font->bbox.yMin;
-       root->height       = (FT_Short)
-                              ( ( ( root->ascender - root->descender ) * 12 )
-                                / 10 );
+      root->style_name = phy_font->style_name;
 
-       if ( phy_font->num_strikes > 0 )
-       {
-         FT_UInt          n, count = phy_font->num_strikes;
-         FT_Bitmap_Size*  size;
-         PFR_Strike       strike;
-         FT_Memory        memory = root->stream->memory;
+      root->num_fixed_sizes = 0;
+      root->available_sizes = 0;
 
-         if ( FT_NEW_ARRAY( root->available_sizes, count ) )
-           goto Exit;
+      root->bbox         = phy_font->bbox;
+      root->units_per_EM = (FT_UShort)phy_font->outline_resolution;
+      root->ascender     = (FT_Short) phy_font->bbox.yMax;
+      root->descender    = (FT_Short) phy_font->bbox.yMin;
+      root->height       = (FT_Short)(
+        ( ( root->ascender - root->descender ) * 12 ) / 10 );
 
-         size   = root->available_sizes;
-         strike = phy_font->strikes;
-         for ( n = 0; n < count; n++, size++, strike++ )
-         {
-           size->height = (FT_UShort) strike->y_ppm;
-           size->width  = (FT_UShort) strike->x_ppm;
-         }
-         root->num_fixed_sizes = count;
-       }
+      if ( phy_font->num_strikes > 0 )
+      {
+        FT_UInt          n, count = phy_font->num_strikes;
+        FT_Bitmap_Size*  size;
+        PFR_Strike       strike;
+        FT_Memory        memory = root->stream->memory;
+         
+         
+        if ( FT_NEW_ARRAY( root->available_sizes, count ) )
+          goto Exit;
+         
+        size   = root->available_sizes;
+        strike = phy_font->strikes;
+        for ( n = 0; n < count; n++, size++, strike++ )
+        {
+          size->height = (FT_UShort)strike->y_ppm;
+          size->width  = (FT_UShort)strike->x_ppm;
+        }
+        root->num_fixed_sizes = count;
+      }
 
-       /* now compute maximum advance width */
-       if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
-         root->max_advance_width = (FT_Short)phy_font->standard_advance;
-       else
-       {
-         FT_Int    max = 0;
-         FT_UInt   count = phy_font->num_chars;
-         PFR_Char  gchar = phy_font->chars;
+      /* now compute maximum advance width */
+      if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
+        root->max_advance_width = (FT_Short)phy_font->standard_advance;
+      else
+      {
+        FT_Int    max = 0;
+        FT_UInt   count = phy_font->num_chars;
+        PFR_Char  gchar = phy_font->chars;
 
 
-         for ( ; count > 0; count--, gchar++ )
-         {
-           if ( max < gchar->advance )
-             max = gchar->advance;
-         }
+        for ( ; count > 0; count--, gchar++ )
+        {
+          if ( max < gchar->advance )
+            max = gchar->advance;
+        }
 
-         root->max_advance_width = (FT_Short)max;
-       }
+        root->max_advance_width = (FT_Short)max;
+      }
 
-       root->max_advance_height = root->height;
+      root->max_advance_height = root->height;
 
-       root->underline_position  = (FT_Short)( - root->units_per_EM / 10 );
-       root->underline_thickness = (FT_Short)(   root->units_per_EM / 30 );
+      root->underline_position  = (FT_Short)( - root->units_per_EM / 10 );
+      root->underline_thickness = (FT_Short)(   root->units_per_EM / 30 );
 
-       /* create charmap */
-       {
-         FT_CharMapRec  charmap;
+      /* create charmap */
+      {
+        FT_CharMapRec  charmap;
 
 
-         charmap.face        = root;
-         charmap.platform_id = 3;
-         charmap.encoding_id = 1;
-         charmap.encoding    = FT_ENCODING_UNICODE;
+        charmap.face        = root;
+        charmap.platform_id = 3;
+        charmap.encoding_id = 1;
+        charmap.encoding    = FT_ENCODING_UNICODE;
 
-         FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
+        FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
 
 #if 0
-         /* Select default charmap */
-         if (root->num_charmaps)
-           root->charmap = root->charmaps[0];
+        /* Select default charmap */
+        if (root->num_charmaps)
+          root->charmap = root->charmaps[0];
 #endif
-       }
+      }
 
-       /* check whether we've loaded any kerning pairs */
-       if ( phy_font->num_kern_pairs )
-         root->face_flags |= FT_FACE_FLAG_KERNING;
-     }
+      /* check whether we've loaded any kerning pairs */
+      if ( phy_font->num_kern_pairs )
+        root->face_flags |= FT_FACE_FLAG_KERNING;
+    }
 
   Exit:
     return error;
@@ -278,7 +278,8 @@
     FT_Outline*  outline = &slot->root.outline;
     FT_ULong     gps_offset;
 
-    if (gindex > 0)
+
+    if ( gindex > 0 )
       gindex--;
 
     /* check that the glyph index is correct */
@@ -294,7 +295,7 @@
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
     {
-      error = FT_Err_Invalid_Argument;
+      error = PFR_Err_Invalid_Argument;
       goto Exit;
     }
 
@@ -351,6 +352,21 @@
       metrics->vertBearingX = 0;
       metrics->vertBearingY = 0;
 
+      /* Apply the font matrix, if any.                 */
+      /* TODO: Test existing fonts with unusual matrix  */
+      /* whether we have to adjust Units per EM.        */
+      {
+        FT_Matrix font_matrix;
+
+
+        font_matrix.xx = face->log_font.matrix[0] << 8;
+        font_matrix.yx = face->log_font.matrix[1] << 8;
+        font_matrix.xy = face->log_font.matrix[2] << 8;
+        font_matrix.yy = face->log_font.matrix[3] << 8;
+
+        FT_Outline_Transform( outline, &font_matrix );
+      }
+
       /* scale when needed */
       if ( scaling )
       {
@@ -394,87 +410,46 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   pfr_face_get_kerning( PFR_Face    face,
                         FT_UInt     glyph1,
                         FT_UInt     glyph2,
                         FT_Vector*  kerning )
   {
-    FT_Error      error    = 0;
+    FT_Error      error    = PFR_Err_Ok;
     PFR_PhyFont   phy_font = &face->phy_font;
-    PFR_KernItem  item     = phy_font->kern_items;
+    PFR_KernPair  pairs    = phy_font->kern_pairs;
     FT_UInt32     idx      = PFR_KERN_INDEX( glyph1, glyph2 );
+    FT_UInt       min, max;
+
+    FT_UNUSED( error ); /* just needed as syntactical sugar */
 
 
     kerning->x = 0;
     kerning->y = 0;
 
-    /* find the kerning item containing our pair */
-    while ( item )
-    {
-      if ( item->pair1 <= idx && idx <= item->pair2 )
-        goto Found_Item;
-
-      item = item->next;
-    }
-
-    /* not found */
-    goto Exit;
-
-  Found_Item:
+    min = 0;
+    max = phy_font->num_kern_pairs;
+    
+    while ( min < max )
     {
-      /* perform simply binary search within the item */
-      FT_UInt    min, mid, max;
-      FT_Stream  stream = face->root.stream;
-      FT_Byte*   p;
-
-
-      if ( FT_STREAM_SEEK( item->offset )                       ||
-           FT_FRAME_ENTER( item->pair_count * item->pair_size ) )
-        goto Exit;
+      FT_UInt       mid  = ( min + max ) >> 1;
+      PFR_KernPair  pair = pairs + mid;
+      FT_UInt32     pidx = PFR_KERN_PAIR_INDEX( pair );
+      
 
-      min = 0;
-      max = item->pair_count;
-      while ( min < max )
+      if ( pidx == idx )
       {
-        FT_UInt  char1, char2, charcode;
-
-
-        mid = ( min + max ) >> 1;
-        p   = stream->cursor + mid*item->pair_size;
-
-        if ( item->flags & PFR_KERN_2BYTE_CHAR )
-        {
-          char1 = FT_NEXT_USHORT( p );
-          char2 = FT_NEXT_USHORT( p );
-        }
-        else
-        {
-          char1 = FT_NEXT_USHORT( p );
-          char2 = FT_NEXT_USHORT( p );
-        }
-        charcode = PFR_KERN_INDEX( char1, char2 );
-
-        if ( idx == charcode )
-        {
-          if ( item->flags & PFR_KERN_2BYTE_ADJ )
-            kerning->x = item->base_adj + FT_NEXT_SHORT( p );
-          else
-            kerning->x = item->base_adj + FT_NEXT_CHAR( p );
-
-          break;
-        }
-        if ( idx > charcode )
-          min = mid + 1;
-        else
-          max = mid;
+        kerning->x = pair->kerning;
+        break;
       }
-
-      FT_FRAME_EXIT();
+      
+      if ( pidx < idx )
+        min = mid + 1;
+      else
+        max = mid;
     }
-
-  Exit:
-    return error;
   }
 
+
 /* END */

Index: pfrobjs.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrobjs.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/pfrobjs.h	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pfrobjs.h	15 Apr 2004 10:14:38 -0000	1.1.4.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (specification).                         */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -67,11 +67,11 @@
   pfr_face_done( PFR_Face  face );
 
 
-  FT_LOCAL( FT_Error )
-  pfr_face_get_kerning( PFR_Face   face,
-                        FT_UInt    glyph1,
-                        FT_UInt    glyph2,
-                        FT_Vector* kerning );
+  FT_LOCAL( void )
+  pfr_face_get_kerning( PFR_Face    face,
+                        FT_UInt     glyph1,
+                        FT_UInt     glyph2,
+                        FT_Vector*  kerning );
 
 
   FT_LOCAL( FT_Error )

Index: pfrsbit.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrsbit.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pfrsbit.c	25 Nov 2003 19:27:22 -0000	1.1
+++ b/pfrsbit.c	15 Apr 2004 10:14:38 -0000	1.1.4.1
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR bitmap loader (body).                                   */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,7 +49,7 @@
   static void
   pfr_bitwriter_init( PFR_BitWriter  writer,
                       FT_Bitmap*     target,
-                      FT_UInt        decreasing )
+                      FT_Bool        decreasing )
   {
     writer->line   = target->buffer;
     writer->pitch  = target->pitch;
@@ -115,7 +115,7 @@
     }
 
     if ( mask != 0x80 )
-      cur[0] = (FT_Byte) c;
+      cur[0] = (FT_Byte)c;
   }
 
 
@@ -185,7 +185,7 @@
       }
       else if ( mask == 0 )
       {
-        cur[0] = (FT_Byte) c;
+        cur[0] = (FT_Byte)c;
         mask   = 0x80;
         c      = 0;
         cur ++;
@@ -249,7 +249,7 @@
       }
       else if ( mask == 0 )
       {
-        cur[0] = (FT_Byte) c;
+        cur[0] = (FT_Byte)c;
         c      = 0;
         mask   = 0x80;
         cur ++;
@@ -274,8 +274,8 @@
   static void
   pfr_lookup_bitmap_data( FT_Byte*   base,
                           FT_Byte*   limit,
-                          FT_Int     count,
-                          FT_Byte    flags,
+                          FT_UInt    count,
+                          FT_UInt    flags,
                           FT_UInt    char_code,
                           FT_ULong*  found_offset,
                           FT_ULong*  found_size )
@@ -481,7 +481,7 @@
   pfr_load_bitmap_bits( FT_Byte*    p,
                         FT_Byte*    limit,
                         FT_UInt     format,
-                        FT_UInt     decreasing,
+                        FT_Bool     decreasing,
                         FT_Bitmap*  target )
   {
     FT_Error          error = 0;
@@ -508,7 +508,7 @@
 
       default:
         FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" ));
-        error = FT_Err_Invalid_File_Format;
+        error = PFR_Err_Invalid_File_Format;
       }
     }
 
@@ -560,7 +560,7 @@
       }
 
       /* couldn't find it */
-      return FT_Err_Invalid_Argument;
+      return PFR_Err_Invalid_Argument;
     }
 
   Found_Strike:
@@ -583,7 +583,7 @@
       pfr_lookup_bitmap_data( stream->cursor,
                               stream->limit,
                               strike->num_bitmaps,
-                              (FT_Byte) strike->flags,
+                              strike->flags,
                               character->char_code,
                               &gps_offset,
                               &gps_size );
@@ -593,7 +593,7 @@
       if ( gps_size == 0 )
       {
         /* Could not find a bitmap program string for this glyph */
-        error = FT_Err_Invalid_Argument;
+        error = PFR_Err_Invalid_Argument;
         goto Exit;
       }
     }
@@ -645,16 +645,18 @@
 
         /* Allocate and read bitmap data */
         {
-          FT_ULong    len    = glyph->root.bitmap.pitch * ysize;
+          FT_ULong  len = glyph->root.bitmap.pitch * ysize;
+
 
           error = ft_glyphslot_alloc_bitmap( &glyph->root, len );
           if ( !error )
           {
-            error = pfr_load_bitmap_bits( p,
-                                          stream->limit,
-                                          format,
-                                          face->header.color_flags & 2,
-                                          &glyph->root.bitmap );
+            error = pfr_load_bitmap_bits(
+                      p,
+                      stream->limit,
+                      format,
+                      FT_BOOL(face->header.color_flags & 2),
+                      &glyph->root.bitmap );
           }
         }
       }

Index: pfrtypes.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/pfrtypes.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/pfrtypes.h	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pfrtypes.h	15 Apr 2004 10:14:38 -0000	1.1.4.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR data structures (specification only).                   */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -209,11 +209,14 @@
 #define PFR_KERN_INDEX( g1, g2 ) \
   ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )
 
+#define PFR_KERN_PAIR_INDEX( pair )  \
+          PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 )
+
   typedef struct  PFR_KernPairRec_
   {
     FT_UInt    glyph1;
     FT_UInt    glyph2;
-    FT_Vector  kerning;
+    FT_Int     kerning;
 
   } PFR_KernPairRec, *PFR_KernPair;
 
@@ -230,7 +233,7 @@
     FT_BBox            bbox;
     FT_UInt            flags;
     FT_UInt            standard_advance;
-    
+
     FT_Int             ascent;   /* optional, bbox.yMax if not present */
     FT_Int             descent;  /* optional, bbox.yMin if not present */
     FT_Int             leading;  /* optional, 0 if not present         */
@@ -258,6 +261,7 @@
     FT_UInt            num_kern_pairs;
     PFR_KernItem       kern_items;
     PFR_KernItem*      kern_items_tail;
+    PFR_KernPair       kern_pairs;
 
     /* not part of the spec, but used during load */
     FT_UInt32          bct_offset;
@@ -281,8 +285,8 @@
 
   typedef enum PFR_KernFlags_
   {
-    PFR_KERN_2BYTE_ADJ   = 0x01,
-    PFR_KERN_2BYTE_CHAR  = 0x02
+    PFR_KERN_2BYTE_CHAR  = 0x01,
+    PFR_KERN_2BYTE_ADJ   = 0x02
 
   } PFR_KernFlags;
 

Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pfr/rules.mk,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/rules.mk	14 Nov 2003 16:48:24 -0000	1.1
+++ b/rules.mk	15 Apr 2004 10:14:38 -0000	1.1.4.1
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2002 by
+# Copyright 2002, 2003 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -15,27 +15,28 @@
 
 # pfr driver directory
 #
-PFR_DIR  := $(SRC_)pfr
-PFR_DIR_ := $(PFR_DIR)$(SEP)
+PFR_DIR := $(SRC_DIR)/pfr
 
 
 # compilation flags for the driver
 #
-PFR_COMPILE := $(FT_COMPILE) $I$(PFR_DIR)
+PFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR))
 
 
 # pfr driver sources (i.e., C files)
 #
-PFR_DRV_SRC := $(PFR_DIR_)pfrload.c  \
-               $(PFR_DIR_)pfrgload.c \
-               $(PFR_DIR_)pfrcmap.c  \
-               $(PFR_DIR_)pfrdrivr.c \
-               $(PFR_DIR_)pfrobjs.c
+PFR_DRV_SRC := $(PFR_DIR)/pfrload.c  \
+               $(PFR_DIR)/pfrgload.c \
+               $(PFR_DIR)/pfrcmap.c  \
+               $(PFR_DIR)/pfrdrivr.c \
+               $(PFR_DIR)/pfrsbit.c  \
+               $(PFR_DIR)/pfrobjs.c
 
 # pfr driver headers
 #
 PFR_DRV_H := $(PFR_DRV_SRC:%.c=%.h) \
-             $(PFR_DIR_)pfrerror.h
+             $(PFR_DIR)/pfrerror.h  \
+             $(PFR_DIR)/pfrtypes.h
 
 
 # Pfr driver object(s)
@@ -43,24 +44,24 @@
 #   PFR_DRV_OBJ_M is used during `multi' builds
 #   PFR_DRV_OBJ_S is used during `single' builds
 #
-PFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR_)%.c=$(OBJ_)%.$O)
-PFR_DRV_OBJ_S := $(OBJ_)pfr.$O
+PFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR)/%.c=$(OBJ_DIR)/%.$O)
+PFR_DRV_OBJ_S := $(OBJ_DIR)/pfr.$O
 
 # pfr driver source file for single build
 #
-PFR_DRV_SRC_S := $(PFR_DIR_)pfr.c
+PFR_DRV_SRC_S := $(PFR_DIR)/pfr.c
 
 
 # pfr driver - single object
 #
 $(PFR_DRV_OBJ_S): $(PFR_DRV_SRC_S) $(PFR_DRV_SRC) $(FREETYPE_H) $(PFR_DRV_H)
-	$(PFR_COMPILE) $T$@ $(PFR_DRV_SRC_S)
+	$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PFR_DRV_SRC_S))
 
 
 # pfr driver - multiple objects
 #
-$(OBJ_)%.$O: $(PFR_DIR_)%.c $(FREETYPE_H) $(PFR_DRV_H)
-	$(PFR_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(PFR_DIR)/%.c $(FREETYPE_H) $(PFR_DRV_H)
+	$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
 
 
 # update main driver object lists
@@ -68,4 +69,5 @@
 DRV_OBJS_S += $(PFR_DRV_OBJ_S)
 DRV_OBJS_M += $(PFR_DRV_OBJ_M)
 
+
 # EOF




More information about the xorg-commit-diffs mailing list