Pass options from one configure script to another as-is (not expanded). This is needed for options like --includedir='${prefix}/include'. * builds/unix/detect.mk, configure: Prevent argument expansion in call to the (real) `configure' script. * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if TT_USE_BYTECODE_INTERPRETER isn't defined. There exist CFFs which contain opcodes for the Type 1 operators `hsbw' and `closepath' which are both invalid in Type 2 charstrings. However, it doesn't harm to support them. * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and `cff_op_closepath.' (cff_argument_counts): Ditto. (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath) and 13 (hsbw) which are invalid in Type 2 charstrings.
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
diff --git a/ChangeLog b/ChangeLog
index c2a3040..3189f89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,36 @@
+2007-12-06 Fix <4d876b82@gmail.com>
+
+ Pass options from one configure script to another as-is (not
+ expanded). This is needed for options like
+ --includedir='${prefix}/include'.
+
+ * builds/unix/detect.mk, configure: Prevent argument expansion in
+ call to the (real) `configure' script.
+
+2007-12-06 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if
+ TT_USE_BYTECODE_INTERPRETER isn't defined.
+
+2007-12-06 Werner Lemberg <wl@gnu.org>
+
+ There exist CFFs which contain opcodes for the Type 1 operators
+ `hsbw' and `closepath' which are both invalid in Type 2 charstrings.
+ However, it doesn't harm to support them.
+
+ * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
+ `cff_op_closepath.'
+ (cff_argument_counts): Ditto.
+
+ (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath)
+ and 13 (hsbw) which are invalid in Type 2 charstrings.
+
2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
- * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function
- to support new pathname syntax "..namedfork/rsrc" to access
- a resource fork on Mac OS X. The legacy syntax "/rsrc" does not
- work on case-sensitive HFS+.
+ * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to
+ support new pathname syntax `..namedfork/rsrc' to access a resource
+ fork on Mac OS X. The legacy syntax `/rsrc' does not work on
+ case-sensitive HFS+.
(raccess_guess_darwin_hfsplus): Fix a bug in the calculation of
buffer size to store a pathname.
* include/freetype/internal/ftrfork.h: Increment the number of
@@ -11,9 +38,9 @@
2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
- * builds/unix/configure.raw: improve the compile tests to search
+ * builds/unix/configure.raw: Improve the compile tests to search
Carbon functions.
- * builds/mac/ftmac.c: import fixes for Carbon incompatibilities
+ * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities
proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16).
2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index c4130f9..e74af57 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -79,9 +79,9 @@ ifeq ($(PLATFORM),unix)
ifdef must_configure
ifneq ($(have_Makefile),)
# we are building FT2 not in the src tree
- $(TOP_DIR)/builds/unix/configure $(CFG)
+ $(TOP_DIR)/builds/unix/configure $(value CFG)
else
- cd builds/unix; ./configure $(CFG)
+ cd builds/unix; ./configure $(value CFG)
endif
endif
diff --git a/configure b/configure
index f251ae4..c72e44b 100644
--- a/configure
+++ b/configure
@@ -93,7 +93,7 @@ fi
CFG=
for x in ${1+"$@"}; do
- CFG="$CFG \"$x\""
+ CFG="$CFG '$x'"
done
CFG=$CFG $GNUMAKE setup unix
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 0e2a179..cbd4fda 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -110,6 +110,9 @@
cff_op_callgsubr,
cff_op_return,
+ cff_op_hsbw, /* Type 1 opcode: invalid but seen in real life */
+ cff_op_closepath, /* ditto */
+
/* do not remove */
cff_op_max
@@ -187,6 +190,9 @@
1, /* callsubr */
1,
+ 0,
+
+ 2, /* hsbw */
0
};
@@ -393,7 +399,7 @@
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
-
+
sub = cff->subfonts[fd_index];
}
@@ -954,6 +960,9 @@
case 8:
op = cff_op_rrcurveto;
break;
+ case 9:
+ op = cff_op_closepath;
+ break;
case 10:
op = cff_op_callsubr;
break;
@@ -1055,6 +1064,9 @@
}
}
break;
+ case 13:
+ op = cff_op_hsbw;
+ break;
case 14:
op = cff_op_endchar;
break;
@@ -1168,7 +1180,7 @@
req_args = 0;
}
- req_args &= 15;
+ req_args &= 0x000F;
if ( num_args < req_args )
goto Stack_Underflow;
args -= req_args;
@@ -2022,6 +2034,30 @@
FT_TRACE4(( " dotsection" ));
break;
+ case cff_op_closepath:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " closepath (invalid op)" ));
+
+ args = stack;
+ break;
+
+ case cff_op_hsbw:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " hsbw (invalid op)" ));
+
+ decoder->glyph_width = decoder->nominal_width +
+ (args[1] >> 16);
+ x = args[0];
+ y = 0;
+ args = stack;
+ break;
+
case cff_op_and:
{
FT_Fixed cond = args[0] && args[1];
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index c3dedd0..c17a437 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1402,11 +1402,13 @@
FT_Stream old_stream = loader->stream;
+#ifdef TT_USE_BYTECODE_INTERPRETER
TT_GraphicsState saved_GS;
if ( loader->exec )
saved_GS = loader->exec->GS;
+#endif
FT_GlyphLoader_Add( gloader );
@@ -1416,9 +1418,11 @@
FT_Vector pp[4];
+#ifdef TT_USE_BYTECODE_INTERPRETER
/* reinitialize graphics state */
if ( loader->exec )
loader->exec->GS = saved_GS;
+#endif
/* Each time we call load_truetype_glyph in this loop, the */
/* value of `gloader.base.subglyphs' can change due to table */