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

Side by Side Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 23592002: Fix issue when the family name is reused among multiple families. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | « no previous file | 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 1
2 /* 2 /*
3 * Copyright 2013 The Android Open Source Project 3 * Copyright 2013 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkFontConfigInterface.h" 9 #include "SkFontConfigInterface.h"
10 #include "SkTypeface_android.h" 10 #include "SkTypeface_android.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } else { 176 } else {
177 full->set(getenv("ANDROID_ROOT")); 177 full->set(getenv("ANDROID_ROOT"));
178 full->append(SK_FONT_FILE_PREFIX); 178 full->append(SK_FONT_FILE_PREFIX);
179 } 179 }
180 full->append(name); 180 full->append(name);
181 } 181 }
182 182
183 static void insert_into_name_dict(SkTDict<FamilyRecID>& familyNameDict, 183 static void insert_into_name_dict(SkTDict<FamilyRecID>& familyNameDict,
184 const char* name, FamilyRecID familyRecID) { 184 const char* name, FamilyRecID familyRecID) {
185 SkAutoAsciiToLC tolc(name); 185 SkAutoAsciiToLC tolc(name);
186 familyNameDict.set(tolc.lc(), familyRecID); 186 if (familyNameDict.find(tolc.lc())) {
reed1 2013/08/27 17:23:39 I think a block-comment here describing the actual
187 SkDebugf("---- system font attempting to use a the same name [%s] for"
188 "multiple families. skipping subsequent occurrences", tolc.lc() );
189 } else {
190 familyNameDict.set(tolc.lc(), familyRecID);
191 }
187 } 192 }
188 193
189 // Defined in SkFontHost_FreeType.cpp 194 // Defined in SkFontHost_FreeType.cpp
190 bool find_name_and_attributes(SkStream* stream, SkString* name, 195 bool find_name_and_attributes(SkStream* stream, SkString* name,
191 SkTypeface::Style* style, bool* isFixedWidth); 196 SkTypeface::Style* style, bool* isFixedWidth);
192 197
193 /////////////////////////////////////////////////////////////////////////////// 198 ///////////////////////////////////////////////////////////////////////////////
194 199
195 SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily* >& fontFamilies) : 200 SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily* >& fontFamilies) :
196 fFonts(fontFamilies.count()), 201 fFonts(fontFamilies.count()),
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 return SkCreateTypefaceForScriptNG(getHBScriptFromHBScriptOld(script), style , fontVariant); 816 return SkCreateTypefaceForScriptNG(getHBScriptFromHBScriptOld(script), style , fontVariant);
812 } 817 }
813 818
814 #endif 819 #endif
815 820
816 /////////////////////////////////////////////////////////////////////////////// 821 ///////////////////////////////////////////////////////////////////////////////
817 822
818 SkFontMgr* SkFontMgr::Factory() { 823 SkFontMgr* SkFontMgr::Factory() {
819 return NULL; 824 return NULL;
820 } 825 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698