| Index: src/cvt.cc
|
| diff --git a/src/cvt.cc b/src/cvt.cc
|
| old mode 100644
|
| new mode 100755
|
| index 3403a870e377adc6a921ada6c4f500348461f03e..790e5525a771c69c30c2c48dcc6499158a44f8e6
|
| --- a/src/cvt.cc
|
| +++ b/src/cvt.cc
|
| @@ -5,7 +5,9 @@
|
| #include "cvt.h"
|
|
|
| // cvt - Control Value Table
|
| -// http://www.microsoft.com/opentype/otspec/cvt.htm
|
| +// http://www.microsoft.com/typography/otspec/cvt.htm
|
| +
|
| +#define TABLE_NAME "cvt"
|
|
|
| namespace ots {
|
|
|
| @@ -16,15 +18,15 @@ bool ots_cvt_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
|
| file->cvt = cvt;
|
|
|
| if (length >= 128 * 1024u) {
|
| - return OTS_FAILURE(); // almost all cvt tables are less than 4k bytes.
|
| + return OTS_FAILURE_MSG("Length (%d) > 120K"); // almost all cvt tables are less than 4k bytes.
|
| }
|
|
|
| if (length % 2 != 0) {
|
| - return OTS_FAILURE();
|
| + return OTS_FAILURE_MSG("Uneven cvt length (%d)", length);
|
| }
|
|
|
| if (!table.Skip(length)) {
|
| - return OTS_FAILURE();
|
| + return OTS_FAILURE_MSG("Length too high");
|
| }
|
|
|
| cvt->data = data;
|
| @@ -36,14 +38,14 @@ bool ots_cvt_should_serialise(OpenTypeFile *file) {
|
| if (!file->glyf) {
|
| return false; // this table is not for CFF fonts.
|
| }
|
| - return g_transcode_hints && file->cvt;
|
| + return file->cvt;
|
| }
|
|
|
| bool ots_cvt_serialise(OTSStream *out, OpenTypeFile *file) {
|
| const OpenTypeCVT *cvt = file->cvt;
|
|
|
| if (!out->Write(cvt->data, cvt->length)) {
|
| - return OTS_FAILURE();
|
| + return OTS_FAILURE_MSG("Failed to write CVT table");
|
| }
|
|
|
| return true;
|
| @@ -54,3 +56,5 @@ void ots_cvt_free(OpenTypeFile *file) {
|
| }
|
|
|
| } // namespace ots
|
| +
|
| +#undef TABLE_NAME
|
|
|