Skip to content
soypatPublic

About

Low level 2D User Interface experiment

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

kui

An ecosystem for building UI frameworks that can run anywhere.

kui has minimal logic, instead needing the user to plug in interfaces that are needed for UI frameworks to work like:

  • Font: typeface metrics in font units: character map and glyph advances.
  • FontFace: font rasterizing for CPU drawing, yields glyph alpha masks and line metrics.
  • FontMeasurer: text measuring so layout can size text before it is drawn.
  • LayoutEngine: computes node geometry of a Tree within a viewport.
  • EventWriter: producer end of an event queue, written to by platform input drivers.
  • EventReader: consumer end of an event queue, drained by the UI to process input Events.
  • EventBuilder: Not an interface per-se, but it is the contact point with devices such as keyboards, touch pads and mice.

webgpu example

GLFW window and events, WebGPU painting, lefevre text shaping:

cd bindings
go run ./paint/kuiwgpu/examples/window

cogent-core example

cd bindings/multi/kuicogent/examples/window
go run .

kui on cogent core

kui2go

Package kui2go contains implementations that are simple and straightforward enough to be provided inside of kui.

  • kui2go.EventSPSC: Single-Producer/Single-Consumer event queue, implements EventWriter and EventReader.
  • kui2go.TextFaces: FontMeasurer over FontFaces indexed by font, measuring with the advances painters draw with.
  • kuiscene.Scene: retained node tree with layout, hit testing, gesture routing, focus, timers, scrolling, text editing and painting.
  • kuibatch.Encoder: batches draw lists into instanced quads and a glyph atlas for GPU painters, whatever their graphics API.
  • kui2go.LayoutBasic: A minimal layout engine that has been fuzzed against glay, which itself has been fuzzed against clayui. Has minor differences in layout with glay.

bindings

Module bindings adapts third party libraries to kui's interfaces, depending only on kui. See README in directory.

gesture

Package gesture contains gesture processing logic. Omitted from kui since its processing is

Fuzzing

go test ./kui2go/kuiscene -run TestWidgetLaws -states 20000 -seed 7
go test ./kui2go -run TestLayoutBasicRandom -trees 50000
go test ./kui2go/kuiscene -fuzz FuzzWidgets -fuzztime 60s

About

Low level 2D User Interface experiment

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages