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

Unified Diff: third_party/ots/src/hhea.cc

Issue 1252363005: Update OTS to revision a7a3b94 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « third_party/ots/src/head.cc ('k') | third_party/ots/src/hmtx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/hhea.cc
diff --git a/third_party/ots/src/hhea.cc b/third_party/ots/src/hhea.cc
index 8430442d8ef624c1ffc4dcb8512aac68fb05e99b..6242872802ae044a8574e993776de28c8ec960b2 100644
--- a/third_party/ots/src/hhea.cc
+++ b/third_party/ots/src/hhea.cc
@@ -14,10 +14,10 @@
namespace ots {
-bool ots_hhea_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_hhea_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeHHEA *hhea = new OpenTypeHHEA;
- file->hhea = hhea;
+ font->hhea = hhea;
if (!table.ReadU32(&hhea->header.version)) {
return OTS_FAILURE_MSG("Failed to read hhea version");
@@ -26,26 +26,31 @@ bool ots_hhea_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return OTS_FAILURE_MSG("Bad hhea version of %d", hhea->header.version);
}
- if (!ParseMetricsHeader(file, &table, &hhea->header)) {
+ if (!ParseMetricsHeader(font, &table, &hhea->header)) {
return OTS_FAILURE_MSG("Failed to parse horizontal metrics");
}
return true;
}
-bool ots_hhea_should_serialise(OpenTypeFile *file) {
- return file->hhea != NULL;
+bool ots_hhea_should_serialise(Font *font) {
+ return font->hhea != NULL;
}
-bool ots_hhea_serialise(OTSStream *out, OpenTypeFile *file) {
- if (!SerialiseMetricsHeader(file, out, &file->hhea->header)) {
+bool ots_hhea_serialise(OTSStream *out, Font *font) {
+ if (!SerialiseMetricsHeader(font, out, &font->hhea->header)) {
return OTS_FAILURE_MSG("Failed to serialise horizontal metrics");
}
return true;
}
-void ots_hhea_free(OpenTypeFile *file) {
- delete file->hhea;
+void ots_hhea_reuse(Font *font, Font *other) {
+ font->hhea = other->hhea;
+ font->hhea_reused = true;
+}
+
+void ots_hhea_free(Font *font) {
+ delete font->hhea;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/head.cc ('k') | third_party/ots/src/hmtx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698