Skip to content

perf(wasm): preload only common font variants - #24080

Open
MartinZikmund wants to merge 3 commits into
masterfrom
dev/mazi/wasm-font-preload-variants
Open

MartinZikmund wants to merge 3 commits into
masterfrom
dev/mazi/wasm-font-preload-variants

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #24079

PR Type:

✨ Feature

What changed? 🚀

Current behavior. Application.PreloadFonts awaits every entry in the default font's manifest before the first frame. FontFamilyHelper.PreloadAllFontsInManifest applies no weight/width/style filter, so a family such as Uno.Fonts.OpenSans (32 faces) is fetched in full. On WebAssembly each face is an individual HTTP request on the startup path, and because WebAssemblyWindowWrapper.ShowCore chains RemoveSplashScreen() off FontPreloadTask, those requests gate perceived startup.

Measured on a blank Skia WASM app (Release publish, brotli, cold context): 37 font requests, 2.62 MB brotli. First GL draw at ~870 ms, last font at 1 026–1 215 ms, splash cleared at 1 141–1 306 ms.

This PR. Preloading is now driven by FeatureConfiguration.Font.PreloadedVariants, a new [Flags] FontPreloadVariants enum:

// default
FontPreloadVariants.Normal | FontPreloadVariants.SemiBold | FontPreloadVariants.Bold

// opt into more
FeatureConfiguration.Font.PreloadedVariants |= FontPreloadVariants.Italic | FontPreloadVariants.Condensed;

// previous behaviour
FeatureConfiguration.Font.PreloadedVariants = FontPreloadVariants.All;

// no preloading at all
FeatureConfiguration.Font.PreloadedVariants = FontPreloadVariants.None;

Weight flags select upright, normal-width faces; Italic and Condensed widen the selection to those forms of the selected weights. Non-preloaded faces load on first use exactly as before.

PreloadAllFontsInManifest keeps its existing semantics and delegates to the new overload with FontPreloadVariants.All.

If a manifest declares none of the selected variants, the full set is preloaded, so a family without an upright regular face is not left with nothing preloaded.

This addresses the preload half of the cost. The 32 faces are still deployed; trimming what Uno.Fonts.OpenSans ships by default is separate follow-up work.

Context and full measurements: specs/056-wasm-skia-startup-performance/spec.md (R3), on branch dev/mazi/wasm-startup-perf.

Validation

  • Code review: selection logic is pure and side-effect free; the only behavioural change on the existing public entry point is that it now delegates with All, preserving semantics.
  • Compile: dotnet build src/Uno.UI/Uno.UI.csproj -p:UnoTargetFrameworkOverride=net10.0 — succeeded.
  • Runtime: dotnet test --project src/Uno.UI.UnitTests/Uno.UI.UnitTests.csproj --filter "FullyQualifiedName~Windows_UI_Xaml_Media" — 63/63 passed, comprising 8 new Given_FontPreloadVariants tests plus the 28 pre-existing Given_FontManifest tests and the rest of the namespace, confirming no regression.

Not yet measured end-to-end in a published WASM app — the expected effect is that the 37 startup font requests drop to the small number of faces actually selected.

PR Checklist ✅

Copilot AI lite review requested due to automatic review settings August 14, 2026 10:18
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 4m 26s —— View job


PR Review: perf(wasm): preload only common font variants

  • Gather context and read changed files
  • Review FontPreloadVariants.cs — new enum design
  • Review FeatureConfiguration.cs — new config property
  • Review FontFamilyHelper.cs — filtering logic
  • Review Application.cs — call-site change
  • Review Given_FontPreloadVariants.cs — unit tests
  • Post inline findings
  • Post summary

Summary

The design is clean and the approach is sound: moving from "preload everything" to a filtered, configurable set of variants is a well-reasoned startup-perf win, and the selection logic is pure and side-effect-free. The public API surface (FontPreloadVariants, FeatureConfiguration.Font.PreloadedVariants) is minimal and additive.

4 findings — 1 medium, 3 low:

# Severity Location Issue
1 Medium FontPreloadVariants.cs:32 Condensed flag doc says "condensed and semi-condensed" but the code in IsVariantSelected filters on FontStretch != Normal, which also covers expanded widths (SemiExpanded, Expanded, …). Doc and code disagree.
2 Low FontFamilyHelper.cs:90 The "preload everything if no variant matches" fallback is not covered by a unit test.
3 Low Given_FontPreloadVariants.cs:9 [GitHubWorkItem("https://github.com/unoplatform/uno/issues/24079")] missing (repo unit-test convention).
4 Low FeatureConfiguration.cs:196 No doc note that PreloadedVariants must be set before OnLaunched fires (unlike DefaultTextFontFamily which is read lazily).

No async/cancellation issues, no cross-platform leaks, no hot-path allocations beyond the startup path, and the internal visibility on IsVariantSelected is correct. The All = ~0 fast-path comparison works correctly and the None early-return is clean.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces startup font preloading work (especially on WebAssembly) by filtering which font-manifest variants are preloaded, controlled via a new FeatureConfiguration.Font.PreloadedVariants flags setting.

Changes:

  • Add FontPreloadVariants [Flags] enum and a new FeatureConfiguration.Font.PreloadedVariants knob (defaulting to Normal/SemiBold/Bold).
  • Introduce variant-selection logic in FontFamilyHelper and route Application.PreloadFonts through it.
  • Add unit tests validating the variant-selection behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/FontFamilyHelper.cs Adds variant-filtered manifest preloading and selection helpers.
src/Uno.UI/UI/Xaml/Application.cs Uses FeatureConfiguration.Font.PreloadedVariants for manifest preloading.
src/Uno.UI/FontPreloadVariants.cs New flags enum defining preloadable weight/style/stretch variants.
src/Uno.UI/FeatureConfiguration.cs Adds Font.PreloadedVariants configuration property and documentation.
src/Uno.UI.UnitTests/Windows_UI_Xaml_Media/Given_FontPreloadVariants.cs New unit tests covering selection rules and edge cases.
Suppressed comments (2)

src/Uno.UI/UI/Xaml/FontFamilyHelper.cs:96

  • Avoid ContinueWith inside an async method here; it captures TaskScheduler.Current and can reintroduce context/exception-handling quirks. Since this is already async, awaiting Task.WhenAll and aggregating the results is simpler and more predictable.
		var tasks = fonts
			.Select(fontInfo => PreloadAsync(fontInfo.FamilyName, new FontWeight(fontInfo.FontWeight), fontInfo.FontStretch, fontInfo.FontStyle));

		return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));

src/Uno.UI/UI/Xaml/FontFamilyHelper.cs:109

  • FontPreloadVariants.Condensed currently includes any non-Normal stretch (including Expanded/UltraExpanded), but the docs say it should widen selection to condensed widths only. This will preload unintended variants when a manifest contains expanded stretches.
		if (font.FontStretch != FontStretch.Normal && !variants.HasFlag(FontPreloadVariants.Condensed))
		{
			return false;
		}

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Uno.UI/UI/Xaml/FontFamilyHelper.cs Resolved
Comment thread src/Uno.UI/FontPreloadVariants.cs Resolved
Comment thread src/Uno.UI/UI/Xaml/FontFamilyHelper.cs Resolved

namespace Uno.UI.Tests.Windows_UI_Xaml_Media;

[TestClass]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per .claude/rules/unit-tests.md, tests that guard or reproduce a specific GitHub issue should carry [GitHubWorkItem] for traceability. Since this PR closes #24079, consider adding it at class level:

Suggested change
[TestClass]
[TestClass]
[GitHubWorkItem("https://github.com/unoplatform/uno/issues/24079")]
public class Given_FontPreloadVariants

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applying this one — GitHubWorkItemAttribute isn't available in Uno.UI.UnitTests, so the suggestion wouldn't compile.

Evidence:

  • git grep GitHubWorkItemAttribute finds no declaration anywhere in the repo; the type comes from outside src/.
  • All 70 files using [GitHubWorkItem] are in Uno.UI.RuntimeTests; zero are in Uno.UI.UnitTests.
  • Uno.UI.UnitTests.csproj references neither Uno.UI.RuntimeTests nor the MUX test infrastructure that supplies it, and UnitTestsImport.props doesn't pull this file into the RuntimeTests compilation either.

I couldn't compile-check it locally to be certain — Uno.UI.UnitTests targets $(NetUnitTests) = net11.0 on feature/breakingchanges and no .NET 11 SDK is installed here (NETSDK1045) — so I left it out rather than risk turning CI red on a traceability annotation. Happy to add it if the attribute is made visible to the unit-test project.

The issue link is on the PR body (closes #24079), so traceability isn't lost.

Comment thread src/Uno.UI/FeatureConfiguration.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 227682 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 111

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • DynamicFont.png
    • Examples.png
    • Attributed_text_FontSize_Changing.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • Buttons.png
    • ClipboardTests.png
    • ContextRequested.png-dark
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 111 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ElementLevelTheme.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Basics Pivot Test.png-dark
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • Examples.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DynamicBrushes_On_Shapes.png
    • ExpanderColorValidationPage.png-dark
    • ImageBrush_Formats.png-dark
    • ContentPresenter_TextProperties.png

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/wasm-font-preload-variants branch from 458735c to 35fc40b Compare August 14, 2026 18:18
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 19s —— View job


PR Review: perf(wasm): preload only common font variants

  • Read changed files
  • Review FontPreloadVariants.cs — enum design and docs
  • Review FeatureConfiguration.cs — config property
  • Review FontFamilyHelper.cs — filtering logic and async patterns
  • Review Application.cs — call-site change
  • Review Given_FontPreloadVariants.cs — unit tests
  • Post inline findings
  • Post summary

Summary

This PR synchronization was triggered by a base-branch update — the PR branch itself has a single unchanged commit (35fc40bd). The code is identical to what the previous review run examined, so all prior inline findings still apply.

Overall design assessment: Clean and well-structured. The approach of a configurable [Flags] enum on FeatureConfiguration is the right pattern, the selection logic is pure and side-effect-free, and the public PreloadAllFontsInManifest API is preserved with correct semantics. The None early-return and All fast-path are handled correctly.

Open findings (4 total — 1 medium, 3 low):

# Severity Location Issue
1 Medium FontPreloadVariants.cs:32 Condensed doc says "condensed and semi-condensed widths" but IsVariantSelected filters on FontStretch != Normal, which also covers expanded widths. Rename/broaden the doc or tighten the filter to < Normal and add a separate Expanded flag.
2 Low FontFamilyHelper.cs:90 The safety-net fallback (preload all when nothing matches) has no unit test. IsVariantSelected is tested; the aggregation logic isn't.
3 Low Given_FontPreloadVariants.cs:9 [GitHubWorkItem("https://github.com/unoplatform/uno/issues/24079")] attribute missing — required by .claude/rules/unit-tests.md for tests that guard a specific issue.
4 Low FeatureConfiguration.cs:196 Remarks don't mention that PreloadedVariants is read once at startup, before OnLaunched fires. Unlike DefaultTextFontFamily (read lazily per text layout), setting this inside OnLaunched is too late.

Additional minor observation (not previously flagged): IsVariantSelected explicitly checks FontStyle.Italic but silently passes FontStyle.Oblique as upright. If a manifest includes oblique faces, they will be included in any weight selection regardless of the Italic flag. This is very unlikely in practice with the Open Sans or Uno Fonts families, but worth documenting on the flag's summary.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 227793 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 124

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Attributed_text_FontSize_Changing.png
    • Buttons.png
    • ContentControl_Inheritance.png
    • ElementLevelTheme.png-dark
    • DynamicFont.png
    • ElementLevelTheme.png
    • Image_Margin_Large.png
    • ImageBrush_Stretch.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Focus_FocusVisual_Properties.png-dark
  • skia-windows-screenshots: 124 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • Examples.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Attributed_text_FontSize_Changing.png
    • DataTemplate_Update_Sample.png-dark
    • DataTemplate_Update_Sample.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ClipboardTests.png-dark
    • ColorPickerSample.png
    • ContextRequested.png-dark
    • Elevation.png-dark
    • Elevation.png
    • ElevationView_Clipping.png-dark
    • ElevationView_Clipping.png
    • ImageBrushInList.png-dark

@github-actions

github-actions Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 35s —— View job


PR Review: perf(wasm): preload only common font variants

  • Gather context and read changed files
  • Review FontPreloadVariants.cs — enum design and docs
  • Review FeatureConfiguration.cs — config property
  • Review FontFamilyHelper.cs — filtering logic and async patterns
  • Review Application.cs — call-site change
  • Review Given_FontPreloadVariants.cs — unit tests
  • Post inline findings
  • Post summary

Summary

Good progress since the last review run — both medium/correctness issues from the two previous passes have been resolved in c483b381 and 1e2de4e8:

Previously open Status
Condensed doc vs code mismatch (expanded widths included) ✅ Fixed — doc updated to "non-normal widths (condensed and expanded)"
FontStretch.Undefined (value 0) filtered as non-normal ✅ Fixed — is not (FontStretch.Normal or FontStretch.Undefined), with a new test
Fallback path ("preload all when nothing matches") untested ✅ Fixed — When_No_Variant_Matches_Then_Whole_Manifest_Is_Selected test added
Copilot: weight-less flag combo triggers full-manifest fallback ✅ Fixed — SelectsAnyFace guard added, When_No_Weight_Requested_Then_Nothing_Is_Selected test added
PreloadedVariants timing not documented ✅ Fixed — docs: commit adds "set it from a static initializer or from the Application constructor" to remarks

2 low findings remain (inline comments posted):

# File Finding
1 FontFamilyHelper.cs:97 ContinueWith inside an async method — prefer var results = await Task.WhenAll(tasks); return results.All(t => t); for clean exception propagation
2 Given_FontPreloadVariants.cs:10 [GitHubWorkItem("https://github.com/unoplatform/uno/issues/24079")] still missing at class level (raised in both prior passes)

No issues with async/cancellation discipline beyond finding #1, no cross-platform leaks, no hot-path allocations, and the All = ~0 fast path and None early-return are both handled correctly. The SelectsAnyFace guard is a clean resolution to the copilot finding about weight-less flag combos.

var tasks = SelectVariants(manifest.Fonts, variants)
.Select(fontInfo => PreloadAsync(fontInfo.FamilyName, new FontWeight(fontInfo.FontWeight), fontInfo.FontStretch, fontInfo.FontStyle));

return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — async idiom: ContinueWith inside an async method is the wrong pattern here. If Task.WhenAll faults (any preload task throws), the continuation lambda accesses .Result and rethrows as AggregateException, which is then wrapped again by the outer await. The await-then-aggregate idiom handles exceptions cleanly and uses no continuation scheduler ambiguity:

Suggested change
return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));
var results = await Task.WhenAll(tasks);
return results.All(t => t);

namespace Uno.UI.Tests.Windows_UI_Xaml_Media;

[TestClass]
public class Given_FontPreloadVariants

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — missing [GitHubWorkItem]: Per .claude/rules/unit-tests.md, tests that guard a specific GitHub issue must carry this attribute for traceability (flagged in both previous review passes — still outstanding).

Suggested change
public class Given_FontPreloadVariants
[TestClass]
[GitHubWorkItem("https://github.com/unoplatform/uno/issues/24079")]
public class Given_FontPreloadVariants

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 227959 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 103

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Buttons.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ImageBrush_Stretch.png
    • Attributed_text_FontSize_Changing.png
    • Examples.png
    • DynamicFont.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ContextRequested.png-dark
    • ContentControl_Inheritance.png
    • ElementLevelTheme.png-dark
  • skia-windows-screenshots: 103 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Dopes.png-dark
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • ContentPresenter_NativeEmbedding_Android_FillType.png
    • DisplayInformation.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Attributed_text_FontSize_Changing.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ButtonClippingTestsControl.png-dark
    • Examples.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ExpanderColorValidationPage.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 227959 has failed on Uno.UI - CI.

/// The weight flags, i.e. the ones that can select a face on their own. <see cref="FontPreloadVariants.Italic"/>
/// and <see cref="FontPreloadVariants.Condensed"/> only widen an existing weight selection.
/// </summary>
private const FontPreloadVariants AnyWeight =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be an combined flag value inside that enum
it will be easier to keep that updated, should things change

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/wasm-font-preload-variants branch from 1e2de4e to b02cfd1 Compare August 20, 2026 12:42
@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 52s —— View job


PR Review: perf(wasm): preload only common font variants

  • Gather context and read changed files
  • Review FontPreloadVariants.cs — enum design and docs
  • Review FeatureConfiguration.cs — config property
  • Review FontFamilyHelper.cs — filtering logic and async patterns
  • Review Application.cs — call-site change
  • Review Given_FontPreloadVariants.cs — unit tests
  • Post inline findings
  • Post summary

Summary

All prior medium/correctness findings remain resolved. The design is clean: the [Flags] enum, the configurable FeatureConfiguration.Font.PreloadedVariants knob, and the pure selection logic all hold up. Exception propagation from the preload tasks is the one remaining structural concern.

2 findings — both Low:

# Severity File Finding
1 Low FontFamilyHelper.cs:97 ContinueWith inside async — exception re-wrapped as AggregateException on fault and captures TaskScheduler.Current; prefer var results = await Task.WhenAll(tasks); return results.All(t => t). Third consecutive pass flagging this.
2 Low FontFamilyHelper.cs:24 AnyWeight private constant duplicates all weight members of FontPreloadVariants. Adding a new weight flag to the enum without updating the constant silently breaks SelectsAnyFace. Belongs as a named enum member — endorsing Xiaoy312's inline review.

One previously-noted observation (not re-posted as blocking):
IsVariantSelected checks FontStyle.Italic explicitly but passes FontStyle.Oblique through as if it were upright. In practice no Uno Fonts family ships oblique faces, but the Italic flag's XML doc summary could note this behaviour.

[GitHubWorkItem] (closed): The author's investigation is correct — the attribute originates from the MUX test infrastructure that Uno.UI.UnitTests doesn't reference, so it cannot be added without a separate project change. The issue link on the PR body covers traceability.

var tasks = SelectVariants(manifest.Fonts, variants)
.Select(fontInfo => PreloadAsync(fontInfo.FamilyName, new FontWeight(fontInfo.FontWeight), fontInfo.FontStretch, fontInfo.FontStyle));

return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — async idiom (third pass, still open): ContinueWith inside an async method is the wrong pattern here. When any preload task faults, combinedTask.Result inside the lambda re-throws as AggregateException, which is then wrapped again by the outer await instead of being unwrapped to the inner exception. ContinueWith also captures TaskScheduler.Current, which can route the continuation back to the UI thread in the wrong context.

The equivalent await-first form is simpler and has correct exception semantics:

Suggested change
return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));
var results = await Task.WhenAll(tasks);
return results.All(t => t);

private const FontPreloadVariants AnyWeight =
FontPreloadVariants.Thin | FontPreloadVariants.ExtraLight | FontPreloadVariants.Light |
FontPreloadVariants.Normal | FontPreloadVariants.Medium | FontPreloadVariants.SemiBold |
FontPreloadVariants.Bold | FontPreloadVariants.ExtraBold | FontPreloadVariants.Black;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — maintainability (endorsing Xiaoy312's review): AnyWeight is a private constant that mirrors every weight member of FontPreloadVariants. If a new weight flag (e.g. ExtraThin) is ever added to the enum, this private constant must also be updated or SelectsAnyFace silently excludes the new flag. The natural home for this mask is the enum itself:

// in FontPreloadVariants.cs
/// <summary>All weight flags; does not include <see cref="Italic"/> or <see cref="Condensed"/>.</summary>
AnyWeight = Thin | ExtraLight | Light | Normal | Medium | SemiBold | Bold | ExtraBold | Black,

FontFamilyHelper.AnyWeight can then be removed and SelectsAnyFace updated to (variants & FontPreloadVariants.AnyWeight) != 0.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 228880 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 186

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ContentControl_Inheritance.png
    • ButtonClippingTestsControl.png
    • Buttons.png
    • ContextRequested.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 186 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • Dopes.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • BitmapImage_vs_SvgImageSource.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • EmailManagerTests.png-dark
    • EmailManagerTests.png
    • ChatBox.png-dark
    • ChatBox.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • BitmapImage_vs_SvgImageSource.png-dark

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/wasm-font-preload-variants branch from b02cfd1 to a35c62a Compare August 21, 2026 15:50
@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 29s —— View job


PR Review: perf(wasm): preload only common font variants

  • Gather context from prior reviews
  • Read current state of changed files
  • Review FontFamilyHelper.cs — async pattern and AnyWeight constant (2 open findings)
  • Review FontPreloadVariants.cs — enum design
  • Review remaining files for new issues
  • Post inline findings
  • Post summary

Summary

All correctness findings from the previous five review passes remain resolved. The selection logic, SelectsAnyFace guard, SelectVariants fallback, FontStretch.Undefined treatment, and PreloadedVariants timing documentation are all clean and well-tested. No new issues found.

2 low findings remain open (both carried from prior passes):

# File Finding
1 FontFamilyHelper.cs:97 ContinueWith inside async — wrong exception semantics (AggregateException re-wrap) and scheduler capture; prefer var results = await Task.WhenAll(tasks); return results.All(t => t). Fifth consecutive pass.
2 FontFamilyHelper.cs:104 AnyWeight private constant duplicates all weight enum members; a new weight flag added to FontPreloadVariants without updating this constant silently breaks SelectsAnyFace. Move to an AnyWeight combined flag in the enum itself. Endorsed by Xiaoy312; third pass.

Previously closed:

  • All correctness/doc issues from passes 1–4 were resolved: Condensed/expanded width handling, FontStretch.Undefined, fallback path test coverage, SelectsAnyFace guard, PreloadedVariants timing docs.
  • [GitHubWorkItem] — correctly closed: the attribute comes from MUX test infrastructure not referenced by Uno.UI.UnitTests.

The snapshot diffs (73–178 changed screenshots across builds) are consistent across all runs on this branch and appear to originate from the feature/breakingchanges base, not from this PR's changes.

var tasks = SelectVariants(manifest.Fonts, variants)
.Select(fontInfo => PreloadAsync(fontInfo.FamilyName, new FontWeight(fontInfo.FontWeight), fontInfo.FontStretch, fontInfo.FontStyle));

return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — async idiom (fifth pass, still open): ContinueWith inside an async method is the wrong pattern. When any preload task faults, Task.WhenAll returns a faulted task; the continuation lambda accesses .Result, re-throwing as AggregateException rather than letting await unwrap to the original exception. ContinueWith also captures TaskScheduler.Current, which can route the continuation back to the UI thread.

Suggested change
return await Task.WhenAll(tasks).ContinueWith(combinedTask => combinedTask.Result.All(t => t));
var results = await Task.WhenAll(tasks);
return results.All(t => t);

/// Whether <paramref name="variants"/> can match a face at all. Covers <see cref="FontPreloadVariants.None"/>
/// as well as a width/style-only selection, which would otherwise match nothing and trip the fallback below.
/// </summary>
internal static bool SelectsAnyFace(FontPreloadVariants variants) => (variants & AnyWeight) != 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — maintainability (third pass, endorsing Xiaoy312): AnyWeight is a private constant that manually enumerates every weight member of FontPreloadVariants. A new weight flag added to the enum (e.g. ExtraThin) that isn't also added here silently breaks SelectsAnyFace — the face would never match and would either be excluded or trigger the whole-manifest fallback.

The natural home for this mask is the enum itself, so both definitions stay in sync:

// in FontPreloadVariants.cs, after Black:
/// <summary>All weight flags; does not include <see cref="Italic"/> or <see cref="Condensed"/>.</summary>
AnyWeight = Thin | ExtraLight | Light | Normal | Medium | SemiBold | Bold | ExtraBold | Black,

Then the private constant here can be removed, and this line updated to:

Suggested change
internal static bool SelectsAnyFace(FontPreloadVariants variants) => (variants & AnyWeight) != 0;
internal static bool SelectsAnyFace(FontPreloadVariants variants) => (variants & FontPreloadVariants.AnyWeight) != 0;

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229432 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 169

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • DynamicFont.png
    • Examples.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ContentControl_Inheritance.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ImageBrush_Stretch.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ContextRequested.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 169 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BitmapImage_vs_SvgImageSource.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ExpanderColorValidationPage.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • ChatBox.png-dark
    • ChatBox.png
    • Basics Pivot Test.png-dark
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • EllipsemaskingEllipseGrid.png-dark
    • Examples.png
    • FocusManagerTest.png-dark
    • FocusManagerTest.png
    • ImageBrush_Formats.png-dark
    • ImageBrush_Formats.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • DoubleImageBrushInList.png-dark
    • Buttons.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 229432 has failed on Uno.UI - CI.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 229232 has failed on Uno.UI - CI.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 228880 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/wasm-font-preload-variants branch from e5454bf to 945831f Compare August 29, 2026 10:11
@unodevops

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 230998 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 223

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png
    • ImageBrushInList.png-dark
    • Image_Margin_Large.png
    • ImageBrushInList.png
    • CalendarView_Theming.png-dark
    • ContentControl_Inheritance.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrush_Stretch.png
    • Attributed_text_FontSize_Changing.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DynamicFont.png
    • Examples.png
  • skia-windows-screenshots: 223 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • ChatBox.png-dark
    • ChatBox.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • ElementLevelTheme.png-dark
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • Grid_in_Canvas.png-dark
    • Grid_in_Canvas.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Buttons.png
    • FocusManagerTest.png-dark
    • FocusManagerTest.png

@MartinZikmund
MartinZikmund changed the base branch from feature/breakingchanges to master September 2, 2026 20:02
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 231686 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Focus_FocusVisual_Properties.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
  • skia-windows-screenshots: 2310 changed over 2402

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • Arrange_Performance01.png
    • AuthenticationBroker_Demo.png
    • AutomationPropertiesExtensions_Role.png
    • AutoSuggestBox_Icons.png-dark
    • BasicAutoSuggestBox.png
    • BasicThemeResources.png
    • BitmapIcon_Sizing.png
    • Border_AntiAlias.png
    • Border_BorderThickness.png-dark
    • Border_CornerRadius_Gradient.png-dark
    • Border_CornerRadius_Gradient.png
    • Border_Simple_with_Opacity.png-dark
    • Border_Simple_with_Opacity.png
    • Buttons.png-dark
    • Buttons.png
    • Canvas_In_Canvas.png-dark
    • Canvas_In_Canvas.png
    • CheckBox_IsEnabled_Automated.png-dark
    • CheckBox_IsEnabled_Automated.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The All compatibility path, None/no-weight no-fetch path and no-matching-face fallback are consistent. One remaining contract detail: FontFamilyHelper.IsVariantSelected excludes only FontStyle.Italic, so an Oblique normal-weight face passes the default mask despite the documented upright-only selection. Please explicitly decide how Oblique maps to the style flag and cover it, rather than silently preloading it as upright. This is Uno/browser startup policy, not a direct port of WinUI font-loading behavior.

MartinZikmund and others added 3 commits October 3, 2026 10:42
Application.PreloadFonts awaited every entry in the default font's manifest
before the first frame. A full family declares dozens of weight/width/style
combinations, and on WebAssembly each one is an individual HTTP request on
the startup path: a blank Skia WASM app fetched 37 font files (2.6 MB
brotli) before the splash screen came down.

Preloading is now driven by FeatureConfiguration.Font.PreloadedVariants, a
[Flags] enum defaulting to the upright Normal, SemiBold and Bold faces. The
remaining variants load on first use. FontPreloadVariants.All restores the
previous behaviour, None disables preloading entirely, and Italic/Condensed
extend the selection to those forms of the selected weights.

PreloadAllFontsInManifest keeps its existing semantics and now delegates to
the new overload with FontPreloadVariants.All.

If a manifest declares none of the selected variants the full set is
preloaded, so a family with no upright regular face is not left with
nothing preloaded.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPSfNUJzuqnH64X7YuX7VK
A selection with no weight flag (e.g. Italic alone) matched no face, which
tripped the "manifest declares none of the selected variants" fallback and
preloaded the whole family — the opposite of what was asked for. Such a
selection now preloads nothing and skips the manifest fetch entirely.

A manifest omitting font_stretch deserializes to FontStretch.Undefined,
which the width filter treated as non-normal and excluded. Undefined now
counts as normal width, so a manifest without explicit widths is filtered
by weight instead of falling through to a full preload.

The selection is extracted into FontFamilyHelper.SelectVariants so the
fallback and the empty-selection guard are covered by unit tests rather
than only by the I/O-bound PreloadFontsInManifest.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
PreloadFonts runs from InvokeOnLaunched before OnLaunched, so assigning
PreloadedVariants inside OnLaunched has no effect.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
Copilot AI lite review requested due to automatic review settings October 3, 2026 08:42
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/wasm-font-preload-variants branch from 945831f to 1ffa603 Compare October 3, 2026 08:42
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 52s —— View job


PR Review: perf(wasm): preload only common font variants

  • Gather context from prior review passes
  • Read current state of changed files
  • Check status of previously-flagged findings
  • Review against AGENTS.md rules
  • Post inline findings
  • Post summary

Summary

Re-verified the current state of all five changed files against the six prior review passes. The design remains sound: a pure, side-effect-free [Flags] selection (FontPreloadVariants → FontFamilyHelper.SelectVariants/IsVariantSelected), a minimal additive public surface (FeatureConfiguration.Font.PreloadedVariants), and PreloadAllFontsInManifest preserved with identical behavior via All. No SOLID/async-discipline/DP/event-pattern/cross-platform violations found — this is pure C# logic with no platform suffixes involved.

All correctness-level findings from passes 1–6 are confirmed fixed and stay fixed: Condensed vs expanded-width doc mismatch, FontStretch.Undefined exclusion, the weightless-selection→full-fallback trap (SelectsAnyFace), and the PreloadedVariants timing documentation. Each has a passing regression test in Given_FontPreloadVariants.cs.

1 new finding — Low: FontFamilyHelper.cs:125 — IsVariantSelected excludes only FontStyle.Italic; FontStyle.Oblique (a distinct third enum value) falls through and is preloaded as if upright, regardless of the Italic flag. Raised informally by @morning4coffe-dev on 2026-09-08 but not yet turned into an actionable change — posted inline with a suggested fix. No shipped Uno Fonts manifest currently declares oblique faces, so this has no effect on today's preload count.

2 findings remain open from passes 1–6 (not re-posted inline — already on the thread, unchanged since 2026-08-22, no action taken):

  • FontFamilyHelper.cs:97 — Task.WhenAll(tasks).ContinueWith(...) instead of await-then-aggregate. Note: this exact line is pre-existing code, not introduced by this PR's diff (confirmed via git diff origin/master...HEAD and the pre-PR file) — the PR only changed what feeds into it. Still worth the 2-line cleanup given how much attention it's drawn, but it's not a regression this PR introduced.
  • FontFamilyHelper.cs:24 — the AnyWeight private constant duplicates the enum's weight members; endorsed by @Xiaoy312 as a maintainability risk if a new weight flag is added later. Best fixed by moving it onto FontPreloadVariants itself as AnyWeight = Thin | … | Black.

Verdict: no blocking issues. The two long-open lows are minor and one predates this PR; the new Oblique finding is also low-severity and narrow in practice. Safe to merge as-is, or address the three lows together in a quick follow-up commit.


internal static bool IsVariantSelected(FontInfo font, FontPreloadVariants variants)
{
if (font.FontStyle == FontStyle.Italic && !variants.HasFlag(FontPreloadVariants.Italic))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low — FontStyle.Oblique silently treated as upright: FontStyle has three values (Normal, Oblique, Italic — src/Uno.WinRT/UI/Text/FontStyle.cs), but this check only excludes FontStyle.Italic when Italic isn't requested. A manifest face with FontStyle.Oblique falls through this guard and is preloaded by the default weight mask alone, even though the enum's remarks say weight flags should select only "upright, normal-width faces" (FontPreloadVariants.cs:10).

In practice no shipped Uno Fonts/Open Sans manifest declares oblique faces, so this doesn't change today's preload count, but it's an unhandled case in otherwise-exhaustive logic (raised by @morning4coffe-dev on 2026-09-08, not yet addressed). Suggest either matching FontStyle.Normal explicitly instead of != Italic, or documenting that Italic also gates Oblique:

Suggested change
if (font.FontStyle == FontStyle.Italic && !variants.HasFlag(FontPreloadVariants.Italic))
if (font.FontStyle != FontStyle.Normal && !variants.HasFlag(FontPreloadVariants.Italic))

[Fix this →](https://claude.ai/code?q=In%20src%2FUno.UI%2FUI%2FXaml%2FFontFamilyHelper.cs%20on%20branch%20dev%2Fmazi%2Fwasm-font-preload-variants%2C%20IsVariantSelected%20only%20excludes%20FontStyle.Italic%20faces%20when%20the%20Italic%20flag%20isn%27t%20set%2C%20but%20FontStyle%20also%20has%20an%20Oblique%20value%20that%20falls%20through%20as%20if%20upright.%20Change%20the%20check%20to%20%60font.FontStyle%20%21%3D%20FontStyle.Normal%60%20so%20Oblique%20is%20gated%20by%20the%20Italic%20flag%20too%2C%20and%20add%20a%20unit%20test%20in%20Given_FontPreloadVariants.cs%20covering%20an%20Oblique%20face.&repo=unoplatform/uno

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Resolve the test compilation ambiguity and correctly handle oblique font styles.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (1)

using Microsoft.UI.Xaml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.UI;
using Uno.UI.Xaml.Media;

internal static bool IsVariantSelected(FontInfo font, FontPreloadVariants variants)
{
if (font.FontStyle == FontStyle.Italic && !variants.HasFlag(FontPreloadVariants.Italic))
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237149 found UI Test snapshots differences: skia-linux-screenshots: 119, skia-windows-screenshots: 150

Details
  • skia-linux-screenshots: 119 changed over 2454

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Focus_FocusVisual_Properties.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • DisplayInformation.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 150 changed over 2456

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • DynamicBrushes_On_Shapes.png-dark
    • DynamicBrushes_On_Shapes.png
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Grid_InsideStackPanel_InsideButton.png-dark
    • Grid_InsideStackPanel_InsideButton.png
    • Grid_in_Canvas.png-dark
    • Grid_in_Canvas.png
    • Grid_in_GridClipping.png-dark
    • Grid_in_GridClipping.png
    • Grid_in_StackPanel.png-dark
    • Grid_in_StackPanel.png

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Startup: every font variant in the manifest is preloaded before first frame

6 participants