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

Side by Side Diff: third_party/ots/src/vhea.cc

Issue 1487543005: Update OTS to revision 99a3b7f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « third_party/ots/src/post.cc ('k') | third_party/ots/src/vmtx.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "vhea.h" 5 #include "vhea.h"
6 6
7 #include "gsub.h"
8 #include "head.h" 7 #include "head.h"
9 #include "maxp.h" 8 #include "maxp.h"
10 9
11 // vhea - Vertical Header Table 10 // vhea - Vertical Header Table
12 // http://www.microsoft.com/typography/otspec/vhea.htm 11 // http://www.microsoft.com/typography/otspec/vhea.htm
13 12
14 #define TABLE_NAME "vhea" 13 #define TABLE_NAME "vhea"
15 14
16 namespace ots { 15 namespace ots {
17 16
(...skipping 12 matching lines...) Expand all
30 29
31 if (!ParseMetricsHeader(font, &table, &vhea->header)) { 30 if (!ParseMetricsHeader(font, &table, &vhea->header)) {
32 return OTS_FAILURE_MSG("Failed to parse metrics in vhea"); 31 return OTS_FAILURE_MSG("Failed to parse metrics in vhea");
33 } 32 }
34 33
35 return true; 34 return true;
36 } 35 }
37 36
38 bool ots_vhea_should_serialise(Font *font) { 37 bool ots_vhea_should_serialise(Font *font) {
39 // vhea should'nt serialise when vmtx doesn't exist. 38 // vhea should'nt serialise when vmtx doesn't exist.
40 // Firefox developer pointed out that vhea/vmtx should serialise iff GSUB is 39 return font->vhea != NULL && font->vmtx != NULL;
41 // preserved. See http://crbug.com/77386
42 return font->vhea != NULL && font->vmtx != NULL &&
43 ots_gsub_should_serialise(font);
44 } 40 }
45 41
46 bool ots_vhea_serialise(OTSStream *out, Font *font) { 42 bool ots_vhea_serialise(OTSStream *out, Font *font) {
47 if (!SerialiseMetricsHeader(font, out, &font->vhea->header)) { 43 if (!SerialiseMetricsHeader(font, out, &font->vhea->header)) {
48 return OTS_FAILURE_MSG("Failed to write vhea metrics"); 44 return OTS_FAILURE_MSG("Failed to write vhea metrics");
49 } 45 }
50 return true; 46 return true;
51 } 47 }
52 48
53 void ots_vhea_reuse(Font *font, Font *other) { 49 void ots_vhea_reuse(Font *font, Font *other) {
54 font->vhea = other->vhea; 50 font->vhea = other->vhea;
55 font->vhea_reused = true; 51 font->vhea_reused = true;
56 } 52 }
57 53
58 void ots_vhea_free(Font *font) { 54 void ots_vhea_free(Font *font) {
59 delete font->vhea; 55 delete font->vhea;
60 } 56 }
61 57
62 } // namespace ots 58 } // namespace ots
63 59
64 #undef TABLE_NAME 60 #undef TABLE_NAME
OLDNEW
« no previous file with comments | « third_party/ots/src/post.cc ('k') | third_party/ots/src/vmtx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698