@zsviczian/excalidraw 0.17.1-obsidian-58-fonts-2 → 0.17.6-1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.17.1-obsidian-58-fonts-2",
3
+ "version": "0.17.6-1",
4
4
  "main": "main.js",
5
5
  "types": "types/excalidraw/index.d.ts",
6
6
  "files": [
@@ -39,7 +39,7 @@ export declare class Fonts {
39
39
  * Load font faces for passed elements - use when the scene is unavailable (i.e. export).
40
40
  */
41
41
  static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
42
- private static loadFontFaces;
42
+ static loadFontFaces(fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>): Promise<FontFace[]>;
43
43
  /**
44
44
  * WARN: should be called just once on init, even across multiple instances.
45
45
  */
@@ -49,7 +49,7 @@ export declare class Fonts {
49
49
  */
50
50
  getSceneFamilies: () => number[];
51
51
  private static getAllFamilies;
52
- private static getElementsFamilies;
52
+ static getElementsFamilies(elements: ReadonlyArray<ExcalidrawElement>): Array<ExcalidrawTextElement["fontFamily"]>;
53
53
  }
54
54
  /**
55
55
  * Register a new font.
@@ -27,7 +27,8 @@ registerLocalFont, //zsviczian
27
27
  getFontFamilies, //zsviczian
28
28
  getFontFamilyString, //zsviczian
29
29
  registerFontsInCSS, //zsviczian
30
- getCSSFontDefinition, } from "../utils/export";
30
+ getCSSFontDefinition, //zsviczian
31
+ loadSceneFonts, } from "../utils/export";
31
32
  export { refreshTextDimensions } from "./element/newElement";
32
33
  export { getContainerElement } from "./element/textElement";
33
34
  export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
@@ -1,3 +1,4 @@
1
+ import { NonDeletedExcalidrawElement } from "./element/types";
1
2
  import type { FontMetadata } from "./fonts/metadata";
2
3
  export declare let hostPlugin: any;
3
4
  export declare function destroyObsidianUtils(): void;
@@ -16,3 +17,5 @@ export declare function registerLocalFont(fontMetrics: FontMetadata & {
16
17
  export declare function getFontFamilies(): string[];
17
18
  export declare function registerFontsInCSS(): Promise<void>;
18
19
  export declare function getCSSFontDefinition(fontFamily: number): Promise<string>;
20
+ export declare function loadSceneFonts(elements: NonDeletedExcalidrawElement[]): Promise<void>;
21
+ export declare function fetchFontFromVault(url: string | URL): Promise<ArrayBuffer | undefined | string>;
@@ -41,4 +41,4 @@ export { getLineHeight } from "../excalidraw/fonts/index";
41
41
  export { getFontString, getFontFamilyString } from "../excalidraw/utils";
42
42
  export { getBoundTextMaxWidth } from "../excalidraw/element/textElement";
43
43
  export { mermaidToExcalidraw } from "../excalidraw/components/TTDDialog/MermaidToExcalidraw";
44
- export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, } from "../excalidraw/obsidianUtils";
44
+ export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, } from "../excalidraw/obsidianUtils";