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

Unified Diff: src/hmtx.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/hhea.cc ('k') | src/kern.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hmtx.cc
diff --git a/src/hmtx.cc b/src/hmtx.cc
old mode 100644
new mode 100755
index ea7491d2e38c02fef239ad91941706c30368f4e1..ae86513196a86a33f30850d0a2bb2dc598968700
--- a/src/hmtx.cc
+++ b/src/hmtx.cc
@@ -8,7 +8,9 @@
#include "maxp.h"
// hmtx - Horizontal Metrics
-// http://www.microsoft.com/opentype/otspec/hmtx.htm
+// http://www.microsoft.com/typography/otspec/hmtx.htm
+
+#define TABLE_NAME "hmtx"
namespace ots {
@@ -18,12 +20,12 @@ bool ots_hmtx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
file->hmtx = hmtx;
if (!file->hhea || !file->maxp) {
- return OTS_FAILURE();
+ return OTS_FAILURE_MSG("Missing hhea or maxp tables in font, needed by hmtx");
}
- if (!ParseMetricsTable(&table, file->maxp->num_glyphs,
+ if (!ParseMetricsTable(file, &table, file->maxp->num_glyphs,
&file->hhea->header, &hmtx->metrics)) {
- return OTS_FAILURE();
+ return OTS_FAILURE_MSG("Failed to parse hmtx metrics");
}
return true;
@@ -34,8 +36,8 @@ bool ots_hmtx_should_serialise(OpenTypeFile *file) {
}
bool ots_hmtx_serialise(OTSStream *out, OpenTypeFile *file) {
- if (!SerialiseMetricsTable(out, &file->hmtx->metrics)) {
- return OTS_FAILURE();
+ if (!SerialiseMetricsTable(file, out, &file->hmtx->metrics)) {
+ return OTS_FAILURE_MSG("Failed to serialise htmx metrics");
}
return true;
}
@@ -45,3 +47,5 @@ void ots_hmtx_free(OpenTypeFile *file) {
}
} // namespace ots
+
+#undef TABLE_NAME
« .gitmodules ('K') | « src/hhea.cc ('k') | src/kern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698