diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 17:40:03 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 17:40:03 +0000 |
commit | 92e3f08c916cf8febb07d120afc63b8c33df1389 (patch) | |
tree | c6c6ade68c4d8d60c88fe24ce0055b4d072f53a3 | |
parent | 1c9518b09dd0e2f87c6d74e6deadc55c5528e0e4 (diff) |
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
-rw-r--r-- | src/ports/SkFontConfigInterface_android.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<FamilyRecID>& 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 |