restty 0.1.15 → 0.1.17
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/dist/app/atlas-builder.d.ts +38 -0
- package/dist/app/font-sources.d.ts +2 -0
- package/dist/app/index.js +477 -164
- package/dist/app/pane-app-manager.d.ts +43 -0
- package/dist/app/panes-context-menu.d.ts +10 -0
- package/dist/app/panes-styles.d.ts +5 -0
- package/dist/app/panes-types.d.ts +89 -0
- package/dist/app/panes.d.ts +10 -0
- package/dist/app/restty.d.ts +20 -0
- package/dist/app/session.d.ts +6 -0
- package/dist/app/types.d.ts +123 -0
- package/dist/fonts/index.js +2 -1
- package/dist/fonts/manager.d.ts +25 -0
- package/dist/fonts/nerd-constraints.d.ts +4 -0
- package/dist/fonts/nerd-ranges.d.ts +2 -0
- package/dist/fonts/types.d.ts +51 -0
- package/dist/grid/grid.d.ts +22 -0
- package/dist/grid/types.d.ts +32 -0
- package/dist/ime/ime.d.ts +13 -0
- package/dist/ime/types.d.ts +8 -0
- package/dist/index.js +477 -164
- package/dist/input/ansi.d.ts +3 -0
- package/dist/input/index.js +5 -1
- package/dist/input/mouse.d.ts +10 -0
- package/dist/input/output.d.ts +11 -0
- package/dist/input/types.d.ts +7 -0
- package/dist/internal.js +477 -164
- package/dist/pty/kitty-media.d.ts +3 -0
- package/dist/pty/pty.d.ts +11 -0
- package/dist/pty/types.d.ts +49 -0
- package/dist/renderer/box-drawing-map.d.ts +4 -0
- package/dist/renderer/index.js +145 -42
- package/dist/renderer/shaders.d.ts +7 -0
- package/dist/renderer/shapes.d.ts +43 -0
- package/dist/renderer/types.d.ts +43 -0
- package/dist/renderer/webgpu.d.ts +11 -0
- package/dist/selection/selection.d.ts +24 -0
- package/dist/selection/types.d.ts +13 -0
- package/dist/theme/catalog.d.ts +5 -0
- package/dist/theme/ghostty.d.ts +18 -0
- package/dist/wasm/embedded.d.ts +1 -0
- package/dist/wasm/runtime.d.ts +29 -0
- package/package.json +1 -1
|
@@ -1,9 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata for constrained glyph rendering.
|
|
3
|
+
* - cp: Unicode code point
|
|
4
|
+
* - constraintWidth: target cell width constraint
|
|
5
|
+
* - variable: whether glyph can render at multiple widths
|
|
6
|
+
* - widths: set of all required cell widths for this glyph
|
|
7
|
+
*/
|
|
1
8
|
export type GlyphConstraintMeta = {
|
|
2
9
|
cp: number;
|
|
3
10
|
constraintWidth: number;
|
|
4
11
|
variable?: boolean;
|
|
5
12
|
widths?: Set<number>;
|
|
6
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Context for constraint-based atlas building, primarily for Nerd Fonts symbol alignment.
|
|
16
|
+
* - cellW: cell width in pixels
|
|
17
|
+
* - cellH: cell height in pixels
|
|
18
|
+
* - yPad: vertical padding
|
|
19
|
+
* - baselineOffset: baseline offset adjustment
|
|
20
|
+
* - baselineAdjust: additional baseline adjustment
|
|
21
|
+
* - fontScale: scale factor for font rendering
|
|
22
|
+
* - nerdMetrics: Nerd Fonts specific layout metrics
|
|
23
|
+
* - fontEntry: reference to font entry object
|
|
24
|
+
*/
|
|
7
25
|
export type AtlasConstraintContext = {
|
|
8
26
|
cellW: number;
|
|
9
27
|
cellH: number;
|
|
@@ -60,6 +78,17 @@ type BuildAtlasDeps = {
|
|
|
60
78
|
atlasScale: number;
|
|
61
79
|
}) => boolean;
|
|
62
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Parameters for font atlas building.
|
|
83
|
+
* - entry: font entry containing the font object and cached atlas
|
|
84
|
+
* - neededGlyphIds: set of glyph IDs required in the atlas
|
|
85
|
+
* - glyphMeta: optional constraint metadata for symbol font glyphs
|
|
86
|
+
* - fontSizePx: base font size in pixels
|
|
87
|
+
* - atlasScale: scaling factor for high-DPI rendering
|
|
88
|
+
* - fontIndex: index in the font fallback chain (0 = primary font)
|
|
89
|
+
* - constraintContext: optional constraint context for symbol alignment
|
|
90
|
+
* - deps: external dependencies for atlas building
|
|
91
|
+
*/
|
|
63
92
|
export type BuildFontAtlasParams = {
|
|
64
93
|
entry: any;
|
|
65
94
|
neededGlyphIds: Set<number>;
|
|
@@ -70,6 +99,14 @@ export type BuildFontAtlasParams = {
|
|
|
70
99
|
constraintContext?: AtlasConstraintContext | null;
|
|
71
100
|
deps: BuildAtlasDeps;
|
|
72
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Result from font atlas building.
|
|
104
|
+
* - rebuilt: true if a new atlas was generated
|
|
105
|
+
* - atlas: the atlas object containing glyph metrics and bitmap
|
|
106
|
+
* - rgba: RGBA pixel data ready for WebGL upload
|
|
107
|
+
* - colorGlyphs: set of glyph IDs that are color emoji
|
|
108
|
+
* - preferNearest: whether to use nearest-neighbor texture filtering
|
|
109
|
+
*/
|
|
73
110
|
export type BuildFontAtlasResult = {
|
|
74
111
|
rebuilt: boolean;
|
|
75
112
|
atlas: any | null;
|
|
@@ -77,5 +114,6 @@ export type BuildFontAtlasResult = {
|
|
|
77
114
|
colorGlyphs?: Set<number>;
|
|
78
115
|
preferNearest: boolean;
|
|
79
116
|
};
|
|
117
|
+
/** Builds or reuses a font atlas, detecting when rebuild is needed based on glyph requirements, size changes, or constraint updates. */
|
|
80
118
|
export declare function buildFontAtlasIfNeeded(params: BuildFontAtlasParams): BuildFontAtlasResult;
|
|
81
119
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { ResttyFontPreset, ResttyFontSource } from "./types";
|
|
2
|
+
/** Default font fallback chain with JetBrains Mono, Nerd Fonts symbols, Noto symbols, color emoji, black emoji, and CJK support. */
|
|
2
3
|
export declare const DEFAULT_FONT_SOURCES: ResttyFontSource[];
|
|
4
|
+
/** Validates user-provided font sources or returns defaults based on preset (none returns empty array, otherwise default CDN fonts). */
|
|
3
5
|
export declare function normalizeFontSources(sources: ResttyFontSource[] | undefined, preset: ResttyFontPreset | undefined): ResttyFontSource[];
|