diff --git a/CHANGELOG.md b/CHANGELOG.md
index b14fbff..187add5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
+### Fixed
+- The caret and hit-testing between kerned letters (e.g. "AV", "To") now match where the letters are drawn on fonts whose kerning HarfBuzz applies as a glyph offset, such as Helvetica on iOS and macOS. The caret previously landed halfway between the kerned and unkerned positions.
+
---
## [0.4.0] — 2026-10-21
diff --git a/Directory.Build.props b/Directory.Build.props
index 5f6a42b..24a4b63 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -52,6 +52,6 @@
-
+
diff --git a/samples/SampleApp.Maui/Platforms/MacCatalyst/Info.plist b/samples/SampleApp.Maui/Platforms/MacCatalyst/Info.plist
index 37fcb9b..36bac62 100644
--- a/samples/SampleApp.Maui/Platforms/MacCatalyst/Info.plist
+++ b/samples/SampleApp.Maui/Platforms/MacCatalyst/Info.plist
@@ -16,6 +16,23 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneConfigurationName
+ __MAUI_DEFAULT_SCENE_CONFIGURATION__
+ UISceneDelegateClassName
+ SceneDelegate
+
+
+
+
XSAppIconAssets
Assets.xcassets/appicon.appiconset
diff --git a/samples/SampleApp.Maui/Platforms/MacCatalyst/SceneDelegate.cs b/samples/SampleApp.Maui/Platforms/MacCatalyst/SceneDelegate.cs
new file mode 100644
index 0000000..2961e1a
--- /dev/null
+++ b/samples/SampleApp.Maui/Platforms/MacCatalyst/SceneDelegate.cs
@@ -0,0 +1,10 @@
+using Foundation;
+
+namespace SampleApp.Maui;
+
+// UIScene lifecycle entry point (required by the iOS 27 SDK).
+// Referenced by UISceneDelegateClassName in Info.plist.
+[Register("SceneDelegate")]
+public class SceneDelegate : MauiUISceneDelegate
+{
+}
diff --git a/samples/SampleApp.Maui/Platforms/iOS/Info.plist b/samples/SampleApp.Maui/Platforms/iOS/Info.plist
index c96dd0a..1a4af29 100644
--- a/samples/SampleApp.Maui/Platforms/iOS/Info.plist
+++ b/samples/SampleApp.Maui/Platforms/iOS/Info.plist
@@ -24,6 +24,23 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneConfigurationName
+ __MAUI_DEFAULT_SCENE_CONFIGURATION__
+ UISceneDelegateClassName
+ SceneDelegate
+
+
+
+
XSAppIconAssets
Assets.xcassets/appicon.appiconset
diff --git a/samples/SampleApp.Maui/Platforms/iOS/SceneDelegate.cs b/samples/SampleApp.Maui/Platforms/iOS/SceneDelegate.cs
new file mode 100644
index 0000000..2961e1a
--- /dev/null
+++ b/samples/SampleApp.Maui/Platforms/iOS/SceneDelegate.cs
@@ -0,0 +1,10 @@
+using Foundation;
+
+namespace SampleApp.Maui;
+
+// UIScene lifecycle entry point (required by the iOS 27 SDK).
+// Referenced by UISceneDelegateClassName in Info.plist.
+[Register("SceneDelegate")]
+public class SceneDelegate : MauiUISceneDelegate
+{
+}
diff --git a/samples/SampleApp.Maui/SampleApp.Maui.csproj b/samples/SampleApp.Maui/SampleApp.Maui.csproj
index 19a32d3..fad53a8 100644
--- a/samples/SampleApp.Maui/SampleApp.Maui.csproj
+++ b/samples/SampleApp.Maui/SampleApp.Maui.csproj
@@ -2,6 +2,7 @@
net10.0-android;net10.0-ios;net10.0-maccatalyst
+ 10.0.120
$(TargetFrameworks);net10.0-windows10.0.19041.0
Exe
@@ -49,8 +50,8 @@
-
-
+
+
diff --git a/src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj b/src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
index 87ff0fc..f44a27c 100644
--- a/src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
+++ b/src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
@@ -2,6 +2,7 @@
net10.0-android;net10.0-ios;net10.0-maccatalyst
+ 10.0.120
$(TargetFrameworks);net10.0-windows10.0.19041.0
true
@@ -39,7 +40,7 @@
-
+
diff --git a/src/MintedTextEditor.SkiaSharp/HarfBuzzTextShaper.cs b/src/MintedTextEditor.SkiaSharp/HarfBuzzTextShaper.cs
index 9586e59..faac57a 100644
--- a/src/MintedTextEditor.SkiaSharp/HarfBuzzTextShaper.cs
+++ b/src/MintedTextEditor.SkiaSharp/HarfBuzzTextShaper.cs
@@ -10,7 +10,7 @@ namespace MintedTextEditor.SkiaSharp;
/// The glyphs and pen positions produced by shaping a string, ready to draw with the
/// it was shaped for. Positions are relative to the run origin.
/// Glyphs are in logical order; gives the UTF-16 index each glyph
-/// starts at and the pen x before it.
+/// starts at and the x it is drawn at (pen position plus its offset).
///
internal sealed record ShapedRun(ushort[] Glyphs, SKPoint[] Positions, float Width, int[] Clusters, float[] GlyphX, int TextLength)
{
@@ -256,8 +256,13 @@ private ShapedRun ShapeUncached(string text, float size)
{
glyphs.Add((ushort)infos[i].Codepoint);
clusters.Add((int)infos[i].Cluster);
- glyphX.Add(penX);
- points.Add(new SKPoint(penX + positions[i].XOffset * scale, -positions[i].YOffset * scale));
+ // The caret goes where the glyph is drawn, so include its x offset: HarfBuzz
+ // applies a legacy 'kern' table (e.g. Helvetica on Apple platforms) by giving
+ // half the kerning to the first glyph's advance and moving the second glyph
+ // back by the rest, rather than adjusting the first advance alone.
+ float drawX = penX + positions[i].XOffset * scale;
+ glyphX.Add(drawX);
+ points.Add(new SKPoint(drawX, -positions[i].YOffset * scale));
penX += positions[i].XAdvance * scale;
}
}
diff --git a/src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj b/src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj
index d475226..9d8eca8 100644
--- a/src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj
+++ b/src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj
@@ -21,8 +21,8 @@
-
-
+
+
diff --git a/tests/MintedTextEditor.SkiaSharp.Tests/MintedTextEditor.SkiaSharp.Tests.csproj b/tests/MintedTextEditor.SkiaSharp.Tests/MintedTextEditor.SkiaSharp.Tests.csproj
index d9f8590..77a8d9d 100644
--- a/tests/MintedTextEditor.SkiaSharp.Tests/MintedTextEditor.SkiaSharp.Tests.csproj
+++ b/tests/MintedTextEditor.SkiaSharp.Tests/MintedTextEditor.SkiaSharp.Tests.csproj
@@ -13,8 +13,8 @@
-
-
+
+