[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Nov 7 02:08:09 PST 2007


 src/harfbuzz-buffer.h       |    8 ++--
 src/harfbuzz-dump-main.c    |   22 +++++------
 src/harfbuzz-gdef-private.h |    2 -
 src/harfbuzz-gdef.c         |   88 --------------------------------------------
 src/harfbuzz-global.h       |    2 -
 src/harfbuzz-gpos.c         |    5 +-
 6 files changed, 19 insertions(+), 108 deletions(-)

New commits:
commit 485dc0f551918bdc4dd07b938ee02fb5029be8b4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Nov 7 04:35:56 2007 -0500

    Minor changes.

diff --git a/src/harfbuzz-buffer.h b/src/harfbuzz-buffer.h
index 6c32ead..3043671 100644
--- a/src/harfbuzz-buffer.h
+++ b/src/harfbuzz-buffer.h
@@ -28,10 +28,10 @@ typedef struct HB_GlyphItemRec_ {
 } HB_GlyphItemRec, *HB_GlyphItem;
 
 typedef struct HB_PositionRec_ {
-  HB_Fixed     x_pos;
-  HB_Fixed     y_pos;
-  HB_Fixed     x_advance;
-  HB_Fixed     y_advance;
+  HB_Fixed   x_pos;
+  HB_Fixed   y_pos;
+  HB_Fixed   x_advance;
+  HB_Fixed   y_advance;
   HB_UShort  back;            /* number of glyphs to go back
 				 for drawing current glyph   */
   HB_Bool    new_advance;     /* if set, the advance width values are
diff --git a/src/harfbuzz-dump-main.c b/src/harfbuzz-dump-main.c
index 5945c9d..7e1b5a4 100644
--- a/src/harfbuzz-dump-main.c
+++ b/src/harfbuzz-dump-main.c
@@ -131,7 +131,7 @@ HB_UShort arabic_props[] = { I|L,   M|L,   M|L,   M|L,   M|L,   F|L,   I|L,  M|L
 
 void
 try_string (FT_Library library,
-	    FT_Face    face,
+	    HB_Font    font,
 	    HB_GSUB   gsub)
 {
   HB_Error error;
@@ -139,9 +139,9 @@ try_string (FT_Library library,
   HB_GSUB_String *out_str;
   HB_UInt i;
 
-  if ((error = HB_GSUB_String_New (face->memory, &in_str)))
+  if ((error = HB_GSUB_String_New (font->memory, &in_str)))
     croak ("HB_GSUB_String_New", error);
-  if ((error = HB_GSUB_String_New (face->memory, &out_str)))
+  if ((error = HB_GSUB_String_New (font->memory, &out_str)))
     croak ("HB_GSUB_String_New", error);
 
   if ((error = HB_GSUB_String_Set_Length (in_str, N_ELEMENTS (arabic_str))))
@@ -149,7 +149,7 @@ try_string (FT_Library library,
 
   for (i=0; i < N_ELEMENTS (arabic_str); i++)
     {
-      in_str->string[i] = FT_Get_Char_Index (face, arabic_str[i]);
+      in_str->string[i] = FT_Get_Char_Index (font, arabic_str[i]);
       in_str->properties[i] = arabic_props[i];
       in_str->components[i] = i;
       in_str->ligIDs[i] = i;
@@ -173,7 +173,7 @@ main (int argc, char **argv)
 {
   HB_Error error;
   FT_Library library;
-  FT_Face face;
+  HB_Font font;
   HB_GSUB gsub;
   HB_GPOS gpos;
 
@@ -186,13 +186,13 @@ main (int argc, char **argv)
   if ((error = FT_Init_FreeType (&library)))
     croak ("FT_Init_FreeType", error);
 
-  if ((error = FT_New_Face (library, argv[1], 0, &face)))
+  if ((error = FT_New_Face (library, argv[1], 0, &font)))
     croak ("FT_New_Face", error);
 
   printf ("<?xml version=\"1.0\"?>\n");
   printf ("<OpenType>\n");
 
-  if (!(error = HB_Load_GSUB_Table (face, &gsub, NULL)))
+  if (!(error = HB_Load_GSUB_Table (font, &gsub, NULL)))
     {
       HB_Dump_GSUB_Table (gsub, stdout);
       
@@ -202,7 +202,7 @@ main (int argc, char **argv)
   else if (error != HB_Err_Not_Covered)
     fprintf (stderr, "HB_Load_GSUB_Table %x\n", error);
 
-  if (!(error = HB_Load_GPOS_Table (face, &gpos, NULL)))
+  if (!(error = HB_Load_GPOS_Table (font, &gpos, NULL)))
     {
       HB_Dump_GPOS_Table (gpos, stdout);
       
@@ -215,14 +215,14 @@ main (int argc, char **argv)
   printf ("</OpenType>\n");
 
 #if 0  
-  select_cmap (face);
+  select_cmap (font);
 
   add_features (gsub);
-  try_string (library, face, gsub);
+  try_string (library, font, gsub);
 #endif
 
 
-  if ((error = FT_Done_Face (face)))
+  if ((error = FT_Done_Face (font)))
     croak ("FT_Done_Face", error);
 
   if ((error = FT_Done_FreeType (library)))
diff --git a/src/harfbuzz-gdef-private.h b/src/harfbuzz-gdef-private.h
index 2228d20..a6b893f 100644
--- a/src/harfbuzz-gdef-private.h
+++ b/src/harfbuzz-gdef-private.h
@@ -102,7 +102,7 @@ _HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
 
 HB_INTERNAL HB_Error
 _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
-						  HB_Stream      stream,
+						  HB_Stream      input,
 						  HB_Lookup*     lo,
 						  HB_UShort      num_lookups );
 
diff --git a/src/harfbuzz-gdef.c b/src/harfbuzz-gdef.c
index 56099e6..6f3c64a 100644
--- a/src/harfbuzz-gdef.c
+++ b/src/harfbuzz-gdef.c
@@ -26,94 +26,6 @@ static void  Free_NewGlyphClasses( HB_GDEFHeader*  gdef);
 
 
 
-/**********************
- * Extension Functions
- **********************/
-
-#if 0
-#define GDEF_ID  Build_Extension_ID( 'G', 'D', 'E', 'F' )
-
-
-static HB_Error  GDEF_Create( void*  ext,
-			      PFace  face )
-{
-  DEFINE_LOAD_LOCALS( face->stream );
-
-  HB_GDEFHeader*  gdef = (HB_GDEFHeader*)ext;
-  Long             table;
-
-
-  /* by convention */
-
-  if ( !gdef )
-    return HB_Err_Ok;
-
-  /* a null offset indicates that there is no GDEF table */
-
-  gdef->offset = 0;
-
-  /* we store the start offset and the size of the subtable */
-
-  table = HB_LookUp_Table( face, TTAG_GDEF );
-  if ( table < 0 )
-    return HB_Err_Ok;             /* The table is optional */
-
-  if ( FILE_Seek( face->dirTables[table].Offset ) ||
-       ACCESS_Frame( 4L ) )
-    return error;
-
-  gdef->offset  = FILE_Pos() - 4L;    /* undo ACCESS_Frame() */
-  gdef->Version = GET_ULong();
-
-  FORGET_Frame();
-
-  gdef->loaded = FALSE;
-
-  return HB_Err_Ok;
-}
-
-
-static HB_Error  GDEF_Destroy( void*  ext,
-			       PFace  face )
-{
-  HB_GDEFHeader*  gdef = (HB_GDEFHeader*)ext;
-
-
-  /* by convention */
-
-  if ( !gdef )
-    return HB_Err_Ok;
-
-  if ( gdef->loaded )
-  {
-    Free_LigCaretList( &gdef->LigCaretList );
-    Free_AttachList( &gdef->AttachList );
-    _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
-    _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef );
-
-    Free_NewGlyphClasses( gdef );
-  }
-
-  return HB_Err_Ok;
-}
-
-
-
-HB_Error  HB_Init_GDEF_Extension( HB_Engine  engine )
-{
-  PEngine_Instance  _engine = HANDLE_Engine( engine );
-
-
-  if ( !_engine )
-    return ERR(HB_Err_Invalid_Engine);
-
-  return  HB_Register_Extension( _engine,
-				 GDEF_ID,
-				 sizeof ( HB_GDEFHeader ),
-				 GDEF_Create,
-				 GDEF_Destroy );
-}
-#endif
 /* GDEF glyph classes */
 
 #define UNCLASSIFIED_GLYPH  0
diff --git a/src/harfbuzz-global.h b/src/harfbuzz-global.h
index f370a47..e803b8e 100644
--- a/src/harfbuzz-global.h
+++ b/src/harfbuzz-global.h
@@ -1,7 +1,7 @@
 /*******************************************************************
  *
- *  Copyright 2005  David Turner, The FreeType Project (www.freetype.org)
  *  Copyright 2007  Trolltech ASA
+ *  Copyright 2007  Behdad Esfahbod
  *
  *  This is part of HarfBuzz, an OpenType Layout engine library.
  *
diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index dc7549b..1f5f916 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -712,9 +712,8 @@ static HB_Error  Get_Anchor( GPOS_Instance*   gpi,
       error = gpi->font->klass->getPointInOutline(gpi->font, glyph_index, gpi->load_flags, ap, x_value, y_value, &n_points);
       if (error)
           return error;
-      /* if outline.n_points is set to zero, we use the
-	 design coordinate value pair.  This can happen e.g. for
-	 sbit glyphs                                               */
+      /* if n_points is set to zero, we use the design coordinate value pair.
+       * This can happen e.g. for sbit glyphs. */
       if (!n_points)
           goto no_contour_point;
     }



More information about the HarfBuzz mailing list