Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -17982,6 +17982,7 @@ package android.graphics.fonts { method @NonNull public android.graphics.fonts.FontFamily.Builder addFont(@NonNull android.graphics.fonts.Font); method @NonNull public android.graphics.fonts.FontFamily build(); method @FlaggedApi("com.android.text.flags.new_fonts_fallback_xml") @Nullable public android.graphics.fonts.FontFamily buildVariableFamily(); method @FlaggedApi("com.android.text.flags.new_fonts_fallback_xml") public boolean canBuildVariableFamily(); } public final class FontStyle { graphics/java/android/graphics/fonts/FontFamily.java +21 −1 Original line number Diff line number Diff line Loading @@ -119,6 +119,24 @@ public final class FontFamily { return this; } /** * Returns true if the passed font files can be used for building a variable font family * that automatically adjust the `wght` and `ital` axes value for the requested * weight/italic style values. * * This method can be used for checking that the provided font files can be used for * building a variable font family created with {@link #buildVariableFamily()}. * If this function returns false, the {@link #buildVariableFamily()} will fail and * return null. * * @return true if a variable font can be built from the given fonts. Otherwise, false. */ @FlaggedApi(FLAG_NEW_FONTS_FALLBACK_XML) public boolean canBuildVariableFamily() { int variableFamilyType = analyzeAndResolveVariableType(mFonts); return variableFamilyType != VARIABLE_FONT_FAMILY_TYPE_UNKNOWN; } /** * Build a variable font family that automatically adjust the `wght` and `ital` axes value * for the requested weight/italic style values. Loading @@ -140,7 +158,9 @@ public final class FontFamily { * value of the supported `wght`axis, the maximum supported `wght` value is used. The weight * value of the font is ignored. * * If none of the above conditions are met, this function return {@code null}. * If none of the above conditions are met, this function return {@code null}. Please check * that your font files meet the above requirements or consider using the {@link #build()} * method. * * @return A variable font family. null if a variable font cannot be built from the given * fonts. Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -17982,6 +17982,7 @@ package android.graphics.fonts { method @NonNull public android.graphics.fonts.FontFamily.Builder addFont(@NonNull android.graphics.fonts.Font); method @NonNull public android.graphics.fonts.FontFamily build(); method @FlaggedApi("com.android.text.flags.new_fonts_fallback_xml") @Nullable public android.graphics.fonts.FontFamily buildVariableFamily(); method @FlaggedApi("com.android.text.flags.new_fonts_fallback_xml") public boolean canBuildVariableFamily(); } public final class FontStyle {
graphics/java/android/graphics/fonts/FontFamily.java +21 −1 Original line number Diff line number Diff line Loading @@ -119,6 +119,24 @@ public final class FontFamily { return this; } /** * Returns true if the passed font files can be used for building a variable font family * that automatically adjust the `wght` and `ital` axes value for the requested * weight/italic style values. * * This method can be used for checking that the provided font files can be used for * building a variable font family created with {@link #buildVariableFamily()}. * If this function returns false, the {@link #buildVariableFamily()} will fail and * return null. * * @return true if a variable font can be built from the given fonts. Otherwise, false. */ @FlaggedApi(FLAG_NEW_FONTS_FALLBACK_XML) public boolean canBuildVariableFamily() { int variableFamilyType = analyzeAndResolveVariableType(mFonts); return variableFamilyType != VARIABLE_FONT_FAMILY_TYPE_UNKNOWN; } /** * Build a variable font family that automatically adjust the `wght` and `ital` axes value * for the requested weight/italic style values. Loading @@ -140,7 +158,9 @@ public final class FontFamily { * value of the supported `wght`axis, the maximum supported `wght` value is used. The weight * value of the font is ignored. * * If none of the above conditions are met, this function return {@code null}. * If none of the above conditions are met, this function return {@code null}. Please check * that your font files meet the above requirements or consider using the {@link #build()} * method. * * @return A variable font family. null if a variable font cannot be built from the given * fonts. Loading