Loading core/tests/coretests/res/font/samplexmlfont.xml +3 −6 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8" android:font="@font/samplefont" android:ttcIndex="0"/> <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'contrast' 0.5" android:font="@font/samplefont2" android:ttcIndex="1" /> <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0" android:font="@font/samplefont3" android:ttcIndex="2" /> <font android:fontStyle="normal" android:fontWeight="400" android:font="@font/samplefont" /> <font android:fontStyle="italic" android:fontWeight="400" android:font="@font/samplefont2" /> <font android:fontStyle="normal" android:fontWeight="800" android:font="@font/samplefont3" /> <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" /> </font-family> core/tests/coretests/res/font/samplexmlfontforparsing.xml 0 → 100644 +10 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8" android:font="@font/samplefont" android:ttcIndex="0" /> <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'cntr' 0.5" android:font="@font/samplefont2" android:ttcIndex="1" /> <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0" android:font="@font/samplefont3" android:ttcIndex="2" /> <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" /> </font-family> core/tests/coretests/src/android/content/res/FontResourcesParserTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class FontResourcesParserTest { @Test public void testParse() throws XmlPullParserException, IOException { XmlResourceParser parser = mResources.getXml(R.font.samplexmlfont); XmlResourceParser parser = mResources.getXml(R.font.samplexmlfontforparsing); FamilyResourceEntry result = FontResourcesParser.parse(parser, mResources); Loading @@ -76,7 +76,7 @@ public class FontResourcesParserTest { assertEquals(400, font2.getWeight()); assertEquals(1, font2.getItalic()); assertEquals(1, font2.getTtcIndex()); assertEquals("'contrast' 0.5", font2.getVariationSettings()); assertEquals("'cntr' 0.5", font2.getVariationSettings()); assertEquals("res/font/samplefont2.ttf", font2.getFileName()); FontFileResourceEntry font3 = fileEntries[2]; assertEquals(800, font3.getWeight()); Loading Loading
core/tests/coretests/res/font/samplexmlfont.xml +3 −6 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8" android:font="@font/samplefont" android:ttcIndex="0"/> <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'contrast' 0.5" android:font="@font/samplefont2" android:ttcIndex="1" /> <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0" android:font="@font/samplefont3" android:ttcIndex="2" /> <font android:fontStyle="normal" android:fontWeight="400" android:font="@font/samplefont" /> <font android:fontStyle="italic" android:fontWeight="400" android:font="@font/samplefont2" /> <font android:fontStyle="normal" android:fontWeight="800" android:font="@font/samplefont3" /> <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" /> </font-family>
core/tests/coretests/res/font/samplexmlfontforparsing.xml 0 → 100644 +10 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8" android:font="@font/samplefont" android:ttcIndex="0" /> <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'cntr' 0.5" android:font="@font/samplefont2" android:ttcIndex="1" /> <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0" android:font="@font/samplefont3" android:ttcIndex="2" /> <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" /> </font-family>
core/tests/coretests/src/android/content/res/FontResourcesParserTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class FontResourcesParserTest { @Test public void testParse() throws XmlPullParserException, IOException { XmlResourceParser parser = mResources.getXml(R.font.samplexmlfont); XmlResourceParser parser = mResources.getXml(R.font.samplexmlfontforparsing); FamilyResourceEntry result = FontResourcesParser.parse(parser, mResources); Loading @@ -76,7 +76,7 @@ public class FontResourcesParserTest { assertEquals(400, font2.getWeight()); assertEquals(1, font2.getItalic()); assertEquals(1, font2.getTtcIndex()); assertEquals("'contrast' 0.5", font2.getVariationSettings()); assertEquals("'cntr' 0.5", font2.getVariationSettings()); assertEquals("res/font/samplefont2.ttf", font2.getFileName()); FontFileResourceEntry font3 = fileEntries[2]; assertEquals(800, font3.getWeight()); Loading