shithub: freetype+ttf2subf

Download patch

ref: 4c507ffa80cc3f15cd6288a914dde4bd9438b5b5
parent: f9a69132a73bea7a7c1e7726789841acd8235a4b
author: Wu, Chia-I (吳佳一) <[email protected]>
date: Sat Feb 11 08:22:37 EST 2006

* 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'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2006-02-11  Chia-I Wu  <[email protected]>
 
+	* 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  <[email protected]>
+
 	* include/freetype/config/ftoption.h (AF_CONFIG_OPTION_CJK): #define
 	to enable autofit CJK script support. (#define'd by default)
 
--- 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 */
--- 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,6 +65,7 @@
 
       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;
@@ -71,7 +72,7 @@
       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 )