restty 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # restty
2
2
 
3
- ![CI](https://img.shields.io/badge/CI-GitHub%20Actions-2088FF?logo=githubactions&logoColor=white)
4
- ![Bun](https://img.shields.io/badge/Bun-%3E%3D1.2.0-f9f1e1?logo=bun&logoColor=000)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
3
+ [![GitHub](https://img.shields.io/badge/-GitHub-181717?style=flat-square&logo=github&logoColor=white)](https://github.com/wiedymi)
4
+ [![Twitter](https://img.shields.io/badge/-Twitter-1DA1F2?style=flat-square&logo=twitter&logoColor=white)](https://x.com/wiedymi)
5
+ [![Email](https://img.shields.io/badge/-Email-EA4335?style=flat-square&logo=gmail&logoColor=white)](mailto:contact@wiedymi.com)
6
+ [![Discord](https://img.shields.io/badge/-Discord-5865F2?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/zemMZtrkSb)
7
+ [![Support me](https://img.shields.io/badge/-Support%20me-ff69b4?style=flat-square&logo=githubsponsors&logoColor=white)](https://github.com/sponsors/vivy-company)
6
8
 
7
9
  Experimental project: browser terminal rendering with a WASM terminal core, GPU rendering (WebGPU + WebGL2 fallback), and TypeScript text shaping.
8
10
 
@@ -31,6 +33,18 @@ restty combines a Zig/WASM VT engine, modern browser rendering pipelines, and a
31
33
  - Integration and usage: `docs/usage.md`
32
34
  - Internal architecture notes: `docs/internals/`
33
35
 
36
+ ## App integration
37
+
38
+ Simple usage (built-in `text-shaper` is used automatically):
39
+
40
+ ```ts
41
+ import { createResttyApp } from "restty";
42
+
43
+ const app = createResttyApp({
44
+ canvas: document.getElementById("screen") as HTMLCanvasElement,
45
+ });
46
+ ```
47
+
34
48
  ## Repository layout
35
49
 
36
50
  - `src/` - Main library/runtime code (renderer, input, PTY bridge, app integration).
@@ -1,3 +1,3 @@
1
1
  import type { ResttyApp, ResttyAppOptions } from "./types";
2
- export type { TextShaper, ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyAppOptions, ResttyApp, } from "./types";
2
+ export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyAppOptions, ResttyApp, } from "./types";
3
3
  export declare function createResttyApp(options: ResttyAppOptions): ResttyApp;
@@ -1,45 +1,5 @@
1
1
  import type { InputHandler } from "../input";
2
2
  import type { GhosttyTheme } from "../theme";
3
- export type TextShaper = {
4
- Font: {
5
- loadAsync: (buffer: ArrayBuffer) => Promise<any>;
6
- collection?: (buffer: ArrayBuffer) => {
7
- names: () => Array<{
8
- index: number;
9
- fullName?: string;
10
- family?: string;
11
- postScriptName?: string;
12
- }>;
13
- get: (index: number) => any;
14
- } | null;
15
- };
16
- UnicodeBuffer: new () => {
17
- addStr: (text: string) => void;
18
- };
19
- shape: (font: any, buffer: any) => any;
20
- glyphBufferToShapedGlyphs: (glyphBuffer: any) => Array<{
21
- glyphId: number;
22
- xAdvance: number;
23
- xOffset: number;
24
- yOffset: number;
25
- }>;
26
- buildAtlas: (font: any, glyphIds: number[], options: any) => any;
27
- atlasToRGBA: (atlas: any) => Uint8Array | null;
28
- rasterizeGlyph?: (font: any, glyphId: number, fontSize: number, options?: any) => {
29
- bitmap: any;
30
- bearingX: number;
31
- bearingY: number;
32
- } | null;
33
- rasterizeGlyphWithTransform?: (font: any, glyphId: number, fontSize: number, matrix: number[] | number[][], options?: any) => {
34
- bitmap: any;
35
- bearingX: number;
36
- bearingY: number;
37
- } | null;
38
- PixelMode: {
39
- Gray: any;
40
- RGBA?: any;
41
- };
42
- };
43
3
  export type ResttyAppElements = {
44
4
  backendEl?: HTMLElement | null;
45
5
  fpsEl?: HTMLElement | null;
@@ -82,7 +42,6 @@ export type FontSource = {
82
42
  export type ResttyAppOptions = {
83
43
  canvas: HTMLCanvasElement;
84
44
  imeInput?: HTMLTextAreaElement | null;
85
- textShaper: TextShaper;
86
45
  elements?: ResttyAppElements;
87
46
  callbacks?: ResttyAppCallbacks;
88
47
  renderer?: "auto" | "webgpu" | "webgl2";
package/dist/index.d.ts CHANGED
@@ -13,4 +13,4 @@ export type { WasmAbi, WasmAbiKind, CursorInfo, RenderState, ResttyWasmExports,
13
13
  export { parseGhosttyTheme, parseGhosttyColor, colorToFloats, colorToRgbU32, listBuiltinThemeNames, isBuiltinThemeName, getBuiltinThemeSource, getBuiltinTheme, } from "./theme";
14
14
  export type { GhosttyTheme, ThemeColor, ResttyBuiltinThemeName } from "./theme";
15
15
  export { createResttyApp } from "./app";
16
- export type { ResttyApp, ResttyAppOptions, ResttyAppElements, ResttyAppCallbacks, TextShaper, } from "./app";
16
+ export type { ResttyApp, ResttyAppOptions, ResttyAppElements, ResttyAppCallbacks } from "./app";