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

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

Powered by Google App Engine
This is Rietveld 408576698