Repository navigation
Conversation
- SkiaSharp / SkiaSharp.Views.Maui.Controls / SkiaSharp.NativeAssets.Linux 4.153.1 -> 4.154.0 - HarfBuzzSharp / HarfBuzzSharp.NativeAssets.Linux 14.2.1.301 -> 14.2.1.400 - Pin MauiVersion to 10.0.120 (fixes Resizetizer MissingMethodException in 10.0.110) - Microsoft.Extensions.Logging.Debug 10.0.0 -> 10.0.14 - Microsoft.SourceLink.GitHub 10.0.402 -> 10.0.403 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apps built with the iOS 27 SDK crash on launch without a scene manifest (UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption). Add the standard MAUI UIApplicationSceneManifest and a SceneDelegate deriving from MauiUISceneDelegate for iOS and Mac Catalyst. Co-Authored-By: Claude Opus 5.5 <[email protected]>
d531eba to
82b2f90
Compare
HarfBuzz applies a legacy 'kern' table (e.g. Helvetica on iOS/macOS) by splitting the kerning between the first glyph's advance and the second glyph's x offset. The caret used the pen position and ignored the offset, so it landed halfway between the kerned and unkerned positions. Record each glyph's drawn x (pen + offset) instead. Fixes MeasureCaretOffset_IncludesKerningOfTheWholeRun on macOS. Co-Authored-By: Claude Opus 5.5 <[email protected]>
michaelstonis
left a comment
There was a problem hiding this comment.
Thanks for this! The kerning fix and the iOS 27 scene-lifecycle change both look good. A few things to sort out before merging, mostly housekeeping.
I merged this branch into current main locally (Linux) and ran the suites: Core.Tests 1186/1186 and SkiaSharp.Tests 33/33 pass. The MAUI library and sample can't be built on Linux, and CI hasn't run on this PR yet (fork workflows need maintainer approval).
1. Kerning fix (HarfBuzzTextShaper.cs): looks correct
- The comment matches how HarfBuzz applies a legacy
kerntable: half the kern goes on the first glyph's advance, and the rest on the second glyph's advance andx_offset. So the old caret position before the second glyph was off by half the kern. - Using the drawn x (
penX + XOffset) forGlyphXfixes that. Drawing is unchanged, sincePositionswas already computed that way. - Combining marks aren't affected: they share the base glyph's cluster, and
CaretOffsetonly reads the first glyph of each cluster. - Suggestion: a regression test would be good, if a small font with a legacy
kerntable could be added to the test project (the Linux CI fonts may not have one).
2. The PR description is out of date
Most of it describes an earlier version of the branch: the SkiaSharp 3 → 4 upgrade, the FilterQuality / SKSamplingOptions change, Svg.Skia and the test-stack upgrades are already on main and not in this diff. It also says tests/MintedTextEditor.SkiaSharp.Tests doesn't exist (it does) and reports 600 tests. Could you rewrite it to cover what's actually here: the kerning fix, the iOS / Mac Catalyst scene lifecycle in the sample, the MauiVersion pin, and the version bumps?
3. MauiVersion pin in src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
The Resizetizer crash only affects app builds, so the pin is needed in samples/SampleApp.Maui/SampleApp.Maui.csproj. In the library it also raises the minimum Microsoft.Maui.Controls version for everyone consuming the NuGet package to 10.0.120. Unless that's intended, I'd keep the pin in the sample only.
4. Scene lifecycle (sample only): looks right
SceneDelegate : MauiUISceneDelegate plus the UIApplicationSceneManifest in Info.plist is the standard setup. UIApplicationSupportsMultipleScenes = true allows multiple windows on iPad / Mac Catalyst. That's safe here because App.CreateWindow returns a new Window each time.
5. Overlap with the open Dependabot PRs
The version bumps here are behind what Dependabot now proposes:
- #49 has
Microsoft.SourceLink.GitHub11.0.100 (here: 10.0.403). - #52 has
SkiaSharp/SkiaSharp.NativeAssets.Linux4.157.0 andHarfBuzzSharp/HarfBuzzSharp.NativeAssets.Linux14.4.0.200 (here: 4.154.0 / 14.2.1.400).
Each of these PRs merges cleanly into main on its own, but this PR conflicts with #49 (Directory.Build.props) and #52 (both SkiaSharp .csproj files), only on those version lines. The suggested order is to merge #45, #51, #49 and #52 first, then this PR last. After merging main into this branch, it would need to:
- keep the newer versions from #49 and #52 in the conflicted lines;
- bump
SkiaSharp.Views.Maui.Controls(library and sample) to 4.157.0 so it matches core SkiaSharp (#52 doesn't touch it); - drop or justify the library
MauiVersionpin (point 3); - update the description (point 2).
Then CI can be approved and run on the result.
Generated by Claude Code
Summary
Upgrades all NuGet packages to their latest versions and fixes the sample app crashing on launch on iOS 27.
Package upgrades
MauiVersion, now pinned)Code changes
SKPaint.FilterQuality.SkiaDrawingContext.DrawImage/DrawTintedImagenow useSKSamplingOptions(SKCubicResampler.Mitchell), which is whatSKFilterQuality.Highmapped to. Bitmaps are drawn throughSKImage.FromBitmap.MauiVersionis pinned to 10.0.120 in the MAUI projects. MAUI 10.0.110's Resizetizer crashed while generating the sample's app icon (MissingMethodExceptiononHarfBuzzSharp.Font.SetVariations); 10.0.120 fixes it.Info.plistplus aSceneDelegate : MauiUISceneDelegate). Apps built with the iOS 27 SDK crash on launch without it (UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption).Testing
dotnet test tests/MintedTextEditor.Core.Tests: 600 passed, 0 failed.bin/objfolders) is needed so the newInfo.plistgets picked up.SupportedOSPlatformVersion(15.0) is below the 17.0 the installed Mac Catalyst SDK requires. That problem is unrelated to this PR.Checklist
dotnet testpasses fortests/MintedTextEditor.Core.Tests(tests/MintedTextEditor.SkiaSharp.Testsdoes not exist in the repo)src/have an entry under## [Unreleased]inCHANGELOG.md(or the PR has theskip-changeloglabel)docs/are updated where needed (no public API changes)