Status Update
Comments
si...@google.com <si...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ch...@gmail.com <ch...@gmail.com> #3
si...@google.com <si...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
co...@protonmail.com <co...@protonmail.com> #5
cm...@gmail.com <cm...@gmail.com> #7
I have a question about implementing the above workaround. We're using downloadable fonts via xml, as outlined here:
As far as I can tell, unlike with bundled fonts, wherein multiple font declarations can be nested under a single font family tag, when working with downloadable fonts as outlined in the link, each weight of font is declared in its own fontFamily tag in a separate xml file (i.e. we have 3 font files with top level <font-family> tags to request download of the 3 different font weights).
This seems problematic when trying to get these various bold, medium, etc weights into a Compose Typography object (to provide to MaterialTheme) because the only exposed API I see for FontFamily takes only one typeface, not multiples:
fun FontFamily(typeface: Typeface): FontFamily = LoadedFontFamily(typeface)
In the context of the Downloadable Fonts workaround, is there a way to provide multiple font weights to FontFamily as is done in the Compose samples with bundled fonts?
@Sampled
@Composable
fun CustomFontFamilySample() {
val fontFamily = FontFamily(
Font(
resId = R.font.my_font_400_regular,
weight = FontWeight.W400,
style = FontStyle.Normal
),
Font(
resId = R.font.my_font_400_italic,
weight = FontWeight.W400,
style = FontStyle.Italic
)
)
Text(text = "Demo Text", fontFamily = fontFamily)
}
Thanks!
ha...@google.com <ha...@google.com> #8
Did some investigation.
It turned out that fontWeight and fontStyle doesn't work for the workaround mentioned in #2.(Our font matcher ignored the input fontWeight/fontStyle when the FontFamily is constructed from an Android Typeface)
And we currently don't have any way to create a Font from a downloadable font xml. And as a result, equivalent of the example in #7 is not achievable with current API.
One thing I'm unsure is that Font(resId: Int, weight: FontWeight, style: fontStyle)
ideally should work for downloadable font xml. But it crashes every time when I attempt to do so.(The underlying api used is Resource.getFont()
, and according to
si...@google.com <si...@google.com> #9
Sorry, let me understand better:
- current fonts xml does not allow multiple font weights already.
- this requires 1 font xml definition per weight
- from 1 xml definition there can be 1 Typeface for that weight
- Compose accepts 1 Typeface that can be converted into a FontFamily.
Based on those, the current state requires
-
define 1 xml per weight
-
use regular downloadable fonts to download the font and get the Typeface using Resources#getFont (async version)
-
From that Typeface create a FontFamily and assign to the Text
-
If the text needs to show different weights, change the textStyle to use the correct Typeface.
Currently we do not have APIs for Downloadable fonts in Compose
Font(resId: Int, weight: FontWeight, style: fontStyle)
is not the right way to use it.
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit 66412d57cf31abe84a02c629a9ff6c6600b663df
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Jan 27 14:25:42 2022
API stability for Desktop FontLoader
Returns load to returning SkTypeface.
createFontFamilyResolver(Font.ResourceLoader) becomes expect/actual to
allow platfrom difference in behavior.
Test: ANDROIDX_PROJECTS=COMPOSE ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true --no-daemon
Relnote: "Internal generated kt class rename"
Bug:
Change-Id: Ia0b9e518f8eb18ac6d5d341c933085a32db012ff
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.sikio.kt
M compose/ui/ui-text/api/restricted_current.txt
A compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/DelegatingFontLoaderForDeprecatedUsage.sikio.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/DelegatingFontLoaderForDeprecatedUsage.android.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/DelegatingFontLoaderForDeprecatedUsage.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraph.skiko.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt
M compose/ui/ui-text/api/current.txt
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit 6bbe632de0ba4603813b340cd01a6d1136e4c6f7
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Jan 27 13:23:24 2022
Rebase CursorArchorInfoBuilderTest
Test: ./gradlew :compose:ui:input:cAT
Bug:
Change-Id: I761b556e3545952f0214deb7137a440b029e4b16
D compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/TestFontResourceLoader.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/CursorAnchorInfoBuilderTest.kt
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit 94bc80a59b71a35f2db0932d63f2293b81696c8d
Author: Sean McQuillan <seanmcq@google.com>
Date: Wed Jan 19 13:13:25 2022
AndroidFontLoader uses platform APIs O+
To support Preview usage, prefer platform APIs O+.
This moves from using the threads in ResourcesCompat to async load fonts
to using Dispatchers.IO.
Test: ./gradlew :compose:ui:ui-text:cAT
Test: Validated against compose-samples via createArchive
Bug:
Change-Id: Ib9128c6d175253fc74aced7874d73a359365f6bf
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFontLoader.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 9c63985d645ac7b97883fc45753270543bab0840
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Jan 18 12:39:32 2022
Improve deprecation messages for async fonts
Test: Just deprecation messages
Bug:
Change-Id: Ic09ece743de7464179031b230848fee7354b264b
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoader.android.kt
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 15ca9681024748d5ffc5026b03f381f75c662a6f
Author: Sean McQuillan <seanmcq@google.com>
Date: Fri Jan 14 11:24:51 2022
Add bugs for todos in async font loading
Test: No changes, just comments
Bug:
Change-Id: Ife1c2d424ef61330a2d04ada714491a37d269373
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/MaxLinesHeightModifier.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldSize.kt
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 1475590ee53960ef2664c7eeef3931e7d557574a
Author: Sean McQuillan <seanmcq@google.com>
Date: Fri Jan 14 11:07:02 2022
Desktop uses composition local FontFamily.Resolver
Relnote: "Desktop uses composition local for FontFamily.Resolver"
Relnote: "Desktop FontLoader is deprecated"
Relnote: "New createFontFamilyResolver factory on Desktop"
Test: ANDROIDX_PROJECTS=COMPOSE ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true --no-daemon
Bug:
Change-Id: I6bbbb76ece4ca3844f07e2fc22c2e63478bfdd8c
A compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.sikio.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapterTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyTypefaceAdapter.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/ParagraphLayouter.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraphIntrinsics.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapter.skiko.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFontLoader.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapter.android.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraph.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt
M compose/ui/ui-text/src/desktopTest/kotlin/androidx/compose/ui/text/DesktopFontTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextLayoutResult.kt
M compose/foundation/foundation/src/desktopTest/kotlin/androidx/compose/foundation/text/selection/DesktopTextFieldSelectionManagerTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/DelegatingFontLoaderForDeprecatedUsage.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
M compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/platform/SkiaBasedOwner.skiko.kt
M compose/ui/ui-text/src/desktopTest/kotlin/androidx/compose/ui/text/DesktopParagraphTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt
A compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/SkiaFontLoader.skiko.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/AsyncFontListLoaderTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextTestExtensions.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/Font.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplTest.kt
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit fff528927cea5f1ea0c4052d2fc9dfec7aa3de14
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Jan 11 14:24:34 2022
Remove unecssary current.ignore
Test: ./gradlew :compose:ui:ui-text:checkapi
Bug:
Change-Id: I45b2a75c7a14a129011460133aed980087787001
M compose/ui/ui-text/api/current.ignore
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit ad63f8eb9823642806a08bd8c4069d38d6d5f2e2
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Jan 11 11:30:17 2022
API cleanup for async fonts
1. Throw exception on unreachable path for AndroidPreloadedFont
2. Remove enum-like `values` method from FontLoadingStrategy
3. Clean up code path for AndroidFontLoader.android.kt to avoid
consuming exceptions for no reason.
Relnote: "Remove FontLoadingStrategy.values"
Test: ./gradlew :compose:*:cAT
Bug:
Change-Id: I42a9dbf74cb40af63ac504045b61e8cc1ceaaf9d
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFontLoader.android.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontLoadingStrategy.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
ap...@google.com <ap...@google.com> #18
Branch: androidx-main
commit 5f8eebffa1f9d6159af7abd98352cb23db631482
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Jan 06 18:17:16 2022
Move FontFamily.Resolver to composition local
At the same time, split Font.ResourceLoader into two interfaces and make
the new one internal.
Changes:
- FontFamily.Resolver is now available via
LocalFontFamilyResolver.current
- createFontFamilyResolver(context) and (context, coroutineScope) are
provided for creating resolvers via public API
- Font.ResourceLoader is now deprecated via API review
- New methods on Font.ResourceLoader are now provided by internal
objects
- Paragraph/Multiparagraph now use the new FontFamily.Resolver instead
of Font.ResourceLoader
- FontFamilyResolver now participates in structured concurrency
Relnote: "FontFamilyResolver is now available via
LocalFontFamilyResolver.current"
Relnote: "Added createFontFamilyResolver(context) and
createFontFamilyResolver(context, coroutineScope) to create new
FontFamily resolvers outside of compose usage."
Relnote: "Paragagraph and MultiParagraph now take FontFamily.Resolver"
Relnote: "TextLayoutResult.layoutInput.fontFamilyResolver now contains
the resolver used for this layout, deprecated
TextLayoutResult.layoutInput.resourceLoader as it is no longer used."
Test: ./gradlew :compose:*:cAT :compose:*:test
Bug:
Change-Id: Id5a45c72bb6f33910643ee3da7f81a78dc093d86
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFontLoader.android.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntrinsicIntegrationTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManagerTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphIntrinsics.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/selection/SelectionAdjustmentTest.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.android.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphBenchmark.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.android.kt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplCancellationTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextLayoutResult.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextLayoutResultIntegrationTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoader.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphMethodBenchmark.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverFileTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/MultiParagraphIntegrationTextDirectionTest.kt
M compose/foundation/foundation/benchmark/src/androidTest/java/androidx/compose/foundation/benchmark/text/TextDelegateBenchmark.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphPlaceholderIntegrationTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/MultiParagraph.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplPreloadTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldSize.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextLayoutHelperTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTextDirectionTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextTestExtensions.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/Font.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextSelectionLongPressDragTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextDelegateTest.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapterTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/FontFamilyResolverUtils.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/MultiParagraphIntegrationTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionDelegateTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoaderTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapterTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyTypefaceAdapter.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextDelegate.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidParagraphTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextDelegateIntegrationTest.kt
M compose/ui/ui-tooling/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapter.android.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableStringTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/platform/PlatformParagraph.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicText.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldTest.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/ModifierLocalConsumerNodeTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-tooling/api/restricted_current.txt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/MultiWidgetSelectionDelegateTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextTestExtensions.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextFieldDelegateIntegrationTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Paragraph.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopFont.desktop.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/DelegatingFontLoaderForDeprecatedUsage.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextLayoutHelper.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphIntrinsics.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreText.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/ComposeViewAdapter.kt
M compose/ui/ui-tooling/api/current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/AsyncFontListLoaderTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextFieldMagnifierTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldDelegateTest.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/LayoutlibFontResourceLoader.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextDelegateWidthWithLetterSpacingTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapterPreloadTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/MaxLinesHeightModifier.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit 4a9e9962d1caca9fe101edf2c83206709317110f
Author: Sean McQuillan <seanmcq@google.com>
Date: Wed Jan 05 16:48:55 2022
Add demo for async font usage
Test: Is a demo
Bug:
Change-Id: I376bf1f17acd26ebab51a7d1b229c63fa46faa72
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/FontFamilyDemo.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
ap...@google.com <ap...@google.com> #20
Branch: androidx-main
commit 35b47fa53b9245bc06ee839b4f307bafa5225a24
Author: Sean McQuillan <seanmcq@google.com>
Date: Mon Dec 13 17:14:32 2021
Move FontFamily.GlabalResolver to FontFamilyResolver
All semantics stay the same, this is just a rename.
Test: ./gradlew :compose:ui:ui:cAT :compose:ui:ui-text:cAT // Existing desktop and Android tests
Relnote: "Global font loader is now called FontFamilyResolver."
Bug:
Change-Id: I4f7736829412d6a553a8cffe4eba2b6cda1f3d19
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidParagraphTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverFileTest.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraph.skiko.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplCancellationTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit aebb53dc05170fc18eedcb84fe5b1e46ad7af128
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Dec 09 17:55:39 2021
Integrate FontFamily.Resolver into desktop
Integrates new global resolver into desktop font loading.
Due to linking issues, embed LruCache and SimpleArrayMap from
collection2.
Test: ANDROIDX_PROJECTS=COMPOSE ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true --no-daemon
Relnote: "Use new font loading system for desktop."
Bug:
Change-Id: I9ce5cf9d537d95cf983c0e9a2a2462b5f046c359
M compose/ui/ui-text/build.gradle
A compose/ui/ui-text/src/jvmMain/kotlin/androidx/compose/ui/text/platform/Synchronization.jvm.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyTypefaceAdapter.kt
M compose/ui/ui-text/api/restricted_current.txt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/caches/SimpleArrayMap.kt
A compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapter.skiko.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontMatcher.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraph.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt
M compose/ui/ui-text/src/desktopTest/kotlin/androidx/compose/ui/text/DesktopFontTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontLoadingStrategy.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplCancellationTest.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/caches/LruCache.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidFontListTypeface.android.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopFont.desktop.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/caches/ContainerHelpers.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverFileTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/platform/Synchronization.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplPreloadTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidGenericFontFamilyTypeface.android.kt
M compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/Font.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/FontFamilyResolverUtils.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplTest.kt
ap...@google.com <ap...@google.com> #22
Branch: androidx-main
commit f5822f56b6a11825831545c1897140ed8f2ef025
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Dec 09 13:54:39 2021
FontFamily.Resolver.resolve returns State<Any>
Async fonts are backed by mutableStateOf
Sync fonts are backed by an immutable object that does not cause a state
read, but implements State<T>.
Bug:
Test: ./gradlew :compose:ui:ui:cAT :compose:ui:ui-text:cAT
Relnote: "FontFamily.Resolver.resolve returns State<Any>"
Change-Id: I4406c9752595e349abb8c4d733b9cad459cebfe2
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/matchers/TypefaceResultSubject.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverFileTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/FontFamilyResolverUtils.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplTest.kt
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit aaef33f6bcb4ae18d0943742205714755257df20
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Nov 18 19:40:29 2021
Make Font.ResourceLoader extensible for new Android fonts
Also preparing for adding asynchronous font loading to replace TypefaceAdapter.
New Public APIs:
* Font.ResourceLoader
- loadBlocking(font): Any?
- loadAsync(font): Any?
- cacheKey: String?
* AndroidFont: Font
- existing type made public with a property referencing the correct AndroidFont.TypefaceLoader for this AndroidFont type
* AndroidFont.TypefaceLoader
- new type that allows for plugging new types of Font resource descriptors into compose Font-based FontFamilies.
* Font.loadingStrategy: FontLoadingStrategy
- load strategy for this font, to configure load behavior (blocking,
optional, async)
* ResourceFont.loadingStratey
* FontLoad
- loading strategy for a font.
- Async (fallback and reflow after load)
- OptionalLocal (fonts that may be pre-installed on device)
- Blocking (fonts that are bundled with APK, or always available).
* Font.AndroidResorceLoader(context: Context)
- Convenience factory for producing Font.ResourceLoader outside of composition context (e.g. Application.onCreate).
- Intended to be used for preloading fonts outside of composition.
Removed public method:
* TextLayoutResult.createTextLayoutResult
- accidentally public and previously deprecated.
- Creates xmodule experimental dependencies on new font loading APIs due to Font.ResourceLoader.
- Removing in 1.2 as there is no use case for this method.
Test: ./gradlew :compose:ui:ui:clean :compose:ui:ui-text:clean :compose:ui:ui:test :compose:ui:ui-text:test :compose:ui:ui:cAT :compose:ui:ui-text:cAT
Relnote: "Added AndroidFont, a new low-level API for providing new types
of font resource descriptors on Android. For example, loading fonts from
an app-specific backend, optionally locating pre-installed fonts
on-device, or loading a font from a resource not provided by the current
Font factories."
Relnote: "Expanded Font.ResourceLoaded API to support optional and async
font loading. It is not recommended that application developers use this
API directly. To add new types of fonts see AndroidFont."
Relnote: "Font.AndroidResourceLoader extension function allows
construction of a Font.ResourceLoader when outside of composition."
Relnote: "Added loadingStrategy parameter to resource-based fonts, to allow
async loading when resource font references downloadable fonts XML."
Bug:
Change-Id: Ie5aeadd2feaf996d2c826d87dd310b8984e106c8
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontStyle.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-tooling/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/AndroidFontTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt
A compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/font/FontSynthesis.desktop.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFontUtils.android.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontLoadingStrategy.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphBenchmark.kt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/TypefaceAdapter.android.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/FontSynthesis.android.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextLayoutResult.kt
M compose/ui/ui-tooling/api/restricted_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoader.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/matchers/TypefaceSubject.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidFontListTypeface.android.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/AsyncTestFonts.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextTestExtensions.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphMethodBenchmark.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/FontTestData.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopFont.desktop.kt
A compose/ui/ui-text/api/restricted_current.ignore
M compose/foundation/foundation/benchmark/src/androidTest/java/androidx/compose/foundation/benchmark/text/TextDelegateBenchmark.kt
M compose/ui/ui-tooling/api/current.txt
M compose/foundation/foundation/build.gradle
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextTestExtensions.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/AndroidFontUtilsTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontSynthesis.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/Font.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/LayoutlibFontResourceLoader.kt
A compose/ui/ui-text/api/current.ignore
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/TypefaceAdapterFileTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/FontTestData.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoaderTest.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
ap...@google.com <ap...@google.com> #24
Branch: androidx-main
commit a5cdbb971d0d81feb36a7ba19f8d4294558dc61a
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Nov 18 20:50:12 2021
Add async font loading to Compose
This change adds fallback font loading behavior similar to css. When a font list is resolved, the first blocking font available is used immediately. If an async font was higher priority, then it will attempt to load async - on success it will notify the caller via a State update.
OptionalLocal fonts are also supported, allowing for optional system-installed fonts to have priority over async fonts. This allows optional fonts to load on the first frame and avoid text reflow from async font loading.
New Public APIs:
* (sealed) interface FontFamily.Resolver
- Public interface for resolving or preloading FontFamily to a typeface
* FontFamily.GlobalResolver
- Main public API for resolving a FontFamily to a typeface
New Internal APIs (expect/actual):
* PlatformFontFamilyTypefaceAdapter
- to be implemented by each platform for all FontFamily except FontListFontFamily
Behavior changes:
* FontMatcher now returns a list of potentially matching fonts, instead of one result
- fonts must have same (weight, style) to be considered fallbacks
* FontFamily(list) may now contain duplicates for the same (weight, style), which are resolved as fallbacks (first one wins)
* AndroidFontListTypeface
- matching chooses the first Blocking font in a chain, all async or optional fonts are skipped
- (this retains previous behavior for unmodified FontFamily calls)
* AndroidPagagraph
- No API changes, but loading is always performed through FontFamily.Resolver which is a behavior change
Test: ./gradlew :compose:ui:ui:clean :compose:ui:ui-text:clean :compose:ui:ui:test :compose:ui:ui-text:test :compose:ui:ui:cAT :compose:ui:ui-text:cAT
Relnote: "Support for async and optional font loading, with fallback
behavior. This path is used by Text and TextField, and exposed through
FontFamilyResolver"
Relnote: "Support for preloading fonts via FontFamilyResolver.preload"
Relnote: "FontFamilyResolver.setAsyncLoadContext allows setting the
global coroutine context used for loading async fonts."
Bug:
Change-Id: I87fe8bfe5715c956843a7676fe7d783c3cd974d8
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.android.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplCancellationTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/GenericFontFamilyCacheTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoader.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontSynthesisTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/AsyncTestFonts.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphMethodBenchmark.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverFileTest.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapter.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplPreloadTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidGenericFontFamilyTypeface.android.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/FontFamilyTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/FontMatcherTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AccessibilityIteratorsTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/Font.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamilyResolver.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/testutils/FontFamilyResolverUtils.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapterTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidDefaultTypeface.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/matchers/ComposeMatchers.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/AndroidFontResourceLoaderTest.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontFamilyResolverImplTest.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapterTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontMatcher.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidParagraphTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/FontTest.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/matchers/TypefaceResultSubject.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TempListUtils.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/PlatformFontFamilyTypefaceAdapter.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/AndroidFontTest.kt
M compose/ui/ui/api/current.txt
D compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/TypefaceAdapter.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidTypefaceTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/TextPaintExtensions.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidFontListTypeface.android.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopFont.desktop.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphIntrinsics.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidTypefaceSubsetTest.kt
A compose/ui/ui-text/src/test/java/androidx/compose/ui/text/font/AsyncFontListLoaderTest.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/FontFamilyTypefaceAdapter.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/LayoutlibFontResourceLoader.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/font/FontListFontFamilyTypefaceAdapterPreloadTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
D compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/TypefaceAdapterTest.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidFont.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit 9c1ed26be25854c434abc6874324c6207942e81e
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Oct 12 09:50:13 2021
Deprecate Typeface backed by FontFamily
This concept is unsupportable with async fonts, and will be replaced
with a new API for font preloading.
- Deprecate Typeface(FontFamily) constructor as it internally loads
fonts syncronously on call. This doesn't fit with async font loading
and fallback chains.
- Deprecate fontResource(FontFamily): Typeface, as it doesn't allow for
a fallback model in the presence of downloadable fonts and may block for
10+ seconds.
Test: n/a (just a deprecation)
Relnote: "`Typeface(FontFamily)` constructor is deprecated. This was
previously used to preload fonts, which may take up to 10 seconds for
downloadable fonts. With downloadable fonts, this call may block for 10
seconds. Instead use FontFamilyResolver.preload"
Relnote: "`fontResource(FontFamily): Typeface` is deprecated. This was
previously used to preload fonts, which may take up to 10 seconds for
downloadable fonts. Instead use FontFamilyResolver.preload"
Bug:
Change-Id: If8e7c6ce7cd64be8094a576587cc1329e19d246f
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/FontResources.android.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidTypefaceSubsetTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/GenerifFontFamilyCacheTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/AndroidTypeface.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidGenericFontFamilyTypeface.android.kt
M compose/ui/ui/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TypefaceDemo.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidTypefaceTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidDefaultTypeface.android.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidTypefaceCacheTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidFontListTypeface.android.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
ap...@google.com <ap...@google.com> #26
Branch: androidx-main
commit 5f8beac10842231036457ef34e454f3e6040c958
Author: Sean McQuillan <seanmcq@google.com>
Date: Fri Feb 11 16:51:48 2022
Initial implementation of Google Fonts for Compose
Bug:
Test: ./gradlew :compose:ui:ui-text-google-fonts:cAT
Relnote: "Add GoogleFontProvider for configuring downloadable fonts
provider to use with GoogleFont."
Change-Id: I833b8a36f01846d754f904ce7a746a95432c4028
M compose/ui/ui-text-google-fonts/api/restricted_current.txt
M compose/ui/ui-text-google-fonts/api/public_plus_experimental_current.txt
M compose/ui/ui-text-google-fonts/src/androidTest/java/androidx/compose/ui/text/googlefonts/GoogleFontTest.kt
M compose/ui/ui-text-google-fonts/api/current.txt
A compose/ui/ui-text-google-fonts/src/main/java/androidx/compose/ui/text/googlefonts/HandlerHelper.kt
M compose/ui/ui-text-google-fonts/src/main/java/androidx/compose/ui/text/googlefonts/GoogleFont.kt
ap...@google.com <ap...@google.com> #27
Branch: androidx-main
commit f709ee1947ac593ca742203378a191dde135c14d
Author: Sean McQuillan <seanmcq@google.com>
Date: Fri Feb 11 15:23:37 2022
Add :compose:ui:ui-text-google-fonts
Artifact scaffolding for ui-text-google-fonts
Bug:
Test: ./gradlew:compose:ui:ui-text-google-fonts:cAT
Relnote: "Introduce empty :compose:ui:ui-text-google-fonts for
future Google Fonts integration on Android."
Relnote: "FontLoadingStrategy is now stable API."
Change-Id: I1ee351ba27589b1c778e04425c860223ae5e5635
A compose/ui/ui-text-google-fonts/api/public_plus_experimental_current.txt
A compose/ui/ui-text-google-fonts/src/main/AndroidManifest.xml
M compose/ui/ui-text/api/restricted_current.txt
M settings.gradle
A compose/ui/ui-text-google-fonts/build.gradle
A compose/ui/ui-text-google-fonts/src/androidTest/AndroidManifest.xml
A compose/ui/ui-text-google-fonts/api/current.txt
A compose/ui/ui-text-google-fonts/api/restricted_current.txt
A compose/ui/ui-text-google-fonts/api/res-current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontLoadingStrategy.kt
A compose/ui/ui-text-google-fonts/src/androidTest/java/androidx/compose/ui/text/googlefonts/GoogleFontTest.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
A compose/ui/ui-text-google-fonts/src/main/java/androidx/compose/ui/text/googlefonts/GoogleFont.kt
M compose/ui/ui-text/api/current.txt
ni...@google.com <ni...@google.com> #28
Compose status update: Please update the Status
and Status Summary
fields of this bug! (or Public Status
/Public Status Summary
)
Description
Currently we can not use downloadable fonts in Compose. It would be great if we could use them to reduce APK size.