Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: src/fpgm.cc

Issue 658573004: Updating to new OTS repo from https://github.com/khaledhosny/ots.git (Closed) Base URL: https://chromium.googlesource.com/external/ots@master
Patch Set: Adding Colored Emoji changes from external/git repo Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« .gitmodules ('K') | « src/cvt.cc ('k') | src/gasp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« .gitmodules ('K') | « src/cvt.cc ('k') | src/gasp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698