* 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'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
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 )