What the Core Library Provides
The Core library contains everything needed to build a rich text editor on any platform. It depends only on SkiaSharp (via Topten.RichTextKit) and has no dependency on Avalonia or any other UI framework.
DocumentController
The primary API. Owns the document, handles all editing operations, styling, navigation, and rendering.
DocumentSettings
Configure page width, margins, default text style, background color, and default paragraph alignment.
DocumentReader / IO
Iterate paragraphs, runs, and styles to export or inspect document content without touching the UI.
Inline Images
Insert, display, resize, and export inline images that flow with the text content.
Input & Shortcuts
Platform-agnostic key codes and a configurable shortcut handler — translate platform events once, use everywhere.
Geometry Types
Point, Rectangle, Size — lightweight structs that bridge document coordinates and Skia canvas space.
Key Types at a Glance
| Type | Kind | Description |
|---|---|---|
| DocumentController | class | Central editing API — owns TextDocument, handles all operations |
| DocumentSettings | struct | Immutable-ish configuration for page layout and default style |
| DocumentMargins | struct | Page margin values (left, right, top, bottom) |
| DocumentReader | class | Read-only iterator over document paragraphs and runs |
| ContentBlock | class | Represents one paragraph with alignment, list, and spacing info |
| ContentRun | class | One styled text span or inline image within a paragraph |
| InlineImage | class | An SKImage wrapper that implements IInlineObject for RTK |
| EditorCursor | enum | Platform-agnostic cursor hint (Default, ResizeNS, ResizeEW, …) |
| ResizeHandleType | enum | Which of the 8 resize handles the user is dragging |
| Point | struct | 2D float point in document space |
| Rectangle | struct | Axis-aligned rectangle with helpers for inflate/deflate |
| Size | struct | Width × Height pair |
| KeyInfo | struct | Platform-agnostic key event (code + modifiers + character) |
| Shortcut | struct | Key combination descriptor used by ShortcutHandler |
| ShortcutHandler | class | Maps Shortcut → async Action and dispatches key events |
| IClipboardHandler | interface | Abstraction over platform clipboard (text + images) |
| NavigationInfo | struct | Snapshot of caret style and selection, delivered via OnNavigation |
| DocumentInfo | struct | Snapshot of document size and scroll offset |
| ViewModifier | struct | Scroll offset + zoom scale for coordinate conversion |
Namespace
using ParentElement.RichText.Core;
using ParentElement.RichText.Core.IO;
using ParentElement.RichText.Core.Images;
using ParentElement.RichText.Core.Geometry;
using ParentElement.RichText.Core.Input;