From 8349b7a063824dcbf3291d308aafd1dfbae3c76c Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Sat, 12 Dec 2015 00:10:10 -0500 Subject: [PATCH] Use 'index' instead of 'ttcIndex' for attribute name. There are two reasons for this. First, the name 'ttcIndex' is over specific, there are many indexed font containers in addition to ttc, such as fon, pfr, bdf, and dfont. There may be others in the future. Second, Skia implemented this attribute with the name 'index' quite some time ago. By naming this attribute 'index' even existing apps will be able to use this attribute (including Chrome). BUG: 10861108 Change-Id: I68d2b69fad304d93313f96bf3365af71906dfe69 --- data/fonts/fonts.xml | 8 ++++---- graphics/java/android/graphics/FontListParser.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/fonts/fonts.xml b/data/fonts/fonts.xml index 679a6a5b407db..554b6f1ba6c02 100644 --- a/data/fonts/fonts.xml +++ b/data/fonts/fonts.xml @@ -330,16 +330,16 @@ NotoSansSymbols-Regular-Subsetted.ttf - NotoSansCJK-Regular.ttc + NotoSansCJK-Regular.ttc - NotoSansCJK-Regular.ttc + NotoSansCJK-Regular.ttc - NotoSansCJK-Regular.ttc + NotoSansCJK-Regular.ttc - NotoSansCJK-Regular.ttc + NotoSansCJK-Regular.ttc NanumGothic.ttf diff --git a/graphics/java/android/graphics/FontListParser.java b/graphics/java/android/graphics/FontListParser.java index 2596f53cb9f43..774f6b8922e03 100644 --- a/graphics/java/android/graphics/FontListParser.java +++ b/graphics/java/android/graphics/FontListParser.java @@ -114,7 +114,7 @@ public class FontListParser { if (parser.getEventType() != XmlPullParser.START_TAG) continue; String tag = parser.getName(); if (tag.equals("font")) { - String ttcIndexStr = parser.getAttributeValue(null, "ttcIndex"); + String ttcIndexStr = parser.getAttributeValue(null, "index"); int ttcIndex = ttcIndexStr == null ? 0 : Integer.parseInt(ttcIndexStr); String weightStr = parser.getAttributeValue(null, "weight"); int weight = weightStr == null ? 400 : Integer.parseInt(weightStr);