Skip to content

[iOS] Center FontImageSource glyphs on iOS 26 without changing font metrics - #39230

Merged
kubaflo merged 5 commits into
inflight/candidatefrom
kubaflo-ios-glyph-centering
Oct 8, 2026
Merged

kubaflo merged 5 commits into
inflight/candidatefrom
kubaflo-ios-glyph-centering

Conversation

@kubaflo

@kubaflo kubaflo commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Ports the issue reproduction and font-image centering approach from kubaflo/maui#719, with additional native regression coverage and fresh before/after verification against upstream main (84b1fb39ad56e22a51d29d4bbf141b03b02e4648).

Root cause: centering a font's typographic line box does not necessarily center the visible glyph. The difference is visible in the iOS 26 glass navigation back button used by ManualTests Categories → Commands → G4.

Fix: on iOS 26+, use CoreText glyph-path bounds to center the actual ink in the existing image renderer. Unlike the source PR, this does not compress glyphs horizontally by 0.75 or crop the image height. It retains the original image dimensions, natural glyph shape, color, and rendering mode. Older iOS and MacCatalyst retain the original drawing path; glyphs without usable path bounds also retain that path.

Coverage: adds a Shell reproduction with OpenSansRegular, a valid bound back command, and an iOS screenshot-centroid regression test. Adds nine native image-source cases covering multiple glyphs, sizes, scales, a combining mark, a bundled custom font, image/ink dimensions, colors, and rendering modes. Updates five reviewed ios-26 visual baselines for existing ImageButton, ToolbarItem, and Button scenarios; older-iOS and other-platform snapshots and all test tolerances remain unchanged.

Empirical verification

Both apps were built from this worktree's source project references, not substituted packaged MAUI libraries. The original ManualTests G4 files, including their OpenSansSemibold icon, were left unchanged.

Scenario Unfixed product Fixed product
Original ManualTests G4, iOS 26.5 Glyph midpoint 3.83 pt below button center 0.17 pt below center
Original G4 glyph ink dimensions 22 × 38 physical pixels 22 × 38 physical pixels, unchanged
New HostApp issue scenario, iOS 26.5 Glyph midpoint 4.00 pt below center 0.00 pt offset
Native FontImageSourceServiceTests, iOS 26.5 16 executed: 10 passed, 6 centering cases failed 16 executed: 16 passed, 0 failed
Native compatibility run, iOS 18.5 Not rerun as an unfixed control 16 executed: 16 passed, 0 failed

Measurements use the native accessibility back-button frame and screenshot ink, excluding the glass rim. Six new centering assertions were proven to fail with only the product fix removed, while the existing tests and rendering-mode cases passed. Restoring the fix made the entire selected suite pass.

The compiled UI test's actual MeasureGlyphOffset method was also executed offline against the real HostApp screenshots: the unchanged product failed its 1-point tolerance, and the fixed product passed, using both floor and nearest integer conversions of accessibility frames. Both apps' back navigation was exercised and recorded. The original G4 app has a pre-existing BackCommand/GoBackCommand binding-name mismatch; that was not modified or treated as proof of a valid command invocation. The new reproduction has a matching command binding.

No XCTest, WebDriverAgent, or Appium iOS execution was used locally. Navigation, screenshots, and recordings used dedicated background simulators; native xUnit tests ran through the repository's managed XHarness test app launched with simctl. The complete NUnit/Appium UI fixture was compiled but not executed through its driver locally. No physical-device verification is claimed.

Video proofs

Raw simulator recordings, without overlays or rescaling. Each demonstrates opening G4, using the custom back button, and opening G4 again.

Original ManualTests app — before

issue31936-original-app-before.mp4

Original ManualTests app — after

issue31936-original-app-after.mp4

New HostApp reproduction — before

issue31936-hostapp-before.mp4

New HostApp reproduction — after

issue31936-hostapp-after.mp4

Local build and execution evidence

A below is the local evidence directory; these are the exact session-helper invocations used. Build helpers invoke dotnet build on the checked-in projects with UseMaui=false, source references, the original net10 target frameworks, and iossimulator-arm64. Native execution helpers install the checked-in test app, launch its managed runner, and assert fresh xUnit XML contains exactly the 16 selected cases.

Command Result
bash "$A/verification-build.sh" app final-fixed ManualTests built; 0 warnings/errors
bash "$A/verification-build.sh" host final-fixed HostApp built; 0 warnings/errors
bash "$A/verification-build.sh" device final-fixed Core.DeviceTests built; 0 warnings/errors
bash "$A/verification-build.sh" ui-tests final-fixed iOS NUnit assembly built; 0 warnings/errors
python3 "$A/run-image-source-tests.py" unfixed-control-native fail Expected regression reproduced: 6 centering failures, 10 passes
python3 "$A/run-image-source-tests.py" final-fixed-native pass iOS 26.5: 16/16 passed
python3 "$A/run-image-source-tests.py" final-ios18-compatibility pass 4DAEF62A-DEB2-48AC-B9B4-AA491DFAE3A1 iOS 18.5: 16/16 passed
dotnet run --no-build --project ../oracle/Oracle.csproj -- unfixed-hostapp fail Compiled screenshot oracle reproduced the mismatch
dotnet run --no-build --project ../oracle/Oracle.csproj -- final-fixed-hostapp pass Compiled screenshot oracle passed the 1-point tolerance

Repository dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 was run with --include restricted to the four changed code files: exit 0, no formatting changes; workspace-loading warnings were reported. git diff --check passed.

Toolchain qualifications: the exact repository servicing SDK was unavailable, so an external SDK-selection directory pinned installed .NET SDK 10.0.100, without modifying global.json or changing the framework targets. Builds used the installed iOS SDK 26.0.11017, Xcode 26.6, ValidateXcodeVersion=false, and ad-hoc simulator signing (EnableCodeSigning=true, CodesignKey=-, CodesignRequireProvisioningProfile=false). iOS 26.5 ran on an iPhone 17 Pro Max simulator; the compatibility run used an iPhone 16 Pro Max simulator on iOS 18.5. CI results are separate from these local results.

CI verification and visual baselines

The first full CI cycle at 2781d7f3c3 passed maui-pr and maui-pr-devicetests. The actual results XML from both iOS Core Helix work items confirms 16/16 FontImageSourceServiceTests passed, including all nine new cases; all seven device-test Helix job inventories were inspected for hidden failures.

In maui-pr-uitests build 1626656, Issue31936.FontImageSourceBackGlyphIsVerticallyCentered actually passed (run 45111838, result 100329, 4.703 seconds). This is an executed CI UI test result, not an inference from its attributes or the job status. The overall UI pipeline was not green.

Three iOS 26 visual failures reflect the intentional font-image ink placement change: Issue13474Test, VerifyToolbarItemIconColor, and Issue22433_Default. Their actual CI images were reviewed and copied as the new baselines. The Button test stops at Default on failure, so its subsequent Issue22433_Layout and Issue22433_Spacing pages were also exercised and captured in the source-built HostApp on a dedicated background iPhone 11 Pro / iOS 26.5. The Default capture was pixel-identical to CI, including alpha, after the normal status/home-indicator crop and excluding the single right-edge pixel absent from CI's screenshot. No resizing or image compositing was used.

The two follow-on captures preserve all button text, borders, dimensions, padding, and spacing; their differences are the centered font-image glyphs plus negligible one-channel-value navigation-shadow noise. Only the five ios-26 PNGs changed. No assertions, tolerance settings, older-iOS baselines, or other-platform baselines were weakened or replaced.

The compiled repository MagickNetVisualComparer, using its unchanged 0.005 / 0.5% threshold, rejected all five old baselines and accepted all five replacements. S below denotes this worktree's src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26 directory; comparer commands ran from the external SDK-selection directory described above.

Command Result
python3 "$A/capture-ci-button-snapshots.py" All three Button pages captured twice; repeated body pixels identical, Default matches CI exactly; no local XCTest or UI driver
dotnet run --project ../snapshot-oracle/SnapshotOracle.csproj -- "$S" fail Expected mismatches verified for all five old baselines: 1.06%, 0.79%, 1.37%, 1.03%, 1.03%
dotnet run --no-build --project ../snapshot-oracle/SnapshotOracle.csproj -- "$S" pass All five replacement baselines passed the actual repository comparer

The snapshot-only follow-up is 9699ac1d18. Fresh remote UI validation has been requested; remaining UI failure attribution and the new CI cycle are not claimed complete or green.

Issues Fixed

Fixes #31936

kubaflo and others added 4 commits October 7, 2026 00:08
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Regenerate only `issue-triage.lock.yml` using gh-aw v0.86.2 against
deployed main `8c974ad7037c6e171e951883c752bbcea1514cc3`, following
#39065. Shared `pat_pool.md` frontmatter changed before merge, leaving
the triage lock stale. Actual production runs
[37503999448](https://github.com/dotnet/maui/actions/runs/37503999448)
and
[37503998307](https://github.com/dotnet/maui/actions/runs/37503998307)
failed before inference/publication with `E009 CONFIG_HASH_MISMATCH`.

The compiler changes only `frontmatter_hash` in the first metadata line:
- Previous:
`d2c371bf924eb254532ec722f31d817ebdb42fd4e5565b4952a40e09e465e0d1`
- Regenerated:
`eb116514f337eb247c8767becceaefdd9cfb69da65044098b5cdc510e7c2d153`

The new value matches the actual activation runtime recomputation in run
37503999448. All bytes after that metadata line are unchanged:
authorization, GPT-only inference, permission boundaries, publication,
hash checks, action/container pins and job conditions are preserved. Add
a deployment note requiring dependent lock recompilation after shared
import frontmatter changes. No workflow source, shared import, script or
C# changes.

Configuration validation:
- `git merge-base --is-ancestor 8c974ad
HEAD` — passed before editing; initial HEAD was exactly that deployed
squash merge.
- `gh aw compile issue-triage --strict --no-check-update` — passed; 1
workflow succeeded, 0 warnings, compiler v0.86.2.
- `gh aw hash-frontmatter .github/workflows/issue-triage.md` — passed;
output equals regenerated metadata and actual runtime hash above.
- `test "$(gh aw hash-frontmatter .github/workflows/issue-triage.md)" =
"$(head -n 1 .github/workflows/issue-triage.lock.yml | sed 's/^#
gh-aw-metadata: //' | jq -r .frontmatter_hash)"` — passed.
- `cmp <(git show HEAD:.github/workflows/issue-triage.lock.yml | tail -n
+2) <(tail -n +2 .github/workflows/issue-triage.lock.yml)` — passed
before committing; compiled lock excluding metadata is byte-identical to
deployed main.
- `actionlint -ignore 'unexpected key "queue" for "concurrency" section'
.github/workflows/issue-triage.lock.yml` — passed with actionlint
1.7.12; only the existing narrow compiler-generated queue exception.
- `git diff --check` — passed.

No pipeline/Pester/snapshot/synthetic fixture tests or product builds
were added or run. No production commands, dispatches or issue-label
mutations were performed for this correction. Post-merge production
outcome audit remains separate; local validation does not claim hosted
end-to-end success.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Follow-up to #39065. No issue is closed: the reproduced defect is the
activation failure in the linked actual production runs, not the
underlying product reports used as smoke-test targets.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
…#39188)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Fix a confirmed startup-deadline regression in the CI-fix Azure DevOps
dispatcher introduced by #39147, and correct a separate, pre-existing
producer prompt contradiction that blocks mandatory safe-output
registration.

**Production evidence:** [run
37477952193](https://github.com/dotnet/maui/actions/runs/37477952193)
spent approximately 533 seconds between starting the 420-second deadline
and completing trusted checkout; [run
37485076087](https://github.com/dotnet/maui/actions/runs/37485076087)
spent approximately 494 seconds. Both then failed with `The variable
cannot be validated because the value 0 is not a valid value for the
DispatcherBudgetSeconds variable.`

**Root cause:** The script parameter `[ValidateRange(1,
540)][int]$DispatcherBudgetSeconds` and top-level
`$script:DispatcherBudgetSeconds` are the same validated PowerShell
variable. Clamping valid caller input `420` against an already-expired
absolute deadline assigns `0` to that variable, triggering validation
before explicit budget-exhaustion reporting can run. Extracted helper
tests did not exercise this entrypoint initialization.

**Correction:**
- Store the clamped runtime allowance in the distinct
`EffectiveDispatcherBudgetSeconds` variable and update remaining-budget
helpers and their extracted-test state consistently. Caller budget `0`
remains invalid.
- Fail startup explicitly with `[dispatcher-budget-exhausted]` when
preparation has consumed the deadline, before PR discovery,
authentication, HTTP, or sleep. Write a failed preparation/deadline job
summary and state `No queue POST was attempted.` This also fails rather
than claiming successful no-work reconciliation when the deadline is
expired.
- Limit trusted checkout to the standalone
`/.github/scripts/Queue-CiFixAzdoValidation.ps1` using non-cone sparse
checkout. The existing SHA-pinned checkout v7.0.1 supports exact
patterns and automatically uses `blob:none` for sparse fetches. Preserve
`github.sha`, `fetch-depth: 1`, and `persist-credentials: false`; never
fetch or execute PR code.
- Document preparation behavior and limitations. Keep the absolute
pre-checkout 420-second deadline and ten-minute hard job timeout
unchanged; do not restart or extend either allowance.

**Validation:** Baseline dispatcher suite: 73 passed. Before the script
correction, the six new actual-entrypoint cases produced four expected
expired-deadline failures with the original validation exception and two
passing caller-validation/future-deadline cases. After correction, all
**79 tests passed**, including existing helper/queue regressions.
Expired cases assert the preparation summary, explicit prefix, no-POST
message, and zero HTTP/sleep calls; a native PowerShell process asserts
nonzero exit. The valid future deadline still produces the three
verified offline pipeline payloads.

Exact final commands and results:

```powershell
pwsh -NoProfile -Command '$env:PSModulePath = "/Users/shneuvil/.copilot/session-state/237fbb01-6532-4170-9f5e-6af14fa3a5e0/files/powershell-modules" + [IO.Path]::PathSeparator + $env:PSModulePath; Import-Module Pester -ErrorAction Stop; Invoke-Pester -Path .github/scripts/Queue-CiFixAzdoValidation.Tests.ps1 -Output Normal -CI'
# Passed: 79; failed/skipped: 0. Reused existing Pester; no dependency installation.

pwsh -NoProfile -Command '$files = @(".github/scripts/Queue-CiFixAzdoValidation.ps1", ".github/scripts/Queue-CiFixAzdoValidation.Tests.ps1"); foreach ($file in $files) { $tokens = $null; $errors = $null; [void][System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$errors); if ($errors.Count) { $errors | ForEach-Object { Write-Error $_ }; exit 1 }; Write-Output "Parse passed: $file" }'
# Passed: both PowerShell files parsed without errors.
```

```bash
actionlint .github/workflows/ci-fix-azdo-validation.yml
# Passed.
git diff --check
# Passed.
```

**Limits:** The sparse-checkout assertion is a static
configuration/trust regression, not a hosted checkout timing
measurement. Production checkout performance remains unproven; checkout
or PowerShell startup exceeding the ten-minute hard guard can still
cancel the job before a summary is written. No live Azure queue
requests, manual workflow dispatches/reruns, `/azp` requests, or
credential/permission/model-policy changes were performed. There is
still no successful eligible-PR Azure canary evidence here; this PR does
not establish Azure permissions or exact-head check linkage for any of
the three pipelines.

**Related producer blocker (pre-existing, not introduced by #39147):**
[main producer run
37464881821](https://github.com/dotnet/maui/actions/runs/37464881821)
and [net11 producer run
37465231994](https://github.com/dotnet/maui/actions/runs/37465231994)
concluded success but emitted `missing_tool` / `report_incomplete`. The
net11 diagnostic explicitly says mandatory expectation registration
requires PowerShell but the run instructions exclude it. The main
diagnostic likewise reports the prompt-specific `no-pwsh` restriction,
alongside separate unavailable cited Azure timeline evidence. This is an
upstream producer blocker: a compliant PR cannot reach dispatcher
validation if required registration is prohibited by its own prompt.

Both producers already allow `pwsh` in `tools.bash`, and Hard Rule 11
requires `Register-CiFixSafeOutputExpectation.ps1` or atomic
validation/registration via `Test-CiFixTransport.ps1`. Their bottom
Environment constraints sections nevertheless said `no pwsh`. The
mirrored correction changes only that prose: explicitly identify `pwsh`
availability for those deterministic helpers, retain `no gh` / `no
python` and `curl` + `jq` API guidance, and reiterate existing
fail-closed registration/transport requirements. No tool allowlists,
network, permissions, credentials, trust, model policy, or output gates
change.

Added two assertions in the existing registration test suite protecting
both producer twins. Both failed on the old contradictory guidance and
pass after correction. Regenerated both locks with retained **gh-aw
v0.86.2**, without manual edits or compiler upgrade; **only `body_hash`
changes**. Frontmatter and all generated lock runtime content remain
identical.

Additional exact validation commands and results:

```powershell
pwsh -NoProfile -Command '$env:PSModulePath = "/Users/shneuvil/.copilot/session-state/237fbb01-6532-4170-9f5e-6af14fa3a5e0/files/powershell-modules" + [IO.Path]::PathSeparator + $env:PSModulePath; Import-Module Pester -ErrorAction Stop; $config = New-PesterConfiguration; $config.Run.Path = @(".github/scripts/Register-CiFixSafeOutputExpectation.Tests.ps1", ".github/scripts/Test-CiFixTransport.Tests.ps1", ".github/scripts/Queue-CiFixAzdoValidation.Tests.ps1"); $config.Run.Exit = $true; $config.Output.Verbosity = "Normal"; $config.TestResult.Enabled = $true; $config.TestResult.OutputPath = "/Users/shneuvil/.copilot/session-state/1e0cc90a-a521-4055-9e7a-9565cdaf5504/files/producer-and-dispatcher-pester-results.xml"; Invoke-Pester -Configuration $config'
# Passed after lock regeneration: 116 tests (6 registration, 31 transport, 79 dispatcher); 0 failed/skipped.

pwsh -NoProfile -Command '$file = Join-Path $PWD ".github/scripts/Register-CiFixSafeOutputExpectation.Tests.ps1"; $tokens = $null; $errors = $null; [void][System.Management.Automation.Language.Parser]::ParseFile($file, [ref]$tokens, [ref]$errors); if ($errors.Count) { $errors | ForEach-Object { Write-Error $_ }; exit 1 }; Write-Output "PowerShell parse passed"'
# Passed.
```

```bash
/Users/shneuvil/.copilot/session-state/237fbb01-6532-4170-9f5e-6af14fa3a5e0/files/tools/gh-aw-0.86.2/darwin-arm64 compile ci-status-fix ci-status-fix-net11 --strict --no-emit --no-check-update
# Passed: 2 workflows, 0 warnings.
/Users/shneuvil/.copilot/session-state/237fbb01-6532-4170-9f5e-6af14fa3a5e0/files/tools/gh-aw-0.86.2/darwin-arm64 compile ci-status-fix ci-status-fix-net11 --strict --no-check-update
# Passed: 2 workflows, 0 warnings; emitted body-hash-only changes.
actionlint .github/workflows/ci-status-fix.lock.yml .github/workflows/ci-status-fix-net11.lock.yml
# Nonzero both before and after regeneration: identical six baseline diagnostics.
# Each twin: concurrency.queue not recognized, ShellCheck SC2129 style, github.aw expression not recognized.
# No new lint findings; baseline/after outputs compared byte-identical.
```

**Producer limits:** These are static prompt/configuration assertions
and offline helper tests, not a hosted agent behavior evaluation.
Removing the contradiction does not guarantee that an agent will
register correctly, find a viable product fix, create a PR, or attach
Azure checks. Separate cited-timeline failures and other producer
blockers are not fixed here. No live workflow or network validation
tests were run.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Follow-up to #39147 for the production startup regression evidenced by
the two linked dispatcher runs, plus the separate pre-existing producer
helper-guidance contradiction evidenced by the two producer runs. No
separate tracking issue is closed by this PR.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e0cc90a-a521-4055-9e7a-9565cdaf5504
Updated
[Microsoft.AspNetCore.Authentication.Facebook](https://github.com/dotnet/dotnet)
from 10.0.0 to 10.0.13.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.AspNetCore.Authentication.Facebook's
releases](https://github.com/dotnet/dotnet/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>

Updated
[Microsoft.AspNetCore.Authentication.Google](https://github.com/dotnet/dotnet)
from 10.0.0 to 10.0.13.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.AspNetCore.Authentication.Google's
releases](https://github.com/dotnet/dotnet/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>

Updated
[Microsoft.AspNetCore.Authentication.MicrosoftAccount](https://github.com/dotnet/dotnet)
from 10.0.0 to 10.0.13.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.AspNetCore.Authentication.MicrosoftAccount's
releases](https://github.com/dotnet/dotnet/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…etrics

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:31
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 7, 2026 16:31 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39230

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39230"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🔵 Needs a closer look

The platform renderer change appears sound, but CI remains pending and the Appium regression test has not been executed end-to-end.

0 open findings

What changed in this PR

Centers visible FontImageSource glyph ink on iOS 26 while preserving existing image dimensions and legacy behavior.

Changes:

  • Uses CoreText glyph-path bounds for optical centering.
  • Adds native rendering and compatibility coverage.
  • Adds an iOS Shell reproduction and screenshot-centroid test.
File Description
src/​Core/​src/​ImageSources/​iOS/​ImageSourceExtensions.cs Adds iOS 26 glyph centering.
src/​Core/​tests/​DeviceTests/​Services/​ImageSource/​FontImageSourceServiceTests.iOS.cs Tests centering, dimensions, colors, fonts, and rendering modes.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue31936.cs Adds the Shell reproduction.
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue31936.cs Adds the iOS visual regression test.

🧠 Review effort: Balanced

@PureWeen PureWeen 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.

Adversarial review

Reviewed commit 2781d7f3c389e1b193d7351cc2f5463f97977cea with 3 independent reviewers with adversarial consensus.

Independent reviewer assessment: No verified PR-caused correctness defect survived review. The independent passes traced FontImageSource loading into the Shell back button, checked the CoreText coordinate flip and ink-centering offsets, retained renderer dimensions, legacy fallback for unusable path bounds, color/rendering modes, native object lifetime, relevant history, and the new navigation and image-analysis scenarios.

Follow-up observation - Mac Catalyst scope: The guard in src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs:47 also selects the new drawing path on Mac Catalyst 26+. .NET documents IsIOSVersionAtLeast as covering iOS/MacCatalyst; the runtime implementation and the existing explicit Catalyst exclusion in StepperHandler.iOS.cs confirm this. Consequently, the description's statement that MacCatalyst retains the original drawing path is inaccurate. Align the documented scope with the implementation: explicitly exclude Catalyst if legacy placement is intended, or document and validate its inclusion. This is a verified scope mismatch, not an established harmful Catalyst rendering regression, so it is not reported as a severity finding.

Coverage and limits: The seven new native glyph cases exercise the actual renderer across glyphs, sizes, scales, a combining mark and a custom font; two additional cases check color/rendering-mode behavior. The iOS 26 UI scenario measures the back glyph and exercises navigation. This Windows-hosted review did not independently run native Apple tests, the full Appium fixture, or the original OpenSansSemibold ManualTests reproduction. The author-reported before/after results were not independently reproduced, and no Catalyst 26+ visual comparison was established.

No substantive existing reviews or inline review threads were present in the initial review snapshot. This COMMENT is a code assessment, not an approval.

Scope: code review only. CI/check status and merge readiness were not evaluated; use the repository's CI-analysis workflow for that assessment.

@kubaflo

kubaflo commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@kubaflo

This comment has been minimized.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@kubaflo — test-failure analysis for commit 2781d7f.

Scope CI failures Commit 2781d7f


🧪 CI Analysis — click to expand
📊 maui-pr

No failures found.


🧪 maui-pr-devicetests

No failures found.


🧪 maui-pr-uitests

🧭 Follow-up — actions and refresh

Next action: Wait; restore complete results and snapshots before refreshing.

Maintainers: comment /review tests to refresh this report.

Review the three failing CI snapshots and refresh the complete button layout and spacing scenario using real source-built HostApp captures. Preserve older-iOS snapshots and the existing visual comparison threshold.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 22:40
@kubaflo

kubaflo commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

🟡 Changes recommended

The iOS version guard also matches MacCatalyst 26, unintentionally changing and testing behavior the PR says must remain unchanged.

2 open findings

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

var ink = GetGlyphInkBounds(image);
Assert.True(ink.Width > 0 && ink.Height > 0, "The glyph must contain visible ink.");

if (OperatingSystem.IsIOSVersionAtLeast(26))

return renderer.CreateImage((context) =>
{
if (OperatingSystem.IsIOSVersionAtLeast(26))

@PureWeen PureWeen 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.

Adversarial review

Reviewed exact commit 9699ac1d1802dc92c5b9c295fce2e7a2545623ab with 3 independent reviewers with adversarial consensus.

independent reviewer assessment: No new verified PR-caused code defects or unintended snapshot regressions were found. The independent passes inspected the four changed C# files and all five binary baselines, including their complete ImageButton, ToolbarItem, Button, Shell-navigation, and native image-source scenarios. Checks covered CoreText coordinate transforms and ink centering, retained image dimensions and scale, color/rendering modes, native lifetime, unusable-bounds fallback, command binding, screenshot measurements, and the applicable platform paths.

Updated baselines: All five iOS 26 images retain their 1124 x 2286 dimensions and alpha behavior. Full-color before/after comparisons localized the substantive changes to font-glyph placement: the home icon shifts horizontally into ink-centered alignment, while button and toolbar glyphs move upward. Glyph appearance and colors, surrounding text, borders, spacing, and layout remain consistent; small additional navigation-region differences are limited to one-channel-value pixel changes. The existing visual-comparison tolerance and older-iOS/other-platform baselines are unchanged. These inspections support the snapshot updates without relying solely on the author's claimed captures or successful comparisons.

Prior feedback: The earlier exact-head COMMENT and the two currently unresolved product/test guard threads were considered for duplicate suppression. Those threads already cover the fact that IsIOSVersionAtLeast(26) includes Mac Catalyst 26+, contrary to the description's legacy-path claim. This assessment does not duplicate or resolve them, and does not assert an independently demonstrated harmful Catalyst rendering regression.

Limits: This Windows-hosted assessment did not execute native Apple tests, the Appium fixture, or physical-device scenarios. Source and image-oracle analysis is not a fresh end-to-end rendering run, and the author-reported local/remote execution results were not independently reproduced here. This COMMENT is not an approval.

Scope: code review only. CI/check status and merge readiness were not evaluated; use the repository's CI-analysis workflow for that assessment.

@kubaflo
kubaflo changed the base branch from main to inflight/candidate October 8, 2026 10:28
@kubaflo
kubaflo merged commit d542b37 into inflight/candidate Oct 8, 2026
174 of 191 checks passed
@kubaflo
kubaflo deleted the kubaflo-ios-glyph-centering branch October 8, 2026 10:30
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 8, 2026
kubaflo added a commit that referenced this pull request Oct 13, 2026
…etrics (#39230)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- Enter description of the fix in this section -->

Ports the issue reproduction and font-image centering approach from
[kubaflo#719](kubaflo#719), with
additional native regression coverage and fresh before/after
verification against upstream `main`
(`84b1fb39ad56e22a51d29d4bbf141b03b02e4648`).

**Root cause:** centering a font's typographic line box does not
necessarily center the visible glyph. The difference is visible in the
iOS 26 glass navigation back button used by ManualTests **Categories →
Commands → G4**.

**Fix:** on iOS 26+, use CoreText glyph-path bounds to center the actual
ink in the existing image renderer. Unlike the source PR, this does
**not** compress glyphs horizontally by 0.75 or crop the image height.
It retains the original image dimensions, natural glyph shape, color,
and rendering mode. Older iOS and MacCatalyst retain the original
drawing path; glyphs without usable path bounds also retain that path.

**Coverage:** adds a Shell reproduction with OpenSansRegular, a valid
bound back command, and an iOS screenshot-centroid regression test. Adds
nine native image-source cases covering multiple glyphs, sizes, scales,
a combining mark, a bundled custom font, image/ink dimensions, colors,
and rendering modes. Updates five reviewed `ios-26` visual baselines for
existing ImageButton, ToolbarItem, and Button scenarios; older-iOS and
other-platform snapshots and all test tolerances remain unchanged.

Both apps were built from this worktree's source project references, not
substituted packaged MAUI libraries. The original ManualTests G4 files,
including their OpenSansSemibold icon, were left unchanged.

| Scenario | Unfixed product | Fixed product |
| --- | --- | --- |
| Original ManualTests G4, iOS 26.5 | Glyph midpoint **3.83 pt below**
button center | **0.17 pt below** center |
| Original G4 glyph ink dimensions | **22 × 38 physical pixels** | **22
× 38 physical pixels**, unchanged |
| New HostApp issue scenario, iOS 26.5 | Glyph midpoint **4.00 pt
below** center | **0.00 pt** offset |
| Native `FontImageSourceServiceTests`, iOS 26.5 | **16 executed: 10
passed, 6 centering cases failed** | **16 executed: 16 passed, 0
failed** |
| Native compatibility run, iOS 18.5 | Not rerun as an unfixed control |
**16 executed: 16 passed, 0 failed** |

Measurements use the native accessibility back-button frame and
screenshot ink, excluding the glass rim. Six new centering assertions
were proven to fail with **only the product fix removed**, while the
existing tests and rendering-mode cases passed. Restoring the fix made
the entire selected suite pass.

The compiled UI test's actual `MeasureGlyphOffset` method was also
executed offline against the real HostApp screenshots: the unchanged
product failed its 1-point tolerance, and the fixed product passed,
using both floor and nearest integer conversions of accessibility
frames. Both apps' back navigation was exercised and recorded. The
original G4 app has a pre-existing `BackCommand`/`GoBackCommand`
binding-name mismatch; that was not modified or treated as proof of a
valid command invocation. The new reproduction has a matching command
binding.

**No XCTest, WebDriverAgent, or Appium iOS execution was used locally.**
Navigation, screenshots, and recordings used dedicated background
simulators; native xUnit tests ran through the repository's managed
XHarness test app launched with `simctl`. The complete NUnit/Appium UI
fixture was compiled but **not executed through its driver locally**. No
physical-device verification is claimed.

Raw simulator recordings, without overlays or rescaling. Each
demonstrates opening G4, using the custom back button, and opening G4
again.

**Original ManualTests app — before**

https://github.com/user-attachments/assets/46c57727-f03a-4c7c-ab2b-91f957d2b9f4

**Original ManualTests app — after**

https://github.com/user-attachments/assets/227a9545-319d-4db6-ac39-fb0b357e7483

**New HostApp reproduction — before**

https://github.com/user-attachments/assets/16cd530d-fe9d-4d42-9be4-50cc692fc820

**New HostApp reproduction — after**

https://github.com/user-attachments/assets/a08b273b-f91b-4a01-84c9-58bef36aa010

`A` below is the local evidence directory; these are the exact
session-helper invocations used. Build helpers invoke `dotnet build` on
the checked-in projects with `UseMaui=false`, source references, the
original net10 target frameworks, and `iossimulator-arm64`. Native
execution helpers install the checked-in test app, launch its managed
runner, and assert fresh xUnit XML contains exactly the 16 selected
cases.

| Command | Result |
| --- | --- |
| `bash "$A/verification-build.sh" app final-fixed` | ManualTests built;
0 warnings/errors |
| `bash "$A/verification-build.sh" host final-fixed` | HostApp built; 0
warnings/errors |
| `bash "$A/verification-build.sh" device final-fixed` |
Core.DeviceTests built; 0 warnings/errors |
| `bash "$A/verification-build.sh" ui-tests final-fixed` | iOS NUnit
assembly built; 0 warnings/errors |
| `python3 "$A/run-image-source-tests.py" unfixed-control-native fail` |
Expected regression reproduced: 6 centering failures, 10 passes |
| `python3 "$A/run-image-source-tests.py" final-fixed-native pass` | iOS
26.5: 16/16 passed |
| `python3 "$A/run-image-source-tests.py" final-ios18-compatibility pass
4DAEF62A-DEB2-48AC-B9B4-AA491DFAE3A1` | iOS 18.5: 16/16 passed |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
unfixed-hostapp fail` | Compiled screenshot oracle reproduced the
mismatch |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
final-fixed-hostapp pass` | Compiled screenshot oracle passed the
1-point tolerance |

Repository `dotnet format Microsoft.Maui.sln --no-restore --exclude
Templates/src --exclude-diagnostics CA1822` was run with `--include`
restricted to the four changed code files: exit 0, no formatting
changes; workspace-loading warnings were reported. `git diff --check`
passed.

**Toolchain qualifications:** the exact repository servicing SDK was
unavailable, so an external SDK-selection directory pinned installed
.NET SDK **10.0.100**, without modifying `global.json` or changing the
framework targets. Builds used the installed iOS SDK **26.0.11017**,
Xcode **26.6**, `ValidateXcodeVersion=false`, and ad-hoc simulator
signing (`EnableCodeSigning=true`, `CodesignKey=-`,
`CodesignRequireProvisioningProfile=false`). iOS 26.5 ran on an iPhone
17 Pro Max simulator; the compatibility run used an iPhone 16 Pro Max
simulator on iOS 18.5. CI results are separate from these local results.

The first full CI cycle at `2781d7f3c3` passed
[maui-pr](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626655)
and
[maui-pr-devicetests](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626657).
The actual results XML from both iOS Core Helix work items confirms
**16/16 `FontImageSourceServiceTests` passed**, including all nine new
cases; all seven device-test Helix job inventories were inspected for
hidden failures.

In [maui-pr-uitests build
1626656](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626656),
**`Issue31936.FontImageSourceBackGlyphIsVerticallyCentered` actually
passed** (run `45111838`, result `100329`, 4.703 seconds). This is an
executed CI UI test result, not an inference from its attributes or the
job status. The overall UI pipeline was not green.

Three iOS 26 visual failures reflect the intentional font-image ink
placement change: `Issue13474Test`, `VerifyToolbarItemIconColor`, and
`Issue22433_Default`. Their actual CI images were reviewed and copied as
the new baselines. The Button test stops at Default on failure, so its
subsequent `Issue22433_Layout` and `Issue22433_Spacing` pages were also
exercised and captured in the source-built HostApp on a dedicated
background **iPhone 11 Pro / iOS 26.5**. The Default capture was
**pixel-identical to CI**, including alpha, after the normal
status/home-indicator crop and excluding the single right-edge pixel
absent from CI's screenshot. No resizing or image compositing was used.

The two follow-on captures preserve all button text, borders,
dimensions, padding, and spacing; their differences are the centered
font-image glyphs plus negligible one-channel-value navigation-shadow
noise. Only the five `ios-26` PNGs changed. No assertions, tolerance
settings, older-iOS baselines, or other-platform baselines were weakened
or replaced.

The compiled repository `MagickNetVisualComparer`, using its unchanged
**0.005 / 0.5%** threshold, rejected all five old baselines and accepted
all five replacements. `S` below denotes this worktree's
`src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26` directory;
comparer commands ran from the external SDK-selection directory
described above.

| Command | Result |
| --- | --- |
| `python3 "$A/capture-ci-button-snapshots.py"` | All three Button pages
captured twice; repeated body pixels identical, Default matches CI
exactly; no local XCTest or UI driver |
| `dotnet run --project ../snapshot-oracle/SnapshotOracle.csproj -- "$S"
fail` | Expected mismatches verified for all five old baselines: 1.06%,
0.79%, 1.37%, 1.03%, 1.03% |
| `dotnet run --no-build --project
../snapshot-oracle/SnapshotOracle.csproj -- "$S" pass` | All five
replacement baselines passed the actual repository comparer |

The snapshot-only follow-up is `9699ac1d18`. Fresh remote UI validation
has been
[requested](#39230 (comment));
remaining UI failure attribution and the new CI cycle are not claimed
complete or green.

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #31936

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------
kubaflo added a commit that referenced this pull request Oct 14, 2026
…etrics (#39230)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- Enter description of the fix in this section -->

Ports the issue reproduction and font-image centering approach from
[kubaflo#719](kubaflo#719), with
additional native regression coverage and fresh before/after
verification against upstream `main`
(`84b1fb39ad56e22a51d29d4bbf141b03b02e4648`).

**Root cause:** centering a font's typographic line box does not
necessarily center the visible glyph. The difference is visible in the
iOS 26 glass navigation back button used by ManualTests **Categories →
Commands → G4**.

**Fix:** on iOS 26+, use CoreText glyph-path bounds to center the actual
ink in the existing image renderer. Unlike the source PR, this does
**not** compress glyphs horizontally by 0.75 or crop the image height.
It retains the original image dimensions, natural glyph shape, color,
and rendering mode. Older iOS and MacCatalyst retain the original
drawing path; glyphs without usable path bounds also retain that path.

**Coverage:** adds a Shell reproduction with OpenSansRegular, a valid
bound back command, and an iOS screenshot-centroid regression test. Adds
nine native image-source cases covering multiple glyphs, sizes, scales,
a combining mark, a bundled custom font, image/ink dimensions, colors,
and rendering modes. Updates five reviewed `ios-26` visual baselines for
existing ImageButton, ToolbarItem, and Button scenarios; older-iOS and
other-platform snapshots and all test tolerances remain unchanged.

Both apps were built from this worktree's source project references, not
substituted packaged MAUI libraries. The original ManualTests G4 files,
including their OpenSansSemibold icon, were left unchanged.

| Scenario | Unfixed product | Fixed product |
| --- | --- | --- |
| Original ManualTests G4, iOS 26.5 | Glyph midpoint **3.83 pt below**
button center | **0.17 pt below** center |
| Original G4 glyph ink dimensions | **22 × 38 physical pixels** | **22
× 38 physical pixels**, unchanged |
| New HostApp issue scenario, iOS 26.5 | Glyph midpoint **4.00 pt
below** center | **0.00 pt** offset |
| Native `FontImageSourceServiceTests`, iOS 26.5 | **16 executed: 10
passed, 6 centering cases failed** | **16 executed: 16 passed, 0
failed** |
| Native compatibility run, iOS 18.5 | Not rerun as an unfixed control |
**16 executed: 16 passed, 0 failed** |

Measurements use the native accessibility back-button frame and
screenshot ink, excluding the glass rim. Six new centering assertions
were proven to fail with **only the product fix removed**, while the
existing tests and rendering-mode cases passed. Restoring the fix made
the entire selected suite pass.

The compiled UI test's actual `MeasureGlyphOffset` method was also
executed offline against the real HostApp screenshots: the unchanged
product failed its 1-point tolerance, and the fixed product passed,
using both floor and nearest integer conversions of accessibility
frames. Both apps' back navigation was exercised and recorded. The
original G4 app has a pre-existing `BackCommand`/`GoBackCommand`
binding-name mismatch; that was not modified or treated as proof of a
valid command invocation. The new reproduction has a matching command
binding.

**No XCTest, WebDriverAgent, or Appium iOS execution was used locally.**
Navigation, screenshots, and recordings used dedicated background
simulators; native xUnit tests ran through the repository's managed
XHarness test app launched with `simctl`. The complete NUnit/Appium UI
fixture was compiled but **not executed through its driver locally**. No
physical-device verification is claimed.

Raw simulator recordings, without overlays or rescaling. Each
demonstrates opening G4, using the custom back button, and opening G4
again.

**Original ManualTests app — before**

https://github.com/user-attachments/assets/46c57727-f03a-4c7c-ab2b-91f957d2b9f4

**Original ManualTests app — after**

https://github.com/user-attachments/assets/227a9545-319d-4db6-ac39-fb0b357e7483

**New HostApp reproduction — before**

https://github.com/user-attachments/assets/16cd530d-fe9d-4d42-9be4-50cc692fc820

**New HostApp reproduction — after**

https://github.com/user-attachments/assets/a08b273b-f91b-4a01-84c9-58bef36aa010

`A` below is the local evidence directory; these are the exact
session-helper invocations used. Build helpers invoke `dotnet build` on
the checked-in projects with `UseMaui=false`, source references, the
original net10 target frameworks, and `iossimulator-arm64`. Native
execution helpers install the checked-in test app, launch its managed
runner, and assert fresh xUnit XML contains exactly the 16 selected
cases.

| Command | Result |
| --- | --- |
| `bash "$A/verification-build.sh" app final-fixed` | ManualTests built;
0 warnings/errors |
| `bash "$A/verification-build.sh" host final-fixed` | HostApp built; 0
warnings/errors |
| `bash "$A/verification-build.sh" device final-fixed` |
Core.DeviceTests built; 0 warnings/errors |
| `bash "$A/verification-build.sh" ui-tests final-fixed` | iOS NUnit
assembly built; 0 warnings/errors |
| `python3 "$A/run-image-source-tests.py" unfixed-control-native fail` |
Expected regression reproduced: 6 centering failures, 10 passes |
| `python3 "$A/run-image-source-tests.py" final-fixed-native pass` | iOS
26.5: 16/16 passed |
| `python3 "$A/run-image-source-tests.py" final-ios18-compatibility pass
4DAEF62A-DEB2-48AC-B9B4-AA491DFAE3A1` | iOS 18.5: 16/16 passed |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
unfixed-hostapp fail` | Compiled screenshot oracle reproduced the
mismatch |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
final-fixed-hostapp pass` | Compiled screenshot oracle passed the
1-point tolerance |

Repository `dotnet format Microsoft.Maui.sln --no-restore --exclude
Templates/src --exclude-diagnostics CA1822` was run with `--include`
restricted to the four changed code files: exit 0, no formatting
changes; workspace-loading warnings were reported. `git diff --check`
passed.

**Toolchain qualifications:** the exact repository servicing SDK was
unavailable, so an external SDK-selection directory pinned installed
.NET SDK **10.0.100**, without modifying `global.json` or changing the
framework targets. Builds used the installed iOS SDK **26.0.11017**,
Xcode **26.6**, `ValidateXcodeVersion=false`, and ad-hoc simulator
signing (`EnableCodeSigning=true`, `CodesignKey=-`,
`CodesignRequireProvisioningProfile=false`). iOS 26.5 ran on an iPhone
17 Pro Max simulator; the compatibility run used an iPhone 16 Pro Max
simulator on iOS 18.5. CI results are separate from these local results.

The first full CI cycle at `2781d7f3c3` passed
[maui-pr](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626655)
and
[maui-pr-devicetests](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626657).
The actual results XML from both iOS Core Helix work items confirms
**16/16 `FontImageSourceServiceTests` passed**, including all nine new
cases; all seven device-test Helix job inventories were inspected for
hidden failures.

In [maui-pr-uitests build
1626656](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626656),
**`Issue31936.FontImageSourceBackGlyphIsVerticallyCentered` actually
passed** (run `45111838`, result `100329`, 4.703 seconds). This is an
executed CI UI test result, not an inference from its attributes or the
job status. The overall UI pipeline was not green.

Three iOS 26 visual failures reflect the intentional font-image ink
placement change: `Issue13474Test`, `VerifyToolbarItemIconColor`, and
`Issue22433_Default`. Their actual CI images were reviewed and copied as
the new baselines. The Button test stops at Default on failure, so its
subsequent `Issue22433_Layout` and `Issue22433_Spacing` pages were also
exercised and captured in the source-built HostApp on a dedicated
background **iPhone 11 Pro / iOS 26.5**. The Default capture was
**pixel-identical to CI**, including alpha, after the normal
status/home-indicator crop and excluding the single right-edge pixel
absent from CI's screenshot. No resizing or image compositing was used.

The two follow-on captures preserve all button text, borders,
dimensions, padding, and spacing; their differences are the centered
font-image glyphs plus negligible one-channel-value navigation-shadow
noise. Only the five `ios-26` PNGs changed. No assertions, tolerance
settings, older-iOS baselines, or other-platform baselines were weakened
or replaced.

The compiled repository `MagickNetVisualComparer`, using its unchanged
**0.005 / 0.5%** threshold, rejected all five old baselines and accepted
all five replacements. `S` below denotes this worktree's
`src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26` directory;
comparer commands ran from the external SDK-selection directory
described above.

| Command | Result |
| --- | --- |
| `python3 "$A/capture-ci-button-snapshots.py"` | All three Button pages
captured twice; repeated body pixels identical, Default matches CI
exactly; no local XCTest or UI driver |
| `dotnet run --project ../snapshot-oracle/SnapshotOracle.csproj -- "$S"
fail` | Expected mismatches verified for all five old baselines: 1.06%,
0.79%, 1.37%, 1.03%, 1.03% |
| `dotnet run --no-build --project
../snapshot-oracle/SnapshotOracle.csproj -- "$S" pass` | All five
replacement baselines passed the actual repository comparer |

The snapshot-only follow-up is `9699ac1d18`. Fresh remote UI validation
has been
[requested](#39230 (comment));
remaining UI failure attribution and the new CI cycle are not claimed
complete or green.

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #31936

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------
kubaflo added a commit that referenced this pull request Oct 18, 2026
…etrics (#39230)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- Enter description of the fix in this section -->

Ports the issue reproduction and font-image centering approach from
[kubaflo#719](kubaflo#719), with
additional native regression coverage and fresh before/after
verification against upstream `main`
(`84b1fb39ad56e22a51d29d4bbf141b03b02e4648`).

**Root cause:** centering a font's typographic line box does not
necessarily center the visible glyph. The difference is visible in the
iOS 26 glass navigation back button used by ManualTests **Categories →
Commands → G4**.

**Fix:** on iOS 26+, use CoreText glyph-path bounds to center the actual
ink in the existing image renderer. Unlike the source PR, this does
**not** compress glyphs horizontally by 0.75 or crop the image height.
It retains the original image dimensions, natural glyph shape, color,
and rendering mode. Older iOS and MacCatalyst retain the original
drawing path; glyphs without usable path bounds also retain that path.

**Coverage:** adds a Shell reproduction with OpenSansRegular, a valid
bound back command, and an iOS screenshot-centroid regression test. Adds
nine native image-source cases covering multiple glyphs, sizes, scales,
a combining mark, a bundled custom font, image/ink dimensions, colors,
and rendering modes. Updates five reviewed `ios-26` visual baselines for
existing ImageButton, ToolbarItem, and Button scenarios; older-iOS and
other-platform snapshots and all test tolerances remain unchanged.

Both apps were built from this worktree's source project references, not
substituted packaged MAUI libraries. The original ManualTests G4 files,
including their OpenSansSemibold icon, were left unchanged.

| Scenario | Unfixed product | Fixed product |
| --- | --- | --- |
| Original ManualTests G4, iOS 26.5 | Glyph midpoint **3.83 pt below**
button center | **0.17 pt below** center |
| Original G4 glyph ink dimensions | **22 × 38 physical pixels** | **22
× 38 physical pixels**, unchanged |
| New HostApp issue scenario, iOS 26.5 | Glyph midpoint **4.00 pt
below** center | **0.00 pt** offset |
| Native `FontImageSourceServiceTests`, iOS 26.5 | **16 executed: 10
passed, 6 centering cases failed** | **16 executed: 16 passed, 0
failed** |
| Native compatibility run, iOS 18.5 | Not rerun as an unfixed control |
**16 executed: 16 passed, 0 failed** |

Measurements use the native accessibility back-button frame and
screenshot ink, excluding the glass rim. Six new centering assertions
were proven to fail with **only the product fix removed**, while the
existing tests and rendering-mode cases passed. Restoring the fix made
the entire selected suite pass.

The compiled UI test's actual `MeasureGlyphOffset` method was also
executed offline against the real HostApp screenshots: the unchanged
product failed its 1-point tolerance, and the fixed product passed,
using both floor and nearest integer conversions of accessibility
frames. Both apps' back navigation was exercised and recorded. The
original G4 app has a pre-existing `BackCommand`/`GoBackCommand`
binding-name mismatch; that was not modified or treated as proof of a
valid command invocation. The new reproduction has a matching command
binding.

**No XCTest, WebDriverAgent, or Appium iOS execution was used locally.**
Navigation, screenshots, and recordings used dedicated background
simulators; native xUnit tests ran through the repository's managed
XHarness test app launched with `simctl`. The complete NUnit/Appium UI
fixture was compiled but **not executed through its driver locally**. No
physical-device verification is claimed.

Raw simulator recordings, without overlays or rescaling. Each
demonstrates opening G4, using the custom back button, and opening G4
again.

**Original ManualTests app — before**

https://github.com/user-attachments/assets/46c57727-f03a-4c7c-ab2b-91f957d2b9f4

**Original ManualTests app — after**

https://github.com/user-attachments/assets/227a9545-319d-4db6-ac39-fb0b357e7483

**New HostApp reproduction — before**

https://github.com/user-attachments/assets/16cd530d-fe9d-4d42-9be4-50cc692fc820

**New HostApp reproduction — after**

https://github.com/user-attachments/assets/a08b273b-f91b-4a01-84c9-58bef36aa010

`A` below is the local evidence directory; these are the exact
session-helper invocations used. Build helpers invoke `dotnet build` on
the checked-in projects with `UseMaui=false`, source references, the
original net10 target frameworks, and `iossimulator-arm64`. Native
execution helpers install the checked-in test app, launch its managed
runner, and assert fresh xUnit XML contains exactly the 16 selected
cases.

| Command | Result |
| --- | --- |
| `bash "$A/verification-build.sh" app final-fixed` | ManualTests built;
0 warnings/errors |
| `bash "$A/verification-build.sh" host final-fixed` | HostApp built; 0
warnings/errors |
| `bash "$A/verification-build.sh" device final-fixed` |
Core.DeviceTests built; 0 warnings/errors |
| `bash "$A/verification-build.sh" ui-tests final-fixed` | iOS NUnit
assembly built; 0 warnings/errors |
| `python3 "$A/run-image-source-tests.py" unfixed-control-native fail` |
Expected regression reproduced: 6 centering failures, 10 passes |
| `python3 "$A/run-image-source-tests.py" final-fixed-native pass` | iOS
26.5: 16/16 passed |
| `python3 "$A/run-image-source-tests.py" final-ios18-compatibility pass
4DAEF62A-DEB2-48AC-B9B4-AA491DFAE3A1` | iOS 18.5: 16/16 passed |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
unfixed-hostapp fail` | Compiled screenshot oracle reproduced the
mismatch |
| `dotnet run --no-build --project ../oracle/Oracle.csproj --
final-fixed-hostapp pass` | Compiled screenshot oracle passed the
1-point tolerance |

Repository `dotnet format Microsoft.Maui.sln --no-restore --exclude
Templates/src --exclude-diagnostics CA1822` was run with `--include`
restricted to the four changed code files: exit 0, no formatting
changes; workspace-loading warnings were reported. `git diff --check`
passed.

**Toolchain qualifications:** the exact repository servicing SDK was
unavailable, so an external SDK-selection directory pinned installed
.NET SDK **10.0.100**, without modifying `global.json` or changing the
framework targets. Builds used the installed iOS SDK **26.0.11017**,
Xcode **26.6**, `ValidateXcodeVersion=false`, and ad-hoc simulator
signing (`EnableCodeSigning=true`, `CodesignKey=-`,
`CodesignRequireProvisioningProfile=false`). iOS 26.5 ran on an iPhone
17 Pro Max simulator; the compatibility run used an iPhone 16 Pro Max
simulator on iOS 18.5. CI results are separate from these local results.

The first full CI cycle at `2781d7f3c3` passed
[maui-pr](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626655)
and
[maui-pr-devicetests](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626657).
The actual results XML from both iOS Core Helix work items confirms
**16/16 `FontImageSourceServiceTests` passed**, including all nine new
cases; all seven device-test Helix job inventories were inspected for
hidden failures.

In [maui-pr-uitests build
1626656](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626656),
**`Issue31936.FontImageSourceBackGlyphIsVerticallyCentered` actually
passed** (run `45111838`, result `100329`, 4.703 seconds). This is an
executed CI UI test result, not an inference from its attributes or the
job status. The overall UI pipeline was not green.

Three iOS 26 visual failures reflect the intentional font-image ink
placement change: `Issue13474Test`, `VerifyToolbarItemIconColor`, and
`Issue22433_Default`. Their actual CI images were reviewed and copied as
the new baselines. The Button test stops at Default on failure, so its
subsequent `Issue22433_Layout` and `Issue22433_Spacing` pages were also
exercised and captured in the source-built HostApp on a dedicated
background **iPhone 11 Pro / iOS 26.5**. The Default capture was
**pixel-identical to CI**, including alpha, after the normal
status/home-indicator crop and excluding the single right-edge pixel
absent from CI's screenshot. No resizing or image compositing was used.

The two follow-on captures preserve all button text, borders,
dimensions, padding, and spacing; their differences are the centered
font-image glyphs plus negligible one-channel-value navigation-shadow
noise. Only the five `ios-26` PNGs changed. No assertions, tolerance
settings, older-iOS baselines, or other-platform baselines were weakened
or replaced.

The compiled repository `MagickNetVisualComparer`, using its unchanged
**0.005 / 0.5%** threshold, rejected all five old baselines and accepted
all five replacements. `S` below denotes this worktree's
`src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26` directory;
comparer commands ran from the external SDK-selection directory
described above.

| Command | Result |
| --- | --- |
| `python3 "$A/capture-ci-button-snapshots.py"` | All three Button pages
captured twice; repeated body pixels identical, Default matches CI
exactly; no local XCTest or UI driver |
| `dotnet run --project ../snapshot-oracle/SnapshotOracle.csproj -- "$S"
fail` | Expected mismatches verified for all five old baselines: 1.06%,
0.79%, 1.37%, 1.03%, 1.03% |
| `dotnet run --no-build --project
../snapshot-oracle/SnapshotOracle.csproj -- "$S" pass` | All five
replacement baselines passed the actual repository comparer |

The snapshot-only follow-up is `9699ac1d18`. Fresh remote UI validation
has been
[requested](#39230 (comment));
remaining UI failure attribution and the new CI cycle are not claimed
complete or green.

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #31936

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

G4: Back button glyph (FontImageSource) is not vertically centered on iOS 26

3 participants