@grida/canvas-wasm 0.0.47 → 0.0.49
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/grida-canvas-wasm.js +1 -1
- package/dist/grida_canvas_wasm.wasm +0 -0
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +177 -137
- package/dist/index.mjs +177 -137
- package/package.json +1 -1
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -57,7 +57,7 @@ declare namespace createGridaCanvas {
|
|
|
57
57
|
_init(
|
|
58
58
|
width: number,
|
|
59
59
|
height: number,
|
|
60
|
-
|
|
60
|
+
use_embedded_fonts: boolean
|
|
61
61
|
): GridaCanvasWebGlApplicationPtr;
|
|
62
62
|
|
|
63
63
|
// ====================================================================================================
|
|
@@ -86,16 +86,27 @@ declare namespace createGridaCanvas {
|
|
|
86
86
|
x: number,
|
|
87
87
|
y: number
|
|
88
88
|
): void;
|
|
89
|
-
|
|
89
|
+
_add_font(
|
|
90
90
|
state: GridaCanvasWebGlApplicationPtr,
|
|
91
91
|
family_ptr: number,
|
|
92
92
|
family_len: number,
|
|
93
93
|
data_ptr: number,
|
|
94
94
|
data_len: number
|
|
95
95
|
): void;
|
|
96
|
+
_add_image(
|
|
97
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
98
|
+
data_ptr: number,
|
|
99
|
+
data_len: number
|
|
100
|
+
): Ptr;
|
|
96
101
|
_has_missing_fonts(state: GridaCanvasWebGlApplicationPtr): boolean;
|
|
97
102
|
_list_missing_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
98
103
|
_list_available_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
104
|
+
_set_default_fallback_fonts(
|
|
105
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
106
|
+
ptr: number,
|
|
107
|
+
len: number
|
|
108
|
+
): void;
|
|
109
|
+
_get_default_fallback_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
99
110
|
_set_main_camera_transform(
|
|
100
111
|
state: GridaCanvasWebGlApplicationPtr,
|
|
101
112
|
a: number,
|
|
@@ -242,10 +253,10 @@ interface VectorNetwork {
|
|
|
242
253
|
declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
|
|
243
254
|
interface CreateWebGLCanvasSurfaceOptions {
|
|
244
255
|
/**
|
|
245
|
-
* when true,
|
|
256
|
+
* when true, embedded fonts will be registered and used for text rendering.
|
|
246
257
|
* @default true
|
|
247
258
|
*/
|
|
248
|
-
|
|
259
|
+
use_embedded_fonts?: boolean;
|
|
249
260
|
}
|
|
250
261
|
declare class ApplicationFactory {
|
|
251
262
|
private readonly module;
|
|
@@ -281,10 +292,13 @@ declare class Grida2D {
|
|
|
281
292
|
* @param family - CSS font-family name for the typeface.
|
|
282
293
|
* @param data - Raw font file bytes (e.g. TTF/OTF).
|
|
283
294
|
*/
|
|
284
|
-
|
|
295
|
+
addFont(family: string, data: Uint8Array): void;
|
|
296
|
+
addImage(data: Uint8Array): string;
|
|
285
297
|
hasMissingFonts(): boolean;
|
|
286
298
|
listMissingFonts(): FontKey[];
|
|
287
299
|
listAvailableFonts(): FontKey[];
|
|
300
|
+
setFallbackFonts(fonts: string[]): void;
|
|
301
|
+
getFallbackFonts(): string[];
|
|
288
302
|
/**
|
|
289
303
|
* Tick the application clock.
|
|
290
304
|
* bind this to requestAnimationFrame loop or similar
|
package/dist/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare namespace createGridaCanvas {
|
|
|
57
57
|
_init(
|
|
58
58
|
width: number,
|
|
59
59
|
height: number,
|
|
60
|
-
|
|
60
|
+
use_embedded_fonts: boolean
|
|
61
61
|
): GridaCanvasWebGlApplicationPtr;
|
|
62
62
|
|
|
63
63
|
// ====================================================================================================
|
|
@@ -86,16 +86,27 @@ declare namespace createGridaCanvas {
|
|
|
86
86
|
x: number,
|
|
87
87
|
y: number
|
|
88
88
|
): void;
|
|
89
|
-
|
|
89
|
+
_add_font(
|
|
90
90
|
state: GridaCanvasWebGlApplicationPtr,
|
|
91
91
|
family_ptr: number,
|
|
92
92
|
family_len: number,
|
|
93
93
|
data_ptr: number,
|
|
94
94
|
data_len: number
|
|
95
95
|
): void;
|
|
96
|
+
_add_image(
|
|
97
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
98
|
+
data_ptr: number,
|
|
99
|
+
data_len: number
|
|
100
|
+
): Ptr;
|
|
96
101
|
_has_missing_fonts(state: GridaCanvasWebGlApplicationPtr): boolean;
|
|
97
102
|
_list_missing_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
98
103
|
_list_available_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
104
|
+
_set_default_fallback_fonts(
|
|
105
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
106
|
+
ptr: number,
|
|
107
|
+
len: number
|
|
108
|
+
): void;
|
|
109
|
+
_get_default_fallback_fonts(state: GridaCanvasWebGlApplicationPtr): Ptr;
|
|
99
110
|
_set_main_camera_transform(
|
|
100
111
|
state: GridaCanvasWebGlApplicationPtr,
|
|
101
112
|
a: number,
|
|
@@ -242,10 +253,10 @@ interface VectorNetwork {
|
|
|
242
253
|
declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
|
|
243
254
|
interface CreateWebGLCanvasSurfaceOptions {
|
|
244
255
|
/**
|
|
245
|
-
* when true,
|
|
256
|
+
* when true, embedded fonts will be registered and used for text rendering.
|
|
246
257
|
* @default true
|
|
247
258
|
*/
|
|
248
|
-
|
|
259
|
+
use_embedded_fonts?: boolean;
|
|
249
260
|
}
|
|
250
261
|
declare class ApplicationFactory {
|
|
251
262
|
private readonly module;
|
|
@@ -281,10 +292,13 @@ declare class Grida2D {
|
|
|
281
292
|
* @param family - CSS font-family name for the typeface.
|
|
282
293
|
* @param data - Raw font file bytes (e.g. TTF/OTF).
|
|
283
294
|
*/
|
|
284
|
-
|
|
295
|
+
addFont(family: string, data: Uint8Array): void;
|
|
296
|
+
addImage(data: Uint8Array): string;
|
|
285
297
|
hasMissingFonts(): boolean;
|
|
286
298
|
listMissingFonts(): FontKey[];
|
|
287
299
|
listAvailableFonts(): FontKey[];
|
|
300
|
+
setFallbackFonts(fonts: string[]): void;
|
|
301
|
+
getFallbackFonts(): string[];
|
|
288
302
|
/**
|
|
289
303
|
* Tick the application clock.
|
|
290
304
|
* bind this to requestAnimationFrame loop or similar
|