Dcanvas, a fork of DlangUI

c-smile andrew at sciter.com
Sat May 23 18:29:20 UTC 2026


On Saturday, 23 May 2026 at 17:04:16 UTC, Anton Pastukhov wrote:
> On Saturday, 23 May 2026 at 16:35:28 UTC, c-smile wrote:

> have to do some basic performance optimizations, becuase the 
> current implementation is _terribly_ ineffective (EditBox 
> widget chokes on less-than-medium-sized texts).

Naïve EditBox implementations have `O(N)` complexity on single 
character handling so no matter what you do it will be 
ineffective. On each character pressed it rescans (word/line 
breaking, etc.) of whole text.

That's why Sciter has three different text editors:

* `<textarea>` - standard for HTML multiline editor, ~1k chars.
* `<plaintext>` - Sciter specific multiline editor, 1mb chars. 
Text is represented in paragraphs (DOM element holding text line) 
so editing one paragraph is not causing re-layout of the whole.
* `<richtext>` - WYSIWYG editor that allow to edit HTML.

Sample of `<plaintext>` with support of colorizer/syntax 
highlighting:

![plaintext 
editor](https://sciter.com/wp-content/uploads/2026/05/plaintext-colorizer.jpg)

>
>>SDL, GLFW and Co. are mostly about basic window creation and 
>>support of so called "message pumps"
>
> This is basically what we do now. SDL creates windows, but 
> doesn't do much afterwards. I have high hopes about SLD3 though.
>

I would rather go with Skia from ground up. No SDL I mean. I've 
convinced once SDL people to implement rich clipboard support 
(they did in SDL3). Not just plain text but HTML, file lists, 
images, etc. But drag-n-drop is still basic AFAIK.

It has:

* [Window 
abstraction](https://github.com/google/skia/tree/main/tools/window) implementation. It is a bit simplistic but as a base for future expansions will work.
* GPU accelerated 2D graphics (DirectX, Metal, OpenGL, Vulkan).
* 
[SkParagraph](https://github.com/google/skia/tree/main/modules/skparagraph) text container with styled text. A la `<p>` in HTML.
* 
[SkPlainTextEditor](https://github.com/google/skia/tree/main/modules/skplaintexteditor)

The only problem with Skia is that its C++ interface is unstable, 
so some isolation API layer is required in order to be used in D. 
Essentially same thing as [Sciter/D 
Graphics](https://gitlab.com/sciter-engine/sciter-js-sdk/-/tree/main/sciter%2B/D/sciter/graphics?ref_type=heads),




More information about the Digitalmars-d-announce mailing list