Register a package's own fonts under packages/<self>/#145
Merged
Conversation
loadAppFonts() registered fonts declared with a bare lib/... asset path only under their bare family name. When the same package references those fonts with `package: '<self>'`, Flutter resolves the family to packages/<self>/MyFont at lookup time, which was never registered, so Skia fell back to Ahem. Read the test target's package name from pubspec.yaml and additionally register bare-path fonts as packages/<self>/MyFont, mirroring the packages/ asset branch. Closes #141
These tests spawn a real `flutter test` subprocess that compiles and runs a drag/tap scenario. On slower CI runners (notably Flutter 3.10) the cold compile occasionally exceeds the default 30s test timeout, killing the child process and surfacing as a flaky 'exit code -9' failure. Give them a 2 minute budget so CI contention no longer trips the deadline.
58c1379 to
dbd705e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #141
loadAppFonts()registered fonts declared with a barelib/...asset path (the idiomatic form for a package's own fonts) only under their bare family name. When the same package references those fonts withpackage: '<self>', Flutter resolves the family topackages/<self>/MyFontat lookup time — a name that was never registered, so Skia fell back to Ahem (empty boxes) even though the bytes were loaded.This bit Wiredash, which declares
Inter/Wireconswithlib/assets/fonts/...paths but setspackage: 'wiredash'on itsTextStyle/IconData.Fix
Before: only
MyFontwas registered →packages/own_package/MyFontrendered as Ahem.After: the test target's package name is read from
pubspec.yamland bare-path fonts are additionally registered aspackages/<self>/MyFont, mirroring the existingpackages/asset branch.This makes the two directions symmetric and matches what Flutter does internally when resolving
package:on aTextStyle/IconData.The
app_fonttemplate already declaresPrivateFontwith a barelib/...path; a new golden test now also resolves it viapackages/app_font/PrivateFontso the regression can't sneak back in.