From 92e3f08c916cf8febb07d120afc63b8c33df1389 Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Tue, 27 Aug 2013 17:40:03 +0000 Subject: [PATCH] Fix issue when the family name is reused among multiple families. BUG=chromium:274117 R=reed@google.com Review URL: https://codereview.chromium.org/23592002 git-svn-id: http://skia.googlecode.com/svn/trunk@10942 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/ports/SkFontConfigInterface_android.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp index e9886188b2..c9dc944f81 100644 --- a/src/ports/SkFontConfigInterface_android.cpp +++ b/src/ports/SkFontConfigInterface_android.cpp @@ -183,7 +183,12 @@ static void get_path_for_sys_fonts(SkString* full, const char name[]) { static void insert_into_name_dict(SkTDict& familyNameDict, const char* name, FamilyRecID familyRecID) { SkAutoAsciiToLC tolc(name); - familyNameDict.set(tolc.lc(), familyRecID); + if (familyNameDict.find(tolc.lc())) { + SkDebugf("---- system font attempting to use a the same name [%s] for" + "multiple families. skipping subsequent occurrences", tolc.lc()); + } else { + familyNameDict.set(tolc.lc(), familyRecID); + } } // Defined in SkFontHost_FreeType.cpp