[Xorg-commit] xc/extras/freetype2/src/pcf Jamfile,1.1.4.1,1.1.4.2 pcf.c,1.1,1.1.4.1 pcf.h,1.1.4.1,1.1.4.2 pcfread.c,1.1.4.1,1.1.4.2 pcfread.h,1.1,1.1.4.1 pcfutil.c,1.1,1.1.4.1 pcfutil.h,1.1.4.1,1.1.4.2 rules.mk,1.1,1.1.4.1

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: kaleb

Update of /cvs/xorg/xc/extras/freetype2/src/pcf
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/extras/freetype2/src/pcf

Modified Files:
      Tag: XORG-CURRENT
	Jamfile pcf.c pcf.h pcfread.c pcfread.h pcfutil.c pcfutil.h 
	rules.mk 
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214


Index: Jamfile
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/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:26 -0000	1.1.4.1
+++ b/Jamfile	23 Feb 2004 21:32:53 -0000	1.1.4.2
@@ -1,4 +1,4 @@
-# FreeType 2 src/pcf Jamfile (c) 2001 David Turner
+# FreeType 2 src/pcf Jamfile (c) 2001, 2003 David Turner
 #
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) pcf ;
@@ -8,7 +8,7 @@
 
   if $(FT2_MULTI)
   {
-    _sources = pcfdriver pcfread pcfutil ;
+    _sources = pcfdrivr pcfread pcfutil ;
   }
   else
   {

Index: pcf.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcf.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pcf.c	14 Nov 2003 16:48:24 -0000	1.1
+++ b/pcf.c	23 Feb 2004 21:32:53 -0000	1.1.4.1
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000-2001 by
+  Copyright 2000-2001, 2003 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,6 +31,6 @@
 #include <ft2build.h>
 #include "pcfutil.c"
 #include "pcfread.c"
-#include "pcfdriver.c"
+#include "pcfdrivr.c"
 
 /* END */

Index: pcf.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcf.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/pcf.h	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pcf.h	23 Feb 2004 21:32:53 -0000	1.1.4.2
@@ -2,7 +2,7 @@
 
   FreeType font driver for pcf fonts
 
-  Copyright (C) 2000-2001, 2002 by
+  Copyright (C) 2000, 2001, 2002, 2003 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -124,10 +124,10 @@
   } PCF_AccelRec, *PCF_Accel;
 
 
-  typedef struct  PCD_EncodingRec_
+  typedef struct  PCF_EncodingRec_
   {
-    FT_Long   enc;
-    FT_Short  glyph;
+    FT_Long    enc;
+    FT_UShort  glyph;
 
   } PCF_EncodingRec, *PCF_Encoding;
 

Index: pcfread.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcfread.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/pcfread.c	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pcfread.c	23 Feb 2004 21:32:53 -0000	1.1.4.2
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000-2001, 2002 by
+  Copyright 2000, 2001, 2002, 2003 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,7 +23,7 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
-/* $XFree86: xc/extras/freetype2/src/pcf/pcfread.c,v 1.4 2003/10/22 17:26:29 tsi Exp $ */
+
 
 #include <ft2build.h>
 
@@ -32,7 +32,7 @@
 #include FT_INTERNAL_OBJECTS_H
 
 #include "pcf.h"
-#include "pcfdriver.h"
+#include "pcfdrivr.h"
 #include "pcfread.h"
 
 #include "pcferror.h"
@@ -250,18 +250,22 @@
                           FT_ULong  *aformat,
                           FT_ULong  *asize )
   {
-    FT_Error  error;
+    FT_Error  error = PCF_Err_Invalid_File_Format;
     FT_Int    i;
 
 
     for ( i = 0; i < ntables; i++ )
       if ( tables[i].type == type )
       {
-        if ( stream->pos > tables[i].offset )
-          return PCF_Err_Invalid_Stream_Skip;
+        if ( stream->pos > tables[i].offset ) {
+          error = PCF_Err_Invalid_Stream_Skip;
+          goto Fail;
+        }
 
-        if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )
-          return error;
+        if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) ) {
+          error = PCF_Err_Invalid_Stream_Skip;
+          goto Fail;
+        }
 
         *asize   = tables[i].size;  /* unused - to be removed */
         *aformat = tables[i].format;
@@ -269,7 +273,8 @@
         return PCF_Err_Ok;
       }
 
-    return PCF_Err_Invalid_File_Format;
+  Fail:
+    return error;
   }
 
 
@@ -914,10 +919,9 @@
     {
       FT_Face       root = FT_FACE( face );
       PCF_Property  prop;
-      int           size_set = 0;
 
 
-      root->num_faces = 1;
+      root->num_faces  = 1;
       root->face_index = 0;
       root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
                          FT_FACE_FLAG_HORIZONTAL  |
@@ -931,13 +935,16 @@
       if ( prop != NULL )
         if ( prop->isString )
           if ( ( *(prop->value.atom) == 'O' ) ||
-               ( *(prop->value.atom) == 'I' ) )
+               ( *(prop->value.atom) == 'o' ) ||
+               ( *(prop->value.atom) == 'I' ) ||
+               ( *(prop->value.atom) == 'i' ) )
             root->style_flags |= FT_STYLE_FLAG_ITALIC;
 
       prop = pcf_find_property( face, "WEIGHT_NAME" );
       if ( prop != NULL )
         if ( prop->isString )
-          if ( *(prop->value.atom) == 'B' )
+          if ( ( *(prop->value.atom) == 'B' ) ||
+               ( *(prop->value.atom) == 'b' ) )
             root->style_flags |= FT_STYLE_FLAG_BOLD;
 
       root->style_name = (char *)"Regular";
@@ -967,53 +974,56 @@
       else
         root->family_name = 0;
 
-      root->num_glyphs = face->nmetrics;
+      /* Note: We shift all glyph indices by +1 since we must
+       * respect the convention that glyph 0 always corresponds
+       * to the "missing glyph".
+       *
+       * This implies bumping the number of "available" glyphs by 1.
+       */
+      root->num_glyphs = face->nmetrics + 1;
 
       root->num_fixed_sizes = 1;
       if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
         goto Exit;
 
-      prop = pcf_find_property( face, "PIXEL_SIZE" );
-      if ( prop != NULL )
       {
-        root->available_sizes->height =
-        root->available_sizes->width  = (FT_Short)( prop->value.integer );
+        FT_Bitmap_Size*  bsize = root->available_sizes;
 
-        size_set = 1;
-      }
-      else
-      {
-        prop = pcf_find_property( face, "POINT_SIZE" );
+
+        FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
+
+        prop = pcf_find_property( face, "PIXEL_SIZE" );
         if ( prop != NULL )
-        {
-          PCF_Property  xres, yres;
+          bsize->height = (FT_Short)prop->value.integer;
 
+        prop = pcf_find_property( face, "AVERAGE_WIDTH" );
+        if ( prop != NULL )
+          bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 );
 
-          xres = pcf_find_property( face, "RESOLUTION_X" );
-          yres = pcf_find_property( face, "RESOLUTION_Y" );
+        prop = pcf_find_property( face, "POINT_SIZE" );
+        if ( prop != NULL )
+          /* convert from 722,7 decipoints to 72 points per inch */
+          bsize->size =
+            (FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L );
 
-          if ( ( yres != NULL ) && ( xres != NULL ) )
-          {
-            root->available_sizes->height =
-              (FT_Short)( prop->value.integer *
-                          yres->value.integer / 720 );
+        prop = pcf_find_property( face, "RESOLUTION_X" );
+        if ( prop != NULL )
+          bsize->x_ppem =
+            (FT_Pos)( ( prop->value.integer * bsize->size + 36 ) / 72 );
 
-              root->available_sizes->width =
-                (FT_Short)( prop->value.integer *
-                            xres->value.integer / 720 );
+        prop = pcf_find_property( face, "RESOLUTION_Y" );
+        if ( prop != NULL )
+          bsize->y_ppem =
+            (FT_Pos)( ( prop->value.integer * bsize->size + 36 ) / 72 );
 
-            size_set = 1;
-          }
-        }
-      }
+        if ( bsize->height == 0 )
+          bsize->height = (FT_Short)( ( bsize->y_ppem + 32 ) / 64 );
 
-      if (size_set == 0 )
-      {
-        root->available_sizes->width  = 12;
-        root->available_sizes->height = 12;
+        if ( bsize->height == 0 )
+          bsize->height = 12;
       }
 
-      /* set-up charset */
+      /* set up charset */
       {
         PCF_Property  charset_registry = 0, charset_encoding = 0;
 

Index: pcfread.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcfread.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pcfread.h	25 Nov 2003 19:27:21 -0000	1.1
+++ b/pcfread.h	23 Feb 2004 21:32:53 -0000	1.1.4.1
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000-2001 by
+  Copyright 2003 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,7 +39,7 @@
 
 FT_END_HEADER
 
-#endif /* __PCFUTIL_H__ */
+#endif /* __PCFREAD_H__ */
 
 
 /* END */

Index: pcfutil.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcfutil.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pcfutil.c	14 Nov 2003 16:48:24 -0000	1.1
+++ b/pcfutil.c	23 Feb 2004 21:32:53 -0000	1.1.4.1
@@ -2,11 +2,7 @@
 
 Copyright 1990, 1994, 1998  The Open Group
 
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
+All Rights Reserved.
 
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
@@ -23,7 +19,7 @@
 in this Software without prior written authorization from The Open Group.
 
 */
-/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.c,v 1.4 2002/12/17 03:28:26 dawes Exp $ */
+/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.c,v 1.5 2003/12/22 17:48:01 tsi Exp $ */
 
 /*
  * Author:  Keith Packard, MIT X Consortium
@@ -76,7 +72,7 @@
    *  Invert bit order within each BYTE of an array.
    */
 
-  static void
+  void
   BitOrderInvert( unsigned char*  buf,
                   int             nbytes )
   {
@@ -92,7 +88,7 @@
    *  Invert byte order within each 16-bits of an array.
    */
 
-  static void
+  void
   TwoByteSwap( unsigned char*  buf,
                int             nbytes )
   {
@@ -111,7 +107,7 @@
    *  Invert byte order within each 32-bits of an array.
    */
 
-  static void
+  void
   FourByteSwap( unsigned char*  buf,
                 int             nbytes )
   {
@@ -131,11 +127,12 @@
   }
 
 
+# ifdef UNUSED
   /*
    *  Repad a bitmap.
    */
 
-  static int
+  int
   RepadBitmap( char*         pSrc,
                char*         pDst,
                unsigned int  srcPad,
@@ -214,6 +211,6 @@
 
     return dstWidthBytes * height;
   }
-
+# endif
 
 /* END */

Index: pcfutil.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/pcfutil.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/pcfutil.h	26 Nov 2003 22:48:27 -0000	1.1.4.1
+++ b/pcfutil.h	23 Feb 2004 21:32:53 -0000	1.1.4.2
@@ -23,7 +23,7 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
-/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.h,v 1.3 2003/10/22 18:51:24 tsi Exp $ */
+/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.h,v 1.4 2003/12/22 17:48:01 tsi Exp $ */
 
 #ifndef __PCFUTIL_H__
 #define __PCFUTIL_H__
@@ -32,18 +32,19 @@
 #include <ft2build.h>
 
 
-  static void
+  void
   BitOrderInvert( unsigned char*  buf,
                   int             nbytes);
 
-  static void
+  void
   TwoByteSwap( unsigned char*  buf,
                int             nbytes);
 
-  static void
+  void
   FourByteSwap( unsigned char*  buf,
                 int             nbytes);
 
+# ifdef UNUSED
   static int
   RepadBitmap( char*           pSrc,
                char*           pDst,
@@ -51,6 +52,7 @@
                unsigned int    dstPad,
                int             width,
                int             height);
+# endif
 
 #endif /* __PCFUTIL_H__ */
 

Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/pcf/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	23 Feb 2004 21:32:53 -0000	1.1.4.1
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright (C) 2000, 2001 by
+# Copyright (C) 2000, 2001, 2003 by
 # Francesco Zappa Nardelli
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -27,49 +27,48 @@
 
 # pcf driver directory
 #
-PCF_DIR  := $(SRC_)pcf
-PCF_DIR_ := $(PCF_DIR)$(SEP)
+PCF_DIR := $(SRC_DIR)/pcf
 
 
-PCF_COMPILE := $(FT_COMPILE) $I$(PCF_DIR)
+PCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))
 
 
 # pcf driver sources (i.e., C files)
 #
-PCF_DRV_SRC := $(PCF_DIR_)pcfread.c   \
-               $(PCF_DIR_)pcfdriver.c \
-               $(PCF_DIR_)pcfutil.c
+PCF_DRV_SRC := $(PCF_DIR)/pcfread.c  \
+               $(PCF_DIR)/pcfdrivr.c \
+               $(PCF_DIR)/pcfutil.c
 
 # pcf driver headers
 #
-PCF_DRV_H := $(PCF_DIR_)pcf.h       \
-             $(PCF_DIR_)pcfdriver.h \
-             $(PCF_DIR_)pcfutil.h   \
-             $(PCF_DIR_)pcferror.h
+PCF_DRV_H := $(PCF_DIR)/pcf.h      \
+             $(PCF_DIR)/pcfdrivr.h \
+             $(PCF_DIR)/pcfutil.h  \
+             $(PCF_DIR)/pcferror.h
 
 # pcf driver object(s)
 #
 #   PCF_DRV_OBJ_M is used during `multi' builds
 #   PCF_DRV_OBJ_S is used during `single' builds
 #
-PCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR_)%.c=$(OBJ_)%.$O)
-PCF_DRV_OBJ_S := $(OBJ_)pcf.$O
+PCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR)/%.c=$(OBJ_DIR)/%.$O)
+PCF_DRV_OBJ_S := $(OBJ_DIR)/pcf.$O
 
-# Windows driver source file for single build
+# pcf driver source file for single build
 #
-PCF_DRV_SRC_S := $(PCF_DIR_)pcf.c
+PCF_DRV_SRC_S := $(PCF_DIR)/pcf.c
 
 
 # pcf driver - single object
 #
 $(PCF_DRV_OBJ_S): $(PCF_DRV_SRC_S) $(PCF_DRV_SRC) $(FREETYPE_H) $(PCF_DRV_H)
-	$(PCF_COMPILE) $T$@ $(PCF_DRV_SRC_S)
+	$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PCF_DRV_SRC_S))
 
 
 # pcf driver - multiple objects
 #
-$(OBJ_)%.$O: $(PCF_DIR_)%.c $(FREETYPE_H) $(PCF_DRV_H)
-	$(PCF_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(PCF_DIR)/%.c $(FREETYPE_H) $(PCF_DRV_H)
+	$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
 
 
 # update main driver object lists
@@ -77,4 +76,5 @@
 DRV_OBJS_S += $(PCF_DRV_OBJ_S)
 DRV_OBJS_M += $(PCF_DRV_OBJ_M)
 
+
 # EOF





More information about the xorg-commit mailing list