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

Side by Side Diff: src/name.cc

Issue 7976019: [OTS] Sort NameRecords in name table if they are not sorted. (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ots-common.gypi ('k') | no next file » | 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 "name.h" 5 #include "name.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "cff.h" 10 #include "cff.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } else if (rec.platform_id == 0 || rec.platform_id == 3) { 147 } else if (rec.platform_id == 0 || rec.platform_id == 3) {
148 if (file->cff && !file->cff->name.empty()) { 148 if (file->cff && !file->cff->name.empty()) {
149 AssignToUtf16BeFromAscii(&rec.text, file->cff->name); 149 AssignToUtf16BeFromAscii(&rec.text, file->cff->name);
150 } else if (!CheckPsNameUtf16Be(rec.text)) { 150 } else if (!CheckPsNameUtf16Be(rec.text)) {
151 continue; 151 continue;
152 } 152 }
153 } 153 }
154 } 154 }
155 155
156 if ((i > 0) && !(prev_record < rec)) { 156 if ((i > 0) && !(prev_record < rec)) {
157 OTS_FAILURE(); 157 OTS_WARNING("name records are not sorted.");
158 sort_required = true;
158 } 159 }
159 160
160 name->names.push_back(rec); 161 name->names.push_back(rec);
161 prev_record = rec; 162 prev_record = rec;
162 } 163 }
163 164
164 if (format == 1) { 165 if (format == 1) {
165 // extended name table format with language tags 166 // extended name table format with language tags
166 uint16_t lang_tag_count; 167 uint16_t lang_tag_count;
167 if (!table.ReadU16(&lang_tag_count)) { 168 if (!table.ReadU16(&lang_tag_count)) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 323 }
323 324
324 return true; 325 return true;
325 } 326 }
326 327
327 void ots_name_free(OpenTypeFile* file) { 328 void ots_name_free(OpenTypeFile* file) {
328 delete file->name; 329 delete file->name;
329 } 330 }
330 331
331 } // namespace 332 } // namespace
OLDNEW
« no previous file with comments | « ots-common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698