Commit ea1e8d3a53e29d5ba00fff0ca2c468bf4e16e9af

Wu, Chia-I (吳佳一) 2006-01-15T15:01:45

* include/freetype/internal/ftobjs.h, src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c: s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/. * docs/CHANGES: Mention that vertical metrics are synthesized for fonts not having this info.

diff --git a/ChangeLog b/ChangeLog
index 76236b1..931a533 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-01-15  Chia-I Wu  <b90201047@ntu.edu.tw>
 
+	* include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
+	src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c,
+	src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c:
+	s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/.
+
+	* docs/CHANGES: Mention that vertical metrics are synthesized for
+	fonts not having this info.
+
+2006-01-15  Chia-I Wu  <b90201047@ntu.edu.tw>
+
 	* include/freetype/internal/ftobjs.h (ft_fake_vertical_metrics),
 	src/base/ftobjs.c (ft_fake_vertical_metrics): New function to fake
 	vertical metrics.
diff --git a/docs/CHANGES b/docs/CHANGES
index 5bfdf7d..fb55d89 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -98,6 +98,11 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
     - A new function `FT_Module_Get_Flags' (declared in `FT_MODULE_H')
       can be used to get the module flags for a given module.
 
+    - Vertical metrics of glyphs are  synthesized if the font does not
+      provide such information.  You can tell whether  the metrics are
+      synthesized or not by checking the FT_FACE_FLAG_VERTICAL flag of
+      the face.
+
     - The demo programs  `ftview' and  `ftstring' have been  rewritten
       for better readability.
 
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index a6c6aae..c780732 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -462,12 +462,12 @@ FT_BEGIN_HEADER
 
 
   /*
-   * Use the horizontal metrics to fake the vertical metrics.
-   * If `advance' is zero, it is also faked.
+   * Use the horizontal metrics to synthesize the vertical metrics.
+   * If `advance' is zero, it is also synthesized.
    */
   FT_BASE( void )
-  ft_fake_vertical_metrics( FT_Glyph_Metrics*  metrics,
-                            FT_Pos             advance );
+  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,
+                                  FT_Pos             advance );
 
 
  /*
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 4001a48..5954257 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2042,8 +2042,8 @@
   /* documentation is in ftobjs.h */
 
   FT_BASE_DEF( void )
-  ft_fake_vertical_metrics( FT_Glyph_Metrics*  metrics,
-                            FT_Pos             advance )
+  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,
+                                  FT_Pos             advance )
   {
     /* the factor 1.2 is a heuristical value */
     if ( !advance )
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index a70f8a2..7611e9a 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -712,8 +712,8 @@ THE SOFTWARE.
      * XXX DWIDTH1 and VVECTOR should be parsed and
      * used here, provided such fonts do exist.
      */
-    ft_fake_vertical_metrics( &slot->metrics,
-                              face->bdffont->bbx.height << 6 );
+    ft_synthesize_vertical_metrics( &slot->metrics,
+                                    face->bdffont->bbx.height << 6 );
 
   Exit:
     return error;
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index f66fe24..13cdfa7 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2699,8 +2699,8 @@
         if ( has_vertical_info )
           metrics->vertBearingX = -metrics->width / 2;
         else
-          ft_fake_vertical_metrics( metrics,
-                                    metrics->vertAdvance );
+          ft_synthesize_vertical_metrics( metrics,
+                                          metrics->vertAdvance );
       }
     }
 
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index dc3429a..ed706ad 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -401,8 +401,8 @@
         metrics->horiBearingY = cbox.yMax;
 
         /* make up vertical ones */
-        ft_fake_vertical_metrics( metrics,
-                                  metrics->vertAdvance );
+        ft_synthesize_vertical_metrics( metrics,
+                                        metrics->vertAdvance );
       }
     }
 
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index f28854b..c0fe230 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -531,9 +531,9 @@ THE SOFTWARE.
                                    metric->leftSideBearing ) << 6;
     slot->metrics.height       = bitmap->rows << 6;
 
-    ft_fake_vertical_metrics( &slot->metrics,
-                              ( face->accel.fontAscent +
-                                face->accel.fontDescent ) << 6 );
+    ft_synthesize_vertical_metrics( &slot->metrics,
+                                    ( face->accel.fontAscent +
+                                      face->accel.fontDescent ) << 6 );
 
     FT_TRACE4(( " --- ok\n" ));
 
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 32d760f..2819000 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -359,8 +359,8 @@
         metrics->horiBearingY = cbox.yMax;
 
         /* make up vertical ones */
-        ft_fake_vertical_metrics( metrics,
-                                  metrics->vertAdvance );
+        ft_synthesize_vertical_metrics( metrics,
+                                        metrics->vertAdvance );
       }
 
       /* Set control data to the glyph charstrings.  Note that this is */
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 376fde3..eabf946 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -724,8 +724,8 @@
     slot->metrics.horiBearingX = 0;
     slot->metrics.horiBearingY = slot->bitmap_top << 6;
 
-    ft_fake_vertical_metrics( &slot->metrics,
-                              bitmap->rows << 6 );
+    ft_synthesize_vertical_metrics( &slot->metrics,
+                                    bitmap->rows << 6 );
 
   Exit:
     return error;