Topten.RichTextKit
0.6.171
dotnet add package Topten.RichTextKit --version 0.6.171
NuGet\Install-Package Topten.RichTextKit -Version 0.6.171
<PackageReference Include="Topten.RichTextKit" Version="0.6.171" />
<PackageVersion Include="Topten.RichTextKit" Version="0.6.171" />
<PackageReference Include="Topten.RichTextKit" />
paket add Topten.RichTextKit --version 0.6.171
#r "nuget: Topten.RichTextKit, 0.6.171"
#:package Topten.RichTextKit@0.6.171
#addin nuget:?package=Topten.RichTextKit&version=0.6.171
#tool nuget:?package=Topten.RichTextKit&version=0.6.171

RichTextKit
RichTextKit is a rich-text layout, measurement and rendering library for SkiaSharp.
Features
- Rich text layout
- Supports most common font styles (bold, italic, underline, super/sub-script etc...)
- Text shaping using HarfBuzzSharp
- Font fallback for emoji and int'l character sets
- Bi-directional and LTR/RTL Text Support (UAX #9)
- Unicode word-break algorithm (UAX #14)
- Max height and max line limits
- Truncate with ellipsis support
- Text measurement support
- Hit testing and caret position information
- Ability to paint selection range highlight
- Document model for building text editors, with undo support
- Easy to use
- Minimal dependencies (just SkiaSharp and HarfBuzzSharp)

Installation
RichTextKit is available on NuGet for netstandard2.0 and net8.0:
dotnet add package Topten.RichTextKit
Quick Start
The easiest way to get started is with the RichString class:
// Build some rich text
var rs = new RichString()
.Alignment(TextAlignment.Center)
.FontFamily("Segoe UI")
.MarginBottom(20)
.Add("Welcome To RichTextKit", fontSize: 24, fontWeight: 700, fontItalic: true)
.Paragraph().Alignment(TextAlignment.Left)
.FontSize(18)
.Add("This is a test string");
// Wrap and crop it
rs.MaxWidth = 640;
rs.MaxHeight = 480;
// Paint it to a SkiaSharp canvas
rs.Paint(canvas, new SKPoint(50, 50));
// Measure it
Console.WriteLine($"Size: {rs.MeasuredWidth} x {rs.MeasuredHeight}");
For lower-level control, use TextBlock to lay out and paint a single paragraph.
Status
RichTextKit is stable and in active use.
Text layout, and Unicode and international text in particular, are complicated topics. If you find something that doesn't lay out or render correctly, please open an issue or a pull request.
Release Notes
See the changelog.
Documentation
See here for documentation.
License
Apache 2.0. See license.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- HarfBuzzSharp.NativeAssets.Linux (>= 14.2.1.301)
- SkiaSharp (>= 4.153.1)
- SkiaSharp.HarfBuzz (>= 4.153.1)
- SkiaSharp.NativeAssets.Linux (>= 4.153.1)
-
net8.0
- HarfBuzzSharp.NativeAssets.Linux (>= 14.2.1.301)
- SkiaSharp (>= 4.153.1)
- SkiaSharp.HarfBuzz (>= 4.153.1)
- SkiaSharp.NativeAssets.Linux (>= 4.153.1)
NuGet packages (50)
Showing the top 5 NuGet packages that depend on Topten.RichTextKit:
| Package | Downloads |
|---|---|
|
Mapsui.Rendering.Skia
Mapsui - Library for mapping |
|
|
Mapsui.Wpf
WPF map components based on the Mapsui library |
|
|
Infragistics.Web.Documents.Excel
A library for loading and saving Excel documents. |
|
|
Mapsui.Maui
Mapsui.Maui - Library for mapping for Maui |
|
|
Mapsui.Uno.WinUI
Uno map components based on the Mapsui library |
GitHub repositories (6)
Showing the top 6 popular GitHub repositories that depend on Topten.RichTextKit:
| Repository | Stars |
|---|---|
|
Mapsui/Mapsui
Mapsui is a .NET Map component for: MAUI, Avalonia, Uno Platform, Blazor, WPF, WinUI, Windows Forms, Eto Forms, .NET for Android and .NET for iOS
|
|
|
modern-forms/Modern.Forms
Cross-platform spiritual successor to Winforms for .NET 8+
|
|
|
vchelaru/Gum
Flexible layout tool for creating UI on any platform
|
|
|
mono/SkiaSharp.Extended
SkiaSharp is a cross-platform, comprehensive 2D graphics API for all .NET platforms. And, here is where you will find all sorts of extras that you can use with it.
|
|
|
habibrehmansg/infopanel
InfoPanel is a desktop visualization software designed to work with HWiNFO sensors via Shared Memory (SHM). It allows users to display system information on their desktop or external displays, including USB-only LCDs like BeadaPanel.
|
|
|
NeilMacMullen/kusto-loco
C# KQL query engine with flexible I/O layers and visualization
|
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.171 | 0 | 11/11/2026 |
| 0.6.170 | 13,980 | 10/11/2026 |
| 0.5.169 | 2,350 | 10/9/2026 |
| 0.5.168 | 1,232 | 10/2/2026 |
| 0.4.167 | 880,201 | 3/6/2024 |
| 0.4.166 | 2,359,536 | 8/21/2023 |
| 0.4.165 | 63,931 | 12/7/2022 |
| 0.4.164 | 795 | 12/4/2022 |
| 0.4.163-preview | 1,392 | 9/27/2022 |
| 0.4.162-preview | 6,713 | 6/20/2022 |
| 0.4.161-preview | 1,766 | 6/9/2022 |
| 0.4.158-preview | 528 | 5/17/2022 |
| 0.4.151 | 322,007 | 1/24/2022 |
| 0.4.148 | 5,974 | 10/10/2021 |
| 0.4.147 | 849 | 10/10/2021 |
| 0.4.146 | 743 | 10/7/2021 |
| 0.4.145 | 101,589 | 8/15/2021 |
| 0.4.144 | 763 | 8/15/2021 |
| 0.4.143 | 1,686 | 8/4/2021 |
| 0.4.142 | 717 | 8/4/2021 |
RichTextKit 0.6.171
Bug fixes:
- MeasuredOverhang measured the wrong glyphs after composed characters or ligatures
- StyleManager could lose an inherited font width
- HitTestLine threw if called before layout
- Buffers reallocated on every grow instead of doubling
- ResetPooledMemory stopped pooled objects being reset
Performance:
- Much less memory allocated during layout, and none during paint
- Fonts used for font fallback are now disposed
Other:
- Removed the unneeded System.ValueTuple dependency
- The package now includes the readme and these release notes
Full changelog: https://github.com/toptensoftware/RichTextKit/blob/main/CHANGELOG.md