pptx-glimpse 0.3.0 → 0.3.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/dist/index.d.cts CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * PPTX フォント名 → OSS 代替フォント (Google Fonts) のマッピング。
3
+ * ユーザーが拡張・上書き可能。
4
+ */
5
+ /** フォントマッピングテーブルの型 */
6
+ type FontMapping = Record<string, string>;
7
+ /** デフォルトのフォントマッピングテーブル */
8
+ declare const DEFAULT_FONT_MAPPING: Readonly<FontMapping>;
9
+ /**
10
+ * デフォルトマッピングとユーザーマッピングをマージしたテーブルを生成する。
11
+ * ユーザー指定が優先される。
12
+ */
13
+ declare function createFontMapping(userMapping?: FontMapping): FontMapping;
14
+ declare function getMappedFont(fontFamily: string | null | undefined, mapping: FontMapping): string | null;
15
+
1
16
  type LogLevel = "off" | "warn" | "debug";
2
17
  interface WarningEntry {
3
18
  /** The feature key, e.g. "sp.style", "bodyPr@vert" */
@@ -18,25 +33,6 @@ interface WarningSummary {
18
33
  declare function getWarningSummary(): WarningSummary;
19
34
  declare function getWarningEntries(): readonly WarningEntry[];
20
35
 
21
- /**
22
- * PPTX フォント名 → OSS 代替フォント (Google Fonts) のマッピング。
23
- * ユーザーが拡張・上書き可能。
24
- */
25
- /** フォントマッピングテーブルの型 */
26
- type FontMapping = Record<string, string>;
27
- /** デフォルトのフォントマッピングテーブル */
28
- declare const DEFAULT_FONT_MAPPING: Readonly<FontMapping>;
29
- /**
30
- * デフォルトマッピングとユーザーマッピングをマージしたテーブルを生成する。
31
- * ユーザー指定が優先される。
32
- */
33
- declare function createFontMapping(userMapping?: FontMapping): FontMapping;
34
- /**
35
- * マッピングテーブルから OSS 代替フォント名を取得する。
36
- * 大文字小文字を区別せずにルックアップする。
37
- */
38
- declare function getMappedFont(fontFamily: string | null | undefined, mapping: FontMapping): string | null;
39
-
40
36
  interface ConvertOptions {
41
37
  /** 変換対象のスライド番号 (1始まり)。未指定で全スライド */
42
38
  slides?: number[];
@@ -154,7 +150,7 @@ interface OpentypeFullFont {
154
150
  getPath(text: string, x: number, y: number, fontSize: number): OpentypePath;
155
151
  }
156
152
  interface TextPathFontResolver {
157
- resolveFont(fontFamily: string | null | undefined, fontFamilyEa: string | null | undefined): OpentypeFullFont | null;
153
+ resolveFont(fontFamily: string | null | undefined, fontFamilyEa: string | null | undefined, jpanFallback?: string | null): OpentypeFullFont | null;
158
154
  }
159
155
 
160
156
  /** フォントバッファの入力形式 */
package/dist/index.d.ts CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * PPTX フォント名 → OSS 代替フォント (Google Fonts) のマッピング。
3
+ * ユーザーが拡張・上書き可能。
4
+ */
5
+ /** フォントマッピングテーブルの型 */
6
+ type FontMapping = Record<string, string>;
7
+ /** デフォルトのフォントマッピングテーブル */
8
+ declare const DEFAULT_FONT_MAPPING: Readonly<FontMapping>;
9
+ /**
10
+ * デフォルトマッピングとユーザーマッピングをマージしたテーブルを生成する。
11
+ * ユーザー指定が優先される。
12
+ */
13
+ declare function createFontMapping(userMapping?: FontMapping): FontMapping;
14
+ declare function getMappedFont(fontFamily: string | null | undefined, mapping: FontMapping): string | null;
15
+
1
16
  type LogLevel = "off" | "warn" | "debug";
2
17
  interface WarningEntry {
3
18
  /** The feature key, e.g. "sp.style", "bodyPr@vert" */
@@ -18,25 +33,6 @@ interface WarningSummary {
18
33
  declare function getWarningSummary(): WarningSummary;
19
34
  declare function getWarningEntries(): readonly WarningEntry[];
20
35
 
21
- /**
22
- * PPTX フォント名 → OSS 代替フォント (Google Fonts) のマッピング。
23
- * ユーザーが拡張・上書き可能。
24
- */
25
- /** フォントマッピングテーブルの型 */
26
- type FontMapping = Record<string, string>;
27
- /** デフォルトのフォントマッピングテーブル */
28
- declare const DEFAULT_FONT_MAPPING: Readonly<FontMapping>;
29
- /**
30
- * デフォルトマッピングとユーザーマッピングをマージしたテーブルを生成する。
31
- * ユーザー指定が優先される。
32
- */
33
- declare function createFontMapping(userMapping?: FontMapping): FontMapping;
34
- /**
35
- * マッピングテーブルから OSS 代替フォント名を取得する。
36
- * 大文字小文字を区別せずにルックアップする。
37
- */
38
- declare function getMappedFont(fontFamily: string | null | undefined, mapping: FontMapping): string | null;
39
-
40
36
  interface ConvertOptions {
41
37
  /** 変換対象のスライド番号 (1始まり)。未指定で全スライド */
42
38
  slides?: number[];
@@ -154,7 +150,7 @@ interface OpentypeFullFont {
154
150
  getPath(text: string, x: number, y: number, fontSize: number): OpentypePath;
155
151
  }
156
152
  interface TextPathFontResolver {
157
- resolveFont(fontFamily: string | null | undefined, fontFamilyEa: string | null | undefined): OpentypeFullFont | null;
153
+ resolveFont(fontFamily: string | null | undefined, fontFamilyEa: string | null | undefined, jpanFallback?: string | null): OpentypeFullFont | null;
158
154
  }
159
155
 
160
156
  /** フォントバッファの入力形式 */