Commit 1f005c091801fa2729284b06534bd0a52407d7a6

Werner Lemberg 2022-07-26T16:05:35

* src/pfr/*.c: Trivial improvements and formatting.

diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c
index 1b8d6cd..bcf1c7c 100644
--- a/src/pfr/pfrgload.c
+++ b/src/pfr/pfrgload.c
@@ -42,8 +42,7 @@
   {
     FT_ZERO( glyph );
 
-    glyph->loader     = loader;
-    glyph->path_begun = 0;
+    glyph->loader = loader;
 
     FT_GlyphLoader_Rewind( loader );
   }
@@ -409,7 +408,7 @@
           break;
 
         case 6:                            /* horizontal to vertical curve */
-          FT_TRACE6(( "- hv curve " ));
+          FT_TRACE6(( "- hv curve" ));
           args_format = 0xB8E;
           args_count  = 3;
           break;
diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c
index 6bf7979..25ba077 100644
--- a/src/pfr/pfrload.c
+++ b/src/pfr/pfrload.c
@@ -268,9 +268,7 @@
          header->version     > 4           ||
          header->header_size < 58          ||
          header->signature2 != 0x0D0A      )    /* CR/LF  */
-    {
       result = 0;
-    }
 
     return result;
   }
@@ -406,11 +404,9 @@
       }
 
       if ( flags & PFR_LOG_BOLD )
-      {
         log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD )
                                    ? PFR_NEXT_SHORT( p )
                                    : PFR_NEXT_BYTE( p );
-      }
 
       if ( flags & PFR_LOG_EXTRA_ITEMS )
       {
@@ -604,7 +600,7 @@
     if ( FT_QNEW_ARRAY( snaps, count ) )
       goto Exit;
 
-    phy_font->vertical.stem_snaps = snaps;
+    phy_font->vertical.stem_snaps   = snaps;
     phy_font->horizontal.stem_snaps = snaps + num_vert;
 
     for ( ; count > 0; count--, snaps++ )
@@ -621,7 +617,6 @@
   }
 
 
-
   /* load kerning pair data */
   FT_CALLBACK_DEF( FT_Error )
   pfr_extra_item_load_kerning_pairs( FT_Byte*     p,
@@ -858,7 +853,7 @@
     phy_font->flags      = flags = PFR_NEXT_BYTE( p );
 
     /* get the standard advance for non-proportional fonts */
-    if ( !(flags & PFR_PHY_PROPORTIONAL) )
+    if ( !( flags & PFR_PHY_PROPORTIONAL ) )
     {
       PFR_CHECK( 2 );
       phy_font->standard_advance = PFR_NEXT_SHORT( p );
@@ -869,14 +864,13 @@
     {
       error = pfr_extra_items_parse( &p, limit,
                                      pfr_phy_font_extra_items, phy_font );
-
       if ( error )
         goto Fail;
     }
 
     /* 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 );
 
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 5a6e397..8b29fc0 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -130,14 +130,14 @@
     if ( error )
       goto Exit;
 
-    /* now load the physical font descriptor */
+    /* 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;
 
-    /* now set up all root face fields */
+    /* set up all root face fields */
     {
       PFR_PhyFont  phy_font = &face->phy_font;
 
@@ -160,7 +160,7 @@
         if ( nn == phy_font->num_chars )
         {
           if ( phy_font->num_strikes > 0 )
-            pfrface->face_flags = 0;        /* not scalable */
+            pfrface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
           else
           {
             FT_ERROR(( "pfr_face_init: font doesn't contain glyphs\n" ));
@@ -170,7 +170,7 @@
         }
       }
 
-      if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
+      if ( !( phy_font->flags & PFR_PHY_PROPORTIONAL ) )
         pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
       if ( phy_font->flags & PFR_PHY_VERTICAL )
@@ -338,7 +338,7 @@
     }
 
     /* try to load an embedded bitmap */
-    if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 )
+    if ( !( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) )
     {
       error = pfr_slot_load_bitmap(
                 slot,
diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c
index 8b23fa1..d9bf699 100644
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -391,7 +391,7 @@
   }
 
 
-  /* load bitmap metrics.  `*padvance' must be set to the default value */
+  /* load bitmap metrics.  `*aadvance' must be set to the default value */
   /* before calling this function                                       */
   /*                                                                    */
   static FT_Error
@@ -628,7 +628,7 @@
       if ( strike->flags & PFR_BITMAP_3BYTE_OFFSET )
         char_len += 1;
 
-      /* access data directly in the frame to speed lookups */
+      /* access data directly in the frame to speed up lookups */
       if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) ||
            FT_FRAME_ENTER( char_len * strike->num_bitmaps )        )
         goto Exit;
@@ -744,8 +744,8 @@
            ypos > FT_INT_MAX - (FT_Long)ysize ||
            ypos + (FT_Long)ysize < FT_INT_MIN )
       {
-        FT_TRACE1(( "pfr_slot_load_bitmap:" ));
-        FT_TRACE1(( "huge bitmap glyph %ldx%ld over FT_GlyphSlot\n",
+        FT_TRACE1(( "pfr_slot_load_bitmap:"
+                    " huge bitmap glyph %ldx%ld over FT_GlyphSlot\n",
                      xpos, ypos ));
         error = FT_THROW( Invalid_Pixel_Size );
       }