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

Unified Diff: src/prep.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/post.cc ('k') | src/vdmx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« .gitmodules ('K') | « src/post.cc ('k') | src/vdmx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698