@grida/canvas-wasm 0.0.48 → 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.
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
- cfg_font_fallback: boolean
60
+ use_embedded_fonts: boolean
61
61
  ): GridaCanvasWebGlApplicationPtr;
62
62
 
63
63
  // ====================================================================================================
@@ -86,13 +86,18 @@ declare namespace createGridaCanvas {
86
86
  x: number,
87
87
  y: number
88
88
  ): void;
89
- _register_font(
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;
@@ -248,10 +253,10 @@ interface VectorNetwork {
248
253
  declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
249
254
  interface CreateWebGLCanvasSurfaceOptions {
250
255
  /**
251
- * when true, built-in fonts will be used for text rendering, even if the font family and style does not match.
256
+ * when true, embedded fonts will be registered and used for text rendering.
252
257
  * @default true
253
258
  */
254
- fontFallback?: boolean;
259
+ use_embedded_fonts?: boolean;
255
260
  }
256
261
  declare class ApplicationFactory {
257
262
  private readonly module;
@@ -287,7 +292,8 @@ declare class Grida2D {
287
292
  * @param family - CSS font-family name for the typeface.
288
293
  * @param data - Raw font file bytes (e.g. TTF/OTF).
289
294
  */
290
- registerFont(family: string, data: Uint8Array): void;
295
+ addFont(family: string, data: Uint8Array): void;
296
+ addImage(data: Uint8Array): string;
291
297
  hasMissingFonts(): boolean;
292
298
  listMissingFonts(): FontKey[];
293
299
  listAvailableFonts(): FontKey[];
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
- cfg_font_fallback: boolean
60
+ use_embedded_fonts: boolean
61
61
  ): GridaCanvasWebGlApplicationPtr;
62
62
 
63
63
  // ====================================================================================================
@@ -86,13 +86,18 @@ declare namespace createGridaCanvas {
86
86
  x: number,
87
87
  y: number
88
88
  ): void;
89
- _register_font(
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;
@@ -248,10 +253,10 @@ interface VectorNetwork {
248
253
  declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
249
254
  interface CreateWebGLCanvasSurfaceOptions {
250
255
  /**
251
- * when true, built-in fonts will be used for text rendering, even if the font family and style does not match.
256
+ * when true, embedded fonts will be registered and used for text rendering.
252
257
  * @default true
253
258
  */
254
- fontFallback?: boolean;
259
+ use_embedded_fonts?: boolean;
255
260
  }
256
261
  declare class ApplicationFactory {
257
262
  private readonly module;
@@ -287,7 +292,8 @@ declare class Grida2D {
287
292
  * @param family - CSS font-family name for the typeface.
288
293
  * @param data - Raw font file bytes (e.g. TTF/OTF).
289
294
  */
290
- registerFont(family: string, data: Uint8Array): void;
295
+ addFont(family: string, data: Uint8Array): void;
296
+ addImage(data: Uint8Array): string;
291
297
  hasMissingFonts(): boolean;
292
298
  listMissingFonts(): FontKey[];
293
299
  listAvailableFonts(): FontKey[];