| Index: src/prep.cc
|
| diff --git a/src/prep.cc b/src/prep.cc
|
| old mode 100644
|
| new mode 100755
|
| index 6567a6f82ca07f23d887c6301f0d13df774653cf..f8a574808637b03082ccf7c1e2824da7f8c0582f
|
| --- a/src/prep.cc
|
| +++ b/src/prep.cc
|
| @@ -5,7 +5,9 @@
|
| #include "prep.h"
|
|
|
| // prep - Control Value Program
|
| -// http://www.microsoft.com/opentype/otspec/prep.htm
|
| +// http://www.microsoft.com/typography/otspec/prep.htm
|
| +
|
| +#define TABLE_NAME "prep"
|
|
|
| namespace ots {
|
|
|
| @@ -16,11 +18,11 @@ bool ots_prep_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
|
| file->prep = prep;
|
|
|
| if (length >= 128 * 1024u) {
|
| - return OTS_FAILURE(); // almost all prep tables are less than 9k bytes.
|
| + return OTS_FAILURE_MSG("table length %ld > 120K", length); // almost all prep tables are less than 9k bytes.
|
| }
|
|
|
| if (!table.Skip(length)) {
|
| - return OTS_FAILURE();
|
| + return OTS_FAILURE_MSG("Failed to read table of length %ld", length);
|
| }
|
|
|
| prep->data = data;
|
| @@ -30,14 +32,14 @@ bool ots_prep_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
|
|
|
| bool ots_prep_should_serialise(OpenTypeFile *file) {
|
| if (!file->glyf) return false; // this table is not for CFF fonts.
|
| - return g_transcode_hints && file->prep;
|
| + return file->prep;
|
| }
|
|
|
| bool ots_prep_serialise(OTSStream *out, OpenTypeFile *file) {
|
| const OpenTypePREP *prep = file->prep;
|
|
|
| if (!out->Write(prep->data, prep->length)) {
|
| - return OTS_FAILURE();
|
| + return OTS_FAILURE_MSG("Failed to write table length");
|
| }
|
|
|
| return true;
|
| @@ -48,3 +50,5 @@ void ots_prep_free(OpenTypeFile *file) {
|
| }
|
|
|
| } // namespace ots
|
| +
|
| +#undef TABLE_NAME
|
|
|