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