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

Unified Diff: third_party/ots/src/vhea.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/vdmx.cc ('k') | third_party/ots/src/vmtx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/vhea.cc
diff --git a/third_party/ots/src/vhea.cc b/third_party/ots/src/vhea.cc
index c689a834f0c19e7465b9c1e8fd315f6bfd349480..fa898a8b5c528cebcf5d51638f2a8e71b23a64ed 100644
--- a/third_party/ots/src/vhea.cc
+++ b/third_party/ots/src/vhea.cc
@@ -15,10 +15,10 @@
namespace ots {
-bool ots_vhea_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_vhea_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeVHEA *vhea = new OpenTypeVHEA;
- file->vhea = vhea;
+ font->vhea = vhea;
if (!table.ReadU32(&vhea->header.version)) {
return OTS_FAILURE_MSG("Failed to read version");
@@ -28,30 +28,35 @@ bool ots_vhea_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return OTS_FAILURE_MSG("Bad vhea version %x", vhea->header.version);
}
- if (!ParseMetricsHeader(file, &table, &vhea->header)) {
+ if (!ParseMetricsHeader(font, &table, &vhea->header)) {
return OTS_FAILURE_MSG("Failed to parse metrics in vhea");
}
return true;
}
-bool ots_vhea_should_serialise(OpenTypeFile *file) {
+bool ots_vhea_should_serialise(Font *font) {
// vhea should'nt serialise when vmtx doesn't exist.
// Firefox developer pointed out that vhea/vmtx should serialise iff GSUB is
// preserved. See http://crbug.com/77386
- return file->vhea != NULL && file->vmtx != NULL &&
- ots_gsub_should_serialise(file);
+ return font->vhea != NULL && font->vmtx != NULL &&
+ ots_gsub_should_serialise(font);
}
-bool ots_vhea_serialise(OTSStream *out, OpenTypeFile *file) {
- if (!SerialiseMetricsHeader(file, out, &file->vhea->header)) {
+bool ots_vhea_serialise(OTSStream *out, Font *font) {
+ if (!SerialiseMetricsHeader(font, out, &font->vhea->header)) {
return OTS_FAILURE_MSG("Failed to write vhea metrics");
}
return true;
}
-void ots_vhea_free(OpenTypeFile *file) {
- delete file->vhea;
+void ots_vhea_reuse(Font *font, Font *other) {
+ font->vhea = other->vhea;
+ font->vhea_reused = true;
+}
+
+void ots_vhea_free(Font *font) {
+ delete font->vhea;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/vdmx.cc ('k') | third_party/ots/src/vmtx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698