Commit 4c507ffa80cc3f15cd6288a914dde4bd9438b5b5

Wu, Chia-I (吳佳一) 2006-02-11T13:22:37

* src/autofit/afcjk.c (af_cjk_metrics_init): Fix a stupid bug... * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use AF_LatinMetricsRec as the dummy metrics because we cast the metrics to it later in `af_latin_hints_link_segments'.

diff --git a/ChangeLog b/ChangeLog
index 8611946..e4320ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2006-02-11  Chia-I Wu  <b90201047@ntu.edu.tw>
 
+	* src/autofit/afcjk.c (af_cjk_metrics_init): Fix a stupid bug...
+
+	* src/autofit/aflatin.c (af_latin_metrics_init_widths): Use
+	AF_LatinMetricsRec as the dummy metrics because we cast the metrics to
+	it later in `af_latin_hints_link_segments'.
+
+2006-02-11  Chia-I Wu  <b90201047@ntu.edu.tw>
+
 	* include/freetype/config/ftoption.h (AF_CONFIG_OPTION_CJK): #define
 	to enable autofit CJK script support. (#define'd by default)
 
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index cca58ad..cff98c5 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -52,7 +52,7 @@
 
     /* TODO are there blues? */
 
-    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
+    if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
       face->charmap = NULL;
 
     /* latin's version would suffice */
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index f824ccb..9c1beb3 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -51,8 +51,8 @@
       FT_Error             error;
       FT_UInt              glyph_index;
       int                  dim;
-      AF_ScriptMetricsRec  dummy[1];
-      AF_Scaler            scaler = &dummy->scaler;
+      AF_LatinMetricsRec   dummy[1];
+      AF_Scaler            scaler = &dummy->root.scaler;
 
 
       glyph_index = FT_Get_Char_Index( face, charcode );
@@ -65,13 +65,14 @@
 
       FT_ZERO( dummy );
 
+      dummy->units_per_em = metrics->units_per_em;
       scaler->x_scale     = scaler->y_scale = 0x10000L;
       scaler->x_delta     = scaler->y_delta = 0;
       scaler->face        = face;
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
 
-      af_glyph_hints_rescale( hints, dummy );
+      af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
 
       error = af_glyph_hints_reload( hints, &face->glyph->outline );
       if ( error )