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
This commit is contained in:
@@ -330,16 +330,16 @@
|
||||
<font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted.ttf</font>
|
||||
</family>
|
||||
<family lang="zh-Hans">
|
||||
<font weight="400" style="normal" ttcIndex="2">NotoSansCJK-Regular.ttc</font>
|
||||
<font weight="400" style="normal" index="2">NotoSansCJK-Regular.ttc</font>
|
||||
</family>
|
||||
<family lang="zh-Hant">
|
||||
<font weight="400" style="normal" ttcIndex="3">NotoSansCJK-Regular.ttc</font>
|
||||
<font weight="400" style="normal" index="3">NotoSansCJK-Regular.ttc</font>
|
||||
</family>
|
||||
<family lang="ja">
|
||||
<font weight="400" style="normal" ttcIndex="0">NotoSansCJK-Regular.ttc</font>
|
||||
<font weight="400" style="normal" index="0">NotoSansCJK-Regular.ttc</font>
|
||||
</family>
|
||||
<family lang="ko">
|
||||
<font weight="400" style="normal" ttcIndex="1">NotoSansCJK-Regular.ttc</font>
|
||||
<font weight="400" style="normal" index="1">NotoSansCJK-Regular.ttc</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NanumGothic.ttf</font>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user