Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@

<!-- SourceLink for GitHub (requires Microsoft.SourceLink.GitHub package) -->
<ItemGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.402" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.403" PrivateAssets="All"/>
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions samples/SampleApp.Maui/Platforms/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions samples/SampleApp.Maui/Platforms/MacCatalyst/SceneDelegate.cs
Original file line number Diff line number Diff line change
@@ -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
{
}
17 changes: 17 additions & 0 deletions samples/SampleApp.Maui/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions samples/SampleApp.Maui/Platforms/iOS/SceneDelegate.cs
Original file line number Diff line number Diff line change
@@ -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
{
}
5 changes: 3 additions & 2 deletions samples/SampleApp.Maui/SampleApp.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<MauiVersion>10.0.120</MauiVersion>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>

<OutputType>Exe</OutputType>
Expand Down Expand Up @@ -49,8 +50,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="4.153.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.14" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="4.154.0" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<MauiVersion>10.0.120</MauiVersion>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>

<UseMaui>true</UseMaui>
Expand Down Expand Up @@ -39,7 +40,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="4.153.1" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="4.154.0" />
<PackageReference Include="Svg.Skia" Version="5.2.3" />
</ItemGroup>

Expand Down
11 changes: 8 additions & 3 deletions src/MintedTextEditor.SkiaSharp/HarfBuzzTextShaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace MintedTextEditor.SkiaSharp;
/// The glyphs and pen positions produced by shaping a string, ready to draw with the
/// <see cref="SKFont"/> it was shaped for. Positions are relative to the run origin.
/// Glyphs are in logical order; <see cref="Clusters"/> gives the UTF-16 index each glyph
/// starts at and <see cref="GlyphX"/> the pen x before it.
/// starts at and <see cref="GlyphX"/> the x it is drawn at (pen position plus its offset).
/// </summary>
internal sealed record ShapedRun(ushort[] Glyphs, SKPoint[] Positions, float Width, int[] Clusters, float[] GlyphX, int TextLength)
{
Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HarfBuzzSharp" Version="14.2.1.301" />
<PackageReference Include="SkiaSharp" Version="4.153.1" />
<PackageReference Include="HarfBuzzSharp" Version="14.2.1.400" />
<PackageReference Include="SkiaSharp" Version="4.154.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1" />
<!-- Native Skia / HarfBuzz binaries for the Linux CI runner -->
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="4.153.1" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="14.2.1.301" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="4.154.0" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="14.2.1.400" />
</ItemGroup>

<ItemGroup>
Expand Down