[autofit] Minor fix. * src/autofit/afcjk.c (af_cjk_metrics_init_widths), src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling of alternative standard characters. This also fixes a compilation warning in non-debug mode.
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
diff --git a/ChangeLog b/ChangeLog
index 9bf1bec..c6967c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-02-04 Werner Lemberg <wl@gnu.org>
+
+ [autofit] Minor fix.
+
+ * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
+ src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling
+ of alternative standard characters.
+ This also fixes a compilation warning in non-debug mode.
+
2014-02-03 Werner Lemberg <wl@gnu.org>
[cff] Fix Savannah bug #41363.
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 96a2093..3a65fc5 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -104,40 +104,39 @@
FT_UInt32 standard_char;
+ standard_char = script_class->standard_char1;
af_get_char_index( &metrics->root,
- script_class->standard_char1,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
{
if ( script_class->standard_char2 )
{
+ standard_char = script_class->standard_char2;
af_get_char_index( &metrics->root,
- script_class->standard_char2,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
{
if ( script_class->standard_char3 )
{
+ standard_char = script_class->standard_char3;
af_get_char_index( &metrics->root,
- script_class->standard_char3,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
goto Exit;
- else
- standard_char = script_class->standard_char3;
}
+ else
+ goto Exit;
}
- else
- standard_char = script_class->standard_char2;
}
else
goto Exit;
}
- else
- standard_char = script_class->standard_char1;
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
standard_char, glyph_index ));
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 13351c2..e3a7742 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -98,40 +98,39 @@
* numerals.
*/
+ standard_char = script_class->standard_char1;
af_get_char_index( &metrics->root,
- script_class->standard_char1,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
{
if ( script_class->standard_char2 )
{
+ standard_char = script_class->standard_char2;
af_get_char_index( &metrics->root,
- script_class->standard_char2,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
{
if ( script_class->standard_char3 )
{
+ standard_char = script_class->standard_char3;
af_get_char_index( &metrics->root,
- script_class->standard_char3,
+ standard_char,
&glyph_index,
&y_offset );
- if ( glyph_index == 0 )
+ if ( !glyph_index )
goto Exit;
- else
- standard_char = script_class->standard_char3;
}
+ else
+ goto Exit;
}
- else
- standard_char = script_class->standard_char2;
}
else
goto Exit;
}
- else
- standard_char = script_class->standard_char1;
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
standard_char, glyph_index ));