From 4b4024b5ab3a40c6658ee9466b4208f4b07425c3 Mon Sep 17 00:00:00 2001 From: Seigo Nonaka <nona@google.com> Date: Mon, 2 Oct 2023 16:12:19 +0900 Subject: [PATCH] Use variable definition for variable font family Bug: 281769620 Test: Manually done Test: atest FontListParserTest TypefaceSystemFallbackTest Test: atest CtsGraphicsTestCases CtsTextTestCases Change-Id: Ice5a51024c7fbba2af7c5886c751e2508c3670d7 --- core/java/android/text/FontConfig.java | 24 +- .../android/graphics/FontListParserTest.java | 39 +- data/fonts/font_fallback.xml | 911 ++---------------- .../java/android/graphics/FontListParser.java | 41 +- .../android/graphics/fonts/FontFamily.java | 35 +- .../android/graphics/fonts/SystemFonts.java | 12 +- .../graphics/fonts/UpdatableFontDir.java | 5 +- .../graphics/fonts/UpdatableFontDirTest.java | 10 +- 8 files changed, 228 insertions(+), 849 deletions(-) diff --git a/core/java/android/text/FontConfig.java b/core/java/android/text/FontConfig.java index cb488b08456b..c5857347fd45 100644 --- a/core/java/android/text/FontConfig.java +++ b/core/java/android/text/FontConfig.java @@ -26,6 +26,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; +import android.graphics.fonts.FontFamily.Builder.VariableFontFamilyType; import android.graphics.fonts.FontStyle; import android.graphics.fonts.FontVariationAxis; import android.os.Build; @@ -528,6 +529,7 @@ public final class FontConfig implements Parcelable { private final @NonNull List<Font> mFonts; private final @NonNull LocaleList mLocaleList; private final @Variant int mVariant; + private final int mVariableFontFamilyType; /** @hide */ @Retention(SOURCE) @@ -567,10 +569,11 @@ public final class FontConfig implements Parcelable { * @hide Only system server can create this instance and passed via IPC. */ public FontFamily(@NonNull List<Font> fonts, @NonNull LocaleList localeList, - @Variant int variant) { + @Variant int variant, int variableFontFamilyType) { mFonts = fonts; mLocaleList = localeList; mVariant = variant; + mVariableFontFamilyType = variableFontFamilyType; } /** @@ -621,6 +624,20 @@ public final class FontConfig implements Parcelable { return mVariant; } + /** + * Returns the font family type. + * + * @see Builder#VARIABLE_FONT_FAMILY_TYPE_NONE + * @see Builder#VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ITAL + * @see Builder#VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ONLY + * @see Builder#VARIABLE_FONT_FAMILY_TYPE_TWO_FONTS_WGHT + * @hide + * @return variable font family type. + */ + public @VariableFontFamilyType int getVariableFontFamilyType() { + return mVariableFontFamilyType; + } + @Override public int describeContents() { return 0; @@ -631,6 +648,7 @@ public final class FontConfig implements Parcelable { dest.writeTypedList(mFonts, flags); dest.writeString8(mLocaleList.toLanguageTags()); dest.writeInt(mVariant); + dest.writeInt(mVariableFontFamilyType); } public static final @NonNull Creator<FontFamily> CREATOR = new Creator<FontFamily>() { @@ -641,8 +659,10 @@ public final class FontConfig implements Parcelable { source.readTypedList(fonts, Font.CREATOR); String langTags = source.readString8(); int variant = source.readInt(); + int varFamilyType = source.readInt(); - return new FontFamily(fonts, LocaleList.forLanguageTags(langTags), variant); + return new FontFamily(fonts, LocaleList.forLanguageTags(langTags), variant, + varFamilyType); } @Override diff --git a/core/tests/coretests/src/android/graphics/FontListParserTest.java b/core/tests/coretests/src/android/graphics/FontListParserTest.java index d46f7625b596..4dd5889fdf5d 100644 --- a/core/tests/coretests/src/android/graphics/FontListParserTest.java +++ b/core/tests/coretests/src/android/graphics/FontListParserTest.java @@ -28,6 +28,7 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.fail; import android.graphics.fonts.FontCustomizationParser; +import android.graphics.fonts.FontFamily; import android.graphics.fonts.FontStyle; import android.os.LocaleList; import android.text.FontConfig; @@ -64,7 +65,8 @@ public final class FontListParserTest { Collections.singletonList(new FontConfig.FontFamily( Arrays.asList(new FontConfig.Font(new File("test.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "", null)), - LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT)), "sans-serif"); + LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE)), "sans-serif"); FontConfig.NamedFamilyList family = readNamedFamily(xml); assertThat(family).isEqualTo(expected); } @@ -84,7 +86,8 @@ public final class FontListParserTest { new FontConfig.Font(new File("test.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "", "serif")), - LocaleList.forLanguageTags("en"), VARIANT_DEFAULT); + LocaleList.forLanguageTags("en"), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); FontConfig.FontFamily family = readFamily(xml); assertThat(family).isEqualTo(expected); @@ -101,7 +104,8 @@ public final class FontListParserTest { new FontConfig.Font(new File("test.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "", null)), - LocaleList.forLanguageTags("en"), VARIANT_COMPACT); + LocaleList.forLanguageTags("en"), VARIANT_COMPACT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); FontConfig.FontFamily family = readFamily(xml); assertThat(family).isEqualTo(expected); @@ -118,7 +122,8 @@ public final class FontListParserTest { new FontConfig.Font(new File("test.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "", null)), - LocaleList.forLanguageTags("en"), VARIANT_ELEGANT); + LocaleList.forLanguageTags("en"), VARIANT_ELEGANT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); FontConfig.FontFamily family = readFamily(xml); assertThat(family).isEqualTo(expected); @@ -140,7 +145,8 @@ public final class FontListParserTest { new FontStyle(100, FONT_SLANT_UPRIGHT), 0, "", null), new FontConfig.Font(new File("italic.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_ITALIC), 0, "", null)), - LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT)), "sans-serif"); + LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE)), "sans-serif"); FontConfig.NamedFamilyList family = readNamedFamily(xml); assertThat(family).isEqualTo(expected); } @@ -166,7 +172,8 @@ public final class FontListParserTest { new FontConfig.Font(new File("test-VF.ttf"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "'wdth' 400.0,'wght' 700.0", null)), - LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT)), + LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE)), "sans-serif"); FontConfig.NamedFamilyList family = readNamedFamily(xml); assertThat(family).isEqualTo(expected); @@ -187,7 +194,8 @@ public final class FontListParserTest { new FontConfig.Font(new File("test.ttc"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 1, "", null)), - LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT)), + LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE)), "sans-serif"); FontConfig.NamedFamilyList family = readNamedFamily(xml); assertThat(family).isEqualTo(expected); @@ -206,7 +214,8 @@ public final class FontListParserTest { new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 0, "", null), new FontConfig.Font(new File("test.ttc"), null, "test", new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), 1, "", null)), - LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT)), "sans-serif"); + LocaleList.getEmptyLocaleList(), VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE)), "sans-serif"); FontConfig.NamedFamilyList family = readNamedFamily(xml); assertThat(family).isEqualTo(expected); } @@ -372,6 +381,20 @@ public final class FontListParserTest { .isEqualTo("emoji.ttf"); } + @Test + public void varFamilyType() throws Exception { + String xml = "<?xml version='1.0' encoding='UTF-8'?>" + + "<familyset>" + + " <family name='sans-serif' varFamilyType='1'>" + + " <font>test.ttf</font>" + + " </family>" + + "</familyset>"; + FontConfig config = readFamilies(xml, true /* include non-existing font files */); + List<FontConfig.FontFamily> families = config.getFontFamilies(); + assertThat(families.size()).isEqualTo(1); // legacy one should be ignored. + assertThat(families.get(0).getVariableFontFamilyType()).isEqualTo(1); + } + private FontConfig readFamilies(String xml, boolean allowNonExisting) throws IOException, XmlPullParserException { ByteArrayInputStream buffer = new ByteArrayInputStream( diff --git a/data/fonts/font_fallback.xml b/data/fonts/font_fallback.xml index 1e97fcee250d..02e032b86443 100644 --- a/data/fonts/font_fallback.xml +++ b/data/fonts/font_fallback.xml @@ -15,96 +15,9 @@ --> <familyset version="23"> <!-- first font is default --> - <family name="sans-serif"> - <font weight="100" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> + <family name="sans-serif" varFamilyType="2"> + <font>Roboto-Regular.ttf <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="900" /> - </font> - <font weight="100" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="900" /> </font> </family> @@ -119,96 +32,9 @@ <alias name="tahoma" to="sans-serif" /> <alias name="verdana" to="sans-serif" /> - <family name="sans-serif-condensed"> - <font weight="100" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="normal">Roboto-Regular.ttf - <axis tag="ital" stylevalue="0" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="900" /> - </font> - <font weight="100" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> - <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="italic">Roboto-Regular.ttf - <axis tag="ital" stylevalue="1" /> + <family name="sans-serif-condensed" varFamilyType="2"> + <font>Roboto-Regular.ttf <axis tag="wdth" stylevalue="75" /> - <axis tag="wght" stylevalue="900" /> </font> </family> <alias name="sans-serif-condensed-light" to="sans-serif-condensed" weight="300" /> @@ -246,13 +72,8 @@ <font weight="400" style="normal" postScriptName="ComingSoon-Regular">ComingSoon.ttf</font> </family> - <family name="cursive"> - <font weight="400" style="normal">DancingScript-Regular.ttf - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="700" style="normal">DancingScript-Regular.ttf - <axis tag="wght" stylevalue="700" /> - </font> + <family name="cursive" varFamilyType="1"> + <font>DancingScript-Regular.ttf</font> </family> <family name="sans-serif-smallcaps"> @@ -269,96 +90,9 @@ </family> <alias name="source-sans-pro-semi-bold" to="source-sans-pro" weight="600"/> - <family name="roboto-flex"> - <font weight="100" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="normal">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="0" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="900" /> - </font> - <font weight="100" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="100" /> - </font> - <font weight="200" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="200" /> - </font> - <font weight="300" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> + <family name="roboto-flex" varFamilyType="2"> + <font>RobotoFlex-Regular.ttf <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="300" /> - </font> - <font weight="400" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="400" /> - </font> - <font weight="500" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="500" /> - </font> - <font weight="600" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="600" /> - </font> - <font weight="700" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="700" /> - </font> - <font weight="800" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="800" /> - </font> - <font weight="900" style="italic">RobotoFlex-Regular.ttf - <axis tag="slnt" stylevalue="-10" /> - <axis tag="wdth" stylevalue="100" /> - <axis tag="wght" stylevalue="900" /> </font> </family> @@ -375,38 +109,12 @@ </font> <font weight="700" style="normal">NotoNaskhArabicUI-Bold.ttf</font> </family> - <family lang="und-Ethi"> - <font weight="400" style="normal" postScriptName="NotoSansEthiopic-Regular"> - NotoSansEthiopic-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansEthiopic-Regular"> + <family lang="und-Ethi" varFamilyType="1"> + <font postScriptName="NotoSansEthiopic-Regular"> NotoSansEthiopic-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansEthiopic-Regular"> - NotoSansEthiopic-VF.ttf - <axis tag="wght" stylevalue="600"/> </font> - <font weight="700" style="normal" postScriptName="NotoSansEthiopic-Regular"> - NotoSansEthiopic-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifEthiopic-Regular">NotoSerifEthiopic-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifEthiopic-Regular">NotoSerifEthiopic-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifEthiopic-Regular">NotoSerifEthiopic-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifEthiopic-Regular">NotoSerifEthiopic-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifEthiopic-Regular"> + NotoSerifEthiopic-VF.ttf </font> </family> <family lang="und-Hebr"> @@ -432,124 +140,33 @@ </font> <font weight="700" style="normal">NotoSansThaiUI-Bold.ttf</font> </family> - <family lang="und-Armn"> - <font weight="400" style="normal" postScriptName="NotoSansArmenian-Regular"> - NotoSansArmenian-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansArmenian-Regular"> - NotoSansArmenian-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansArmenian-Regular"> - NotoSansArmenian-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansArmenian-Regular"> + <family lang="und-Armn" varFamilyType="1"> + <font postScriptName="NotoSansArmenian-Regular"> NotoSansArmenian-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifArmenian-Regular">NotoSerifArmenian-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifArmenian-Regular">NotoSerifArmenian-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifArmenian-Regular">NotoSerifArmenian-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifArmenian-Regular">NotoSerifArmenian-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifArmenian-Regular"> + NotoSerifArmenian-VF.ttf </font> </family> - <family lang="und-Geor,und-Geok"> - <font weight="400" style="normal" postScriptName="NotoSansGeorgian-Regular"> + <family lang="und-Geor,und-Geok" varFamilyType="1"> + <font postScriptName="NotoSansGeorgian-Regular"> NotoSansGeorgian-VF.ttf - <axis tag="wght" stylevalue="400"/> </font> - <font weight="500" style="normal" postScriptName="NotoSansGeorgian-Regular"> - NotoSansGeorgian-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansGeorgian-Regular"> - NotoSansGeorgian-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansGeorgian-Regular"> - NotoSansGeorgian-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGeorgian-Regular">NotoSerifGeorgian-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGeorgian-Regular">NotoSerifGeorgian-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGeorgian-Regular">NotoSerifGeorgian-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGeorgian-Regular">NotoSerifGeorgian-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifGeorgian-Regular"> + NotoSerifGeorgian-VF.ttf </font> </family> - <family lang="und-Deva" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansDevanagari-Regular"> - NotoSansDevanagari-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansDevanagari-Regular"> - NotoSansDevanagari-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansDevanagari-Regular"> + <family lang="und-Deva" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansDevanagari-Regular"> NotoSansDevanagari-VF.ttf - <axis tag="wght" stylevalue="600"/> </font> - <font weight="700" style="normal" postScriptName="NotoSansDevanagari-Regular"> - NotoSansDevanagari-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifDevanagari-Regular">NotoSerifDevanagari-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifDevanagari-Regular">NotoSerifDevanagari-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifDevanagari-Regular">NotoSerifDevanagari-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifDevanagari-Regular">NotoSerifDevanagari-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifDevanagari-Regular"> + NotoSerifDevanagari-VF.ttf </font> </family> - <family lang="und-Deva" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansDevanagariUI-Regular"> - NotoSansDevanagariUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansDevanagariUI-Regular"> + <family lang="und-Deva" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansDevanagariUI-Regular"> NotoSansDevanagariUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansDevanagariUI-Regular"> - NotoSansDevanagariUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansDevanagariUI-Regular"> - NotoSansDevanagariUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> @@ -584,316 +201,82 @@ </font> <font weight="700" style="normal">NotoSansGujaratiUI-Bold.ttf</font> </family> - <family lang="und-Guru" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansGurmukhi-Regular"> + <family lang="und-Guru" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansGurmukhi-Regular"> NotoSansGurmukhi-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansGurmukhi-Regular"> - NotoSansGurmukhi-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansGurmukhi-Regular"> - NotoSansGurmukhi-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansGurmukhi-Regular"> - NotoSansGurmukhi-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGurmukhi-Regular">NotoSerifGurmukhi-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGurmukhi-Regular">NotoSerifGurmukhi-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGurmukhi-Regular">NotoSerifGurmukhi-VF.ttf - <axis tag="wght" stylevalue="600"/> </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifGurmukhi-Regular">NotoSerifGurmukhi-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifGurmukhi-Regular"> + NotoSerifGurmukhi-VF.ttf </font> </family> - <family lang="und-Guru" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansGurmukhiUI-Regular"> - NotoSansGurmukhiUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansGurmukhiUI-Regular"> - NotoSansGurmukhiUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansGurmukhiUI-Regular"> - NotoSansGurmukhiUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansGurmukhiUI-Regular"> + <family lang="und-Guru" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansGurmukhiUI-Regular"> NotoSansGurmukhiUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Taml" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansTamil-Regular"> - NotoSansTamil-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansTamil-Regular"> + <family lang="und-Taml" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansTamil-Regular"> NotoSansTamil-VF.ttf - <axis tag="wght" stylevalue="500"/> </font> - <font weight="600" style="normal" postScriptName="NotoSansTamil-Regular"> - NotoSansTamil-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansTamil-Regular"> - NotoSansTamil-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTamil-Regular">NotoSerifTamil-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTamil-Regular">NotoSerifTamil-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTamil-Regular">NotoSerifTamil-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTamil-Regular">NotoSerifTamil-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifTamil-Regular"> + NotoSerifTamil-VF.ttf </font> </family> - <family lang="und-Taml" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansTamilUI-Regular"> - NotoSansTamilUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansTamilUI-Regular"> - NotoSansTamilUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansTamilUI-Regular"> + <family lang="und-Taml" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansTamilUI-Regular"> NotoSansTamilUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansTamilUI-Regular"> - NotoSansTamilUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Mlym" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansMalayalam-Regular"> - NotoSansMalayalam-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansMalayalam-Regular"> + <family lang="und-Mlym" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansMalayalam-Regular"> NotoSansMalayalam-VF.ttf - <axis tag="wght" stylevalue="500"/> </font> - <font weight="600" style="normal" postScriptName="NotoSansMalayalam-Regular"> - NotoSansMalayalam-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansMalayalam-Regular"> - NotoSansMalayalam-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifMalayalam-Regular">NotoSerifMalayalam-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifMalayalam-Regular">NotoSerifMalayalam-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifMalayalam-Regular">NotoSerifMalayalam-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifMalayalam-Regular">NotoSerifMalayalam-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifMalayalam-Regular"> + NotoSerifMalayalam-VF.ttf </font> </family> - <family lang="und-Mlym" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansMalayalamUI-Regular"> - NotoSansMalayalamUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansMalayalamUI-Regular"> - NotoSansMalayalamUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansMalayalamUI-Regular"> - NotoSansMalayalamUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansMalayalamUI-Regular"> + <family lang="und-Mlym" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansMalayalamUI-Regular"> NotoSansMalayalamUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Beng" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansBengali-Regular"> - NotoSansBengali-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansBengali-Regular"> + <family lang="und-Beng" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansBengali-Regular"> NotoSansBengali-VF.ttf - <axis tag="wght" stylevalue="500"/> </font> - <font weight="600" style="normal" postScriptName="NotoSansBengali-Regular"> - NotoSansBengali-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansBengali-Regular"> - NotoSansBengali-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifBengali-Regular">NotoSerifBengali-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifBengali-Regular">NotoSerifBengali-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifBengali-Regular">NotoSerifBengali-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifBengali-Regular">NotoSerifBengali-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifBengali-Regular"> + NotoSerifBengali-VF.ttf </font> </family> - <family lang="und-Beng" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansBengaliUI-Regular"> - NotoSansBengaliUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansBengaliUI-Regular"> - NotoSansBengaliUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansBengaliUI-Regular"> - NotoSansBengaliUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansBengaliUI-Regular"> + <family lang="und-Beng" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansBengaliUI-Regular"> NotoSansBengaliUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Telu" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansTelugu-Regular"> - NotoSansTelugu-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansTelugu-Regular"> + <family lang="und-Telu" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansTelugu-Regular"> NotoSansTelugu-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansTelugu-Regular"> - NotoSansTelugu-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansTelugu-Regular"> - NotoSansTelugu-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTelugu-Regular">NotoSerifTelugu-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTelugu-Regular">NotoSerifTelugu-VF.ttf - <axis tag="wght" stylevalue="500"/> </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTelugu-Regular">NotoSerifTelugu-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifTelugu-Regular">NotoSerifTelugu-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifTelugu-Regular"> + NotoSerifTelugu-VF.ttf </font> </family> - <family lang="und-Telu" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansTeluguUI-Regular"> - NotoSansTeluguUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansTeluguUI-Regular"> - NotoSansTeluguUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansTeluguUI-Regular"> + <family lang="und-Telu" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansTeluguUI-Regular"> NotoSansTeluguUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansTeluguUI-Regular"> - NotoSansTeluguUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Knda" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansKannada-Regular"> + <family lang="und-Knda" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansKannada-Regular"> NotoSansKannada-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansKannada-Regular"> - NotoSansKannada-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansKannada-Regular"> - NotoSansKannada-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansKannada-Regular"> - NotoSansKannada-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifKannada-Regular">NotoSerifKannada-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifKannada-Regular">NotoSerifKannada-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifKannada-Regular">NotoSerifKannada-VF.ttf - <axis tag="wght" stylevalue="600"/> </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifKannada-Regular">NotoSerifKannada-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifKannada-Regular"> + NotoSerifKannada-VF.ttf </font> </family> - <family lang="und-Knda" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansKannadaUI-Regular"> - NotoSansKannadaUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansKannadaUI-Regular"> + <family lang="und-Knda" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansKannadaUI-Regular"> NotoSansKannadaUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansKannadaUI-Regular"> - NotoSansKannadaUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansKannadaUI-Regular"> - NotoSansKannadaUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> <family lang="und-Orya" variant="elegant"> @@ -907,56 +290,17 @@ </font> <font weight="700" style="normal">NotoSansOriyaUI-Bold.ttf</font> </family> - <family lang="und-Sinh" variant="elegant"> - <font weight="400" style="normal" postScriptName="NotoSansSinhala-Regular"> + <family lang="und-Sinh" variant="elegant" varFamilyType="1"> + <font postScriptName="NotoSansSinhala-Regular"> NotoSansSinhala-VF.ttf - <axis tag="wght" stylevalue="400"/> </font> - <font weight="500" style="normal" postScriptName="NotoSansSinhala-Regular"> - NotoSansSinhala-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansSinhala-Regular"> - NotoSansSinhala-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansSinhala-Regular"> - NotoSansSinhala-VF.ttf - <axis tag="wght" stylevalue="700"/> - </font> - <font weight="400" style="normal" fallbackFor="serif" - postScriptName="NotoSerifSinhala-Regular">NotoSerifSinhala-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" fallbackFor="serif" - postScriptName="NotoSerifSinhala-Regular">NotoSerifSinhala-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" fallbackFor="serif" - postScriptName="NotoSerifSinhala-Regular">NotoSerifSinhala-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" fallbackFor="serif" - postScriptName="NotoSerifSinhala-Regular">NotoSerifSinhala-VF.ttf - <axis tag="wght" stylevalue="700"/> + <font fallbackFor="serif" postScriptName="NotoSerifSinhala-Regular"> + NotoSerifSinhala-VF.ttf </font> </family> - <family lang="und-Sinh" variant="compact"> - <font weight="400" style="normal" postScriptName="NotoSansSinhalaUI-Regular"> - NotoSansSinhalaUI-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansSinhalaUI-Regular"> - NotoSansSinhalaUI-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansSinhalaUI-Regular"> - NotoSansSinhalaUI-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansSinhalaUI-Regular"> + <family lang="und-Sinh" variant="compact" varFamilyType="1"> + <font postScriptName="NotoSansSinhalaUI-Regular"> NotoSansSinhalaUI-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> <family lang="und-Khmr" variant="elegant"> @@ -1054,22 +398,9 @@ <family lang="und-Ahom"> <font weight="400" style="normal">NotoSansAhom-Regular.otf</font> </family> - <family lang="und-Adlm"> - <font weight="400" style="normal" postScriptName="NotoSansAdlam-Regular"> - NotoSansAdlam-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansAdlam-Regular"> + <family lang="und-Adlm" varFamilyType="1"> + <font postScriptName="NotoSansAdlam-Regular"> NotoSansAdlam-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansAdlam-Regular"> - NotoSansAdlam-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansAdlam-Regular"> - NotoSansAdlam-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> <family lang="und-Avst"> @@ -1355,22 +686,9 @@ NotoSansTaiViet-Regular.ttf </font> </family> - <family lang="und-Tibt"> - <font weight="400" style="normal" postScriptName="NotoSerifTibetan-Regular"> + <family lang="und-Tibt" varFamilyType="1"> + <font postScriptName="NotoSerifTibetan-Regular"> NotoSerifTibetan-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSerifTibetan-Regular"> - NotoSerifTibetan-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSerifTibetan-Regular"> - NotoSerifTibetan-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSerifTibetan-Regular"> - NotoSerifTibetan-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> <family lang="und-Tfng"> @@ -1537,94 +855,29 @@ <family lang="und-Dogr"> <font weight="400" style="normal">NotoSerifDogra-Regular.ttf</font> </family> - <family lang="und-Medf"> - <font weight="400" style="normal" postScriptName="NotoSansMedefaidrin-Regular"> - NotoSansMedefaidrin-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansMedefaidrin-Regular"> - NotoSansMedefaidrin-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansMedefaidrin-Regular"> - NotoSansMedefaidrin-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansMedefaidrin-Regular"> + <family lang="und-Medf" varFamilyType="1"> + <font postScriptName="NotoSansMedefaidrin-Regular"> NotoSansMedefaidrin-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Soyo"> - <font weight="400" style="normal" postScriptName="NotoSansSoyombo-Regular"> - NotoSansSoyombo-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansSoyombo-Regular"> + <family lang="und-Soyo" varFamilyType="1"> + <font postScriptName="NotoSansSoyombo-Regular"> NotoSansSoyombo-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansSoyombo-Regular"> - NotoSansSoyombo-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansSoyombo-Regular"> - NotoSansSoyombo-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Takr"> - <font weight="400" style="normal" postScriptName="NotoSansTakri-Regular"> + <family lang="und-Takr" varFamilyType="1"> + <font postScriptName="NotoSansTakri-Regular"> NotoSansTakri-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSansTakri-Regular"> - NotoSansTakri-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSansTakri-Regular"> - NotoSansTakri-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSansTakri-Regular"> - NotoSansTakri-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Hmnp"> - <font weight="400" style="normal" postScriptName="NotoSerifHmongNyiakeng-Regular"> - NotoSerifNyiakengPuachueHmong-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSerifHmongNyiakeng-Regular"> - NotoSerifNyiakengPuachueHmong-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSerifHmongNyiakeng-Regular"> - NotoSerifNyiakengPuachueHmong-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSerifHmongNyiakeng-Regular"> + <family lang="und-Hmnp" varFamilyType="1"> + <font postScriptName="NotoSerifHmongNyiakeng-Regular"> NotoSerifNyiakengPuachueHmong-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> - <family lang="und-Yezi"> - <font weight="400" style="normal" postScriptName="NotoSerifYezidi-Regular"> - NotoSerifYezidi-VF.ttf - <axis tag="wght" stylevalue="400"/> - </font> - <font weight="500" style="normal" postScriptName="NotoSerifYezidi-Regular"> + <family lang="und-Yezi" varFamilyType="1"> + <font postScriptName="NotoSerifYezidi-Regular"> NotoSerifYezidi-VF.ttf - <axis tag="wght" stylevalue="500"/> - </font> - <font weight="600" style="normal" postScriptName="NotoSerifYezidi-Regular"> - NotoSerifYezidi-VF.ttf - <axis tag="wght" stylevalue="600"/> - </font> - <font weight="700" style="normal" postScriptName="NotoSerifYezidi-Regular"> - NotoSerifYezidi-VF.ttf - <axis tag="wght" stylevalue="700"/> </font> </family> </familyset> diff --git a/graphics/java/android/graphics/FontListParser.java b/graphics/java/android/graphics/FontListParser.java index 674246acafef..735bc180c015 100644 --- a/graphics/java/android/graphics/FontListParser.java +++ b/graphics/java/android/graphics/FontListParser.java @@ -16,6 +16,10 @@ package android.graphics; +import static android.graphics.fonts.FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE; +import static android.graphics.fonts.FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ITAL; +import static android.graphics.fonts.FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ONLY; +import static android.graphics.fonts.FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_TWO_FONTS_WGHT; import static android.text.FontConfig.NamedFamilyList; import android.annotation.NonNull; @@ -28,6 +32,7 @@ import android.os.Build; import android.os.LocaleList; import android.text.FontConfig; import android.util.ArraySet; +import android.util.Log; import android.util.Xml; import org.xmlpull.v1.XmlPullParser; @@ -256,6 +261,7 @@ public class FontListParser { final String lang = parser.getAttributeValue("", "lang"); final String variant = parser.getAttributeValue(null, "variant"); final String ignore = parser.getAttributeValue(null, "ignore"); + final String varFamilyTypeStr = parser.getAttributeValue(null, "varFamilyType"); final List<FontConfig.Font> fonts = new ArrayList<>(); while (keepReading(parser)) { if (parser.getEventType() != XmlPullParser.START_TAG) continue; @@ -278,12 +284,45 @@ public class FontListParser { intVariant = FontConfig.FontFamily.VARIANT_ELEGANT; } } + int varFamilyType = VARIABLE_FONT_FAMILY_TYPE_NONE; + if (varFamilyTypeStr != null) { + varFamilyType = Integer.parseInt(varFamilyTypeStr); + if (varFamilyType <= -1 || varFamilyType > 3) { + Log.e(TAG, "Error: unexpected varFamilyType value: " + varFamilyTypeStr); + varFamilyType = VARIABLE_FONT_FAMILY_TYPE_NONE; + } + + // validation but don't read font content for performance reasons. + switch (varFamilyType) { + case VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ONLY: + if (fonts.size() != 1) { + Log.e(TAG, "Error: Single font support wght axis, but two or more fonts are" + + " included in the font family."); + varFamilyType = VARIABLE_FONT_FAMILY_TYPE_NONE; + } + break; + case VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ITAL: + if (fonts.size() != 1) { + Log.e(TAG, "Error: Single font support both ital and wght axes, but two or" + + " more fonts are included in the font family."); + varFamilyType = VARIABLE_FONT_FAMILY_TYPE_NONE; + } + break; + case VARIABLE_FONT_FAMILY_TYPE_TWO_FONTS_WGHT: + if (fonts.size() != 2) { + Log.e(TAG, "Error: two fonts that support wght axis, but one or three or" + + " more fonts are included in the font family."); + varFamilyType = VARIABLE_FONT_FAMILY_TYPE_NONE; + } + } + } boolean skip = (ignore != null && (ignore.equals("true") || ignore.equals("1"))); if (skip || fonts.isEmpty()) { return null; } - return new FontConfig.FontFamily(fonts, LocaleList.forLanguageTags(lang), intVariant); + return new FontConfig.FontFamily(fonts, LocaleList.forLanguageTags(lang), intVariant, + varFamilyType); } private static void throwIfAttributeExists(String attrName, XmlPullParser parser) { diff --git a/graphics/java/android/graphics/fonts/FontFamily.java b/graphics/java/android/graphics/fonts/FontFamily.java index 5e4110590325..4c753565eb5b 100644 --- a/graphics/java/android/graphics/fonts/FontFamily.java +++ b/graphics/java/android/graphics/fonts/FontFamily.java @@ -18,7 +18,10 @@ package android.graphics.fonts; import static com.android.text.flags.Flags.FLAG_DEPRECATE_FONTS_XML; +import static java.lang.annotation.RetentionPolicy.SOURCE; + import android.annotation.FlaggedApi; +import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; @@ -32,6 +35,7 @@ import dalvik.annotation.optimization.FastNative; import libcore.util.NativeAllocationRegistry; +import java.lang.annotation.Retention; import java.util.ArrayList; import java.util.Set; @@ -184,32 +188,59 @@ public final class FontFamily { } /** + * A special variable font family type that indicates `analyzeAndResolveVariableType` could + * not be identified the variable font family type. + * * @see #buildVariableFamily() * @hide */ public static final int VARIABLE_FONT_FAMILY_TYPE_UNKNOWN = -1; /** + * A variable font family type that indicates no variable font family can be used. + * + * The font family is used as bundle of static fonts. * @see #buildVariableFamily() * @hide */ public static final int VARIABLE_FONT_FAMILY_TYPE_NONE = 0; /** + * A variable font family type that indicates single font file can be used for multiple + * weight. For the italic style, fake italic may be applied. + * * @see #buildVariableFamily() * @hide */ public static final int VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ONLY = 1; /** + * A variable font family type that indicates single font file can be used for multiple + * weight and italic. + * * @see #buildVariableFamily() * @hide */ public static final int VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ITAL = 2; /** + * A variable font family type that indicates two font files are included in the family: + * one can be used for upright with various weights, the other one can be used for italic + * with various weights. + * * @see #buildVariableFamily() * @hide */ public static final int VARIABLE_FONT_FAMILY_TYPE_TWO_FONTS_WGHT = 3; + /** @hide */ + @Retention(SOURCE) + @IntDef(prefix = { "VARIABLE_FONT_FAMILY_TYPE_" }, value = { + VARIABLE_FONT_FAMILY_TYPE_UNKNOWN, + VARIABLE_FONT_FAMILY_TYPE_NONE, + VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ONLY, + VARIABLE_FONT_FAMILY_TYPE_SINGLE_FONT_WGHT_ITAL, + VARIABLE_FONT_FAMILY_TYPE_TWO_FONTS_WGHT + }) + public @interface VariableFontFamilyType {} + /** * The registered italic axis used for adjusting requested style. * https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_ital @@ -222,7 +253,9 @@ public final class FontFamily { */ private static final int TAG_wght = 0x77676874; // w(0x77), g(0x67), h(0x68), t(0x74) - private static int analyzeAndResolveVariableType(ArrayList<Font> fonts) { + /** @hide */ + public static @VariableFontFamilyType int analyzeAndResolveVariableType( + ArrayList<Font> fonts) { if (fonts.size() > 2) { return VARIABLE_FONT_FAMILY_TYPE_UNKNOWN; } diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java index 9810022abfed..d4e35b30c8d0 100644 --- a/graphics/java/android/graphics/fonts/SystemFonts.java +++ b/graphics/java/android/graphics/fonts/SystemFonts.java @@ -121,7 +121,8 @@ public final class SystemFonts { final FontFamily defaultFamily = defaultFonts.isEmpty() ? null : createFontFamily( - defaultFonts, languageTags, variant, false, cache); + defaultFonts, languageTags, variant, xmlFamily.getVariableFontFamilyType(), false, + cache); // Insert family into fallback map. for (int i = 0; i < fallbackMap.size(); i++) { final String name = fallbackMap.keyAt(i); @@ -138,8 +139,8 @@ public final class SystemFonts { familyListSet.familyList.add(defaultFamily); } } else { - final FontFamily family = createFontFamily(fallback, languageTags, variant, false, - cache); + final FontFamily family = createFontFamily(fallback, languageTags, variant, + xmlFamily.getVariableFontFamilyType(), false, cache); if (family != null) { familyListSet.familyList.add(family); } else if (defaultFamily != null) { @@ -155,6 +156,7 @@ public final class SystemFonts { @NonNull List<FontConfig.Font> fonts, @NonNull String languageTags, @FontConfig.FontFamily.Variant int variant, + int varFamilyType, boolean isDefaultFallback, @NonNull Map<String, ByteBuffer> cache) { if (fonts.size() == 0) { @@ -196,7 +198,7 @@ public final class SystemFonts { } } return b == null ? null : b.build(languageTags, variant, false /* isCustomFallback */, - isDefaultFallback, FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); + isDefaultFallback, varFamilyType); } private static void appendNamedFamilyList(@NonNull FontConfig.NamedFamilyList namedFamilyList, @@ -210,6 +212,7 @@ public final class SystemFonts { final FontFamily family = createFontFamily( xmlFamily.getFontList(), xmlFamily.getLocaleList().toLanguageTags(), xmlFamily.getVariant(), + xmlFamily.getVariableFontFamilyType(), true, // named family is always default bufferCache); if (family == null) { @@ -291,6 +294,7 @@ public final class SystemFonts { int configVersion ) { try { + Log.i(TAG, "Loading font config from " + fontsXml); return FontListParser.parse(fontsXml, systemFontDir, oemXml, productFontDir, updatableFontMap, lastModifiedDate, configVersion); } catch (IOException e) { diff --git a/services/core/java/com/android/server/graphics/fonts/UpdatableFontDir.java b/services/core/java/com/android/server/graphics/fonts/UpdatableFontDir.java index a680f5001479..cd3d2f031455 100644 --- a/services/core/java/com/android/server/graphics/fonts/UpdatableFontDir.java +++ b/services/core/java/com/android/server/graphics/fonts/UpdatableFontDir.java @@ -16,6 +16,8 @@ package com.android.server.graphics.fonts; +import static android.graphics.fonts.FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE; + import static com.android.server.graphics.fonts.FontManagerService.SystemFontException; import android.annotation.NonNull; @@ -581,7 +583,8 @@ final class UpdatableFontDir { font.getFontStyle(), font.getIndex(), font.getFontVariationSettings(), null)); } FontConfig.FontFamily family = new FontConfig.FontFamily(resolvedFonts, - LocaleList.getEmptyLocaleList(), FontConfig.FontFamily.VARIANT_DEFAULT); + LocaleList.getEmptyLocaleList(), FontConfig.FontFamily.VARIANT_DEFAULT, + VARIABLE_FONT_FAMILY_TYPE_NONE); return new FontConfig.NamedFamilyList(Collections.singletonList(family), fontFamily.getName()); } diff --git a/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java b/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java index 037637630b7a..184c976b86bf 100644 --- a/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java +++ b/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.fail; import android.content.Context; import android.graphics.FontListParser; +import android.graphics.fonts.FontFamily; import android.graphics.fonts.FontManager; import android.graphics.fonts.FontStyle; import android.graphics.fonts.FontUpdateRequest; @@ -330,7 +331,8 @@ public final class UpdatableFontDirTest { FontConfig.FontFamily family = new FontConfig.FontFamily( Arrays.asList(fooFont, barFont), null, - FontConfig.FontFamily.VARIANT_DEFAULT); + FontConfig.FontFamily.VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); return new FontConfig(Collections.emptyList(), Collections.emptyList(), Collections.singletonList(new FontConfig.NamedFamilyList( @@ -491,7 +493,8 @@ public final class UpdatableFontDirTest { file, null, "bar", new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), 0, null, null); FontConfig.FontFamily family = new FontConfig.FontFamily( - Collections.singletonList(font), null, FontConfig.FontFamily.VARIANT_DEFAULT); + Collections.singletonList(font), null, FontConfig.FontFamily.VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); return new FontConfig( Collections.emptyList(), Collections.emptyList(), @@ -644,7 +647,8 @@ public final class UpdatableFontDirTest { file, null, "test", new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), 0, null, null); FontConfig.FontFamily family = new FontConfig.FontFamily( - Collections.singletonList(font), null, FontConfig.FontFamily.VARIANT_DEFAULT); + Collections.singletonList(font), null, FontConfig.FontFamily.VARIANT_DEFAULT, + FontFamily.Builder.VARIABLE_FONT_FAMILY_TYPE_NONE); return new FontConfig(Collections.emptyList(), Collections.emptyList(), Collections.singletonList(new FontConfig.NamedFamilyList( Collections.singletonList(family), "sans-serif")), 0, 1); -- GitLab