OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. All Rights Reserved. | 2 * Copyright 2011 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 case NameId::kPreferredFamily: | 166 case NameId::kPreferredFamily: |
167 case NameId::kPreferredSubfamily: | 167 case NameId::kPreferredSubfamily: |
168 case NameId::kWWSFamilyName: | 168 case NameId::kWWSFamilyName: |
169 case NameId::kWWSSubfamilyName: { | 169 case NameId::kWWSSubfamilyName: { |
170 int32_t hash_code = HashCode(name_table->PlatformId(i), | 170 int32_t hash_code = HashCode(name_table->PlatformId(i), |
171 name_table->EncodingId(i), | 171 name_table->EncodingId(i), |
172 name_table->LanguageId(i), | 172 name_table->LanguageId(i), |
173 name_table->NameId(i)); | 173 name_table->NameId(i)); |
174 UChar* name_part = name_table->Name(i); | 174 UChar* name_part = name_table->Name(i); |
175 ConstructName(name_part, &(names[hash_code]), name_table->NameId(i)); | 175 ConstructName(name_part, &(names[hash_code]), name_table->NameId(i)); |
| 176 delete[] name_part; |
176 break; | 177 break; |
177 } | 178 } |
178 default: | 179 default: |
179 break; | 180 break; |
180 } | 181 } |
181 } | 182 } |
182 | 183 |
183 if (!names.empty()) { | 184 if (!names.empty()) { |
184 for (NameMap::iterator b = names.begin(), e = names.end(); b != e; ++b) { | 185 for (NameMap::iterator b = names.begin(), e = names.end(); b != e; ++b) { |
185 if (b->second.caseCompare(font_string, 0) == 0 || | 186 if (b->second.caseCompare(font_string, 0) == 0 || |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 TableBuilderPtr dereference; | 332 TableBuilderPtr dereference; |
332 dereference.Attach( | 333 dereference.Attach( |
333 font_builder->NewTableBuilder(i->first, i->second->ReadFontData())); | 334 font_builder->NewTableBuilder(i->first, i->second->ReadFontData())); |
334 } | 335 } |
335 } | 336 } |
336 | 337 |
337 return font_builder->Build(); | 338 return font_builder->Build(); |
338 } | 339 } |
339 | 340 |
340 } // namespace sfntly | 341 } // namespace sfntly |
OLD | NEW |