| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |