react-native-nano-icons 0.0.0 → 0.1.0
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/LICENSE +21 -0
- package/README.md +174 -0
- package/app.plugin.js +1 -0
- package/lib/commonjs/cli/build.d.ts +28 -0
- package/lib/commonjs/cli/build.js +83 -0
- package/lib/commonjs/cli/config.d.ts +9 -0
- package/lib/commonjs/cli/config.js +25 -0
- package/lib/commonjs/cli/index.d.ts +4 -0
- package/lib/commonjs/cli/index.js +13 -0
- package/lib/commonjs/cli/link.d.ts +11 -0
- package/lib/commonjs/cli/link.js +135 -0
- package/lib/commonjs/cli/logger.d.ts +27 -0
- package/lib/commonjs/cli/logger.js +83 -0
- package/lib/commonjs/index.node.js +8 -0
- package/lib/commonjs/plugin/src/buildFonts.d.ts +7 -0
- package/lib/commonjs/plugin/src/buildFonts.js +23 -0
- package/lib/commonjs/plugin/src/index.d.ts +5 -0
- package/lib/commonjs/plugin/src/index.js +43 -0
- package/lib/commonjs/plugin/src/types.d.ts +31 -0
- package/lib/commonjs/plugin/src/types.js +2 -0
- package/lib/commonjs/plugin/src/withNanoIconsFontLinking.d.ts +14 -0
- package/lib/commonjs/plugin/src/withNanoIconsFontLinking.js +92 -0
- package/lib/commonjs/scripts/cli.js +28 -0
- package/lib/commonjs/src/const/colors.d.ts +1 -0
- package/lib/commonjs/src/const/colors.js +153 -0
- package/lib/commonjs/src/core/font/compile.d.ts +9 -0
- package/lib/commonjs/src/core/font/compile.js +68 -0
- package/lib/commonjs/src/core/font/metrics.d.ts +1 -0
- package/lib/commonjs/src/core/font/metrics.js +33 -0
- package/lib/commonjs/src/core/pipeline/config.d.ts +14 -0
- package/lib/commonjs/src/core/pipeline/config.js +17 -0
- package/lib/commonjs/src/core/pipeline/index.d.ts +3 -0
- package/lib/commonjs/src/core/pipeline/index.js +7 -0
- package/lib/commonjs/src/core/pipeline/managers.d.ts +11 -0
- package/lib/commonjs/src/core/pipeline/managers.js +89 -0
- package/lib/commonjs/src/core/pipeline/run.d.ts +14 -0
- package/lib/commonjs/src/core/pipeline/run.js +99 -0
- package/lib/commonjs/src/core/svg/layers.d.ts +24 -0
- package/lib/commonjs/src/core/svg/layers.js +42 -0
- package/lib/commonjs/src/core/svg/svg_dom.d.ts +22 -0
- package/lib/commonjs/src/core/svg/svg_dom.js +84 -0
- package/lib/commonjs/src/core/svg/svg_pathops.d.ts +21 -0
- package/lib/commonjs/src/core/svg/svg_pathops.js +611 -0
- package/lib/commonjs/src/core/types.d.ts +120 -0
- package/lib/commonjs/src/core/types.js +2 -0
- package/lib/commonjs/src/utils/fingerPrint.d.ts +1 -0
- package/lib/commonjs/src/utils/fingerPrint.js +20 -0
- package/lib/commonjs/src/utils/parse.d.ts +2 -0
- package/lib/commonjs/src/utils/parse.js +64 -0
- package/lib/module/const/colors.js +153 -0
- package/lib/module/const/colors.js.map +1 -0
- package/lib/module/core/font/compile.js +70 -0
- package/lib/module/core/font/compile.js.map +1 -0
- package/lib/module/core/font/metrics.js +37 -0
- package/lib/module/core/font/metrics.js.map +1 -0
- package/lib/module/core/pipeline/config.js +20 -0
- package/lib/module/core/pipeline/config.js.map +1 -0
- package/lib/module/core/pipeline/index.js +5 -0
- package/lib/module/core/pipeline/index.js.map +1 -0
- package/lib/module/core/pipeline/managers.js +80 -0
- package/lib/module/core/pipeline/managers.js.map +1 -0
- package/lib/module/core/pipeline/run.js +114 -0
- package/lib/module/core/pipeline/run.js.map +1 -0
- package/lib/module/core/shims/pathops.py +181 -0
- package/lib/module/core/svg/layers.js +51 -0
- package/lib/module/core/svg/layers.js.map +1 -0
- package/lib/module/core/svg/svg_dom.js +83 -0
- package/lib/module/core/svg/svg_dom.js.map +1 -0
- package/lib/module/core/svg/svg_pathops.js +566 -0
- package/lib/module/core/svg/svg_pathops.js.map +1 -0
- package/lib/module/core/tsconfig.json +32 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/createNanoIconsSet.js +84 -0
- package/lib/module/createNanoIconsSet.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.node.js +13 -0
- package/lib/module/index.node.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/utils/fingerPrint.js +17 -0
- package/lib/module/utils/fingerPrint.js.map +1 -0
- package/lib/module/utils/parse.js +53 -0
- package/lib/module/utils/parse.js.map +1 -0
- package/lib/typescript/__tests__/build.unit.test.d.ts +3 -0
- package/lib/typescript/__tests__/build.unit.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/clippath.e2e.test.d.ts +3 -0
- package/lib/typescript/__tests__/clippath.e2e.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/fingerprint.unit.test.d.ts +3 -0
- package/lib/typescript/__tests__/fingerprint.unit.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/pipeline.e2e.test.d.ts +3 -0
- package/lib/typescript/__tests__/pipeline.e2e.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/placement.unit.test.d.ts +3 -0
- package/lib/typescript/__tests__/placement.unit.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/svg_dom.unit.test.d.ts +3 -0
- package/lib/typescript/__tests__/svg_dom.unit.test.d.ts.map +1 -0
- package/lib/typescript/cli/build.d.ts +29 -0
- package/lib/typescript/cli/build.d.ts.map +1 -0
- package/lib/typescript/cli/logger.d.ts +28 -0
- package/lib/typescript/cli/logger.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/const/colors.d.ts +2 -0
- package/lib/typescript/src/const/colors.d.ts.map +1 -0
- package/lib/typescript/src/core/font/compile.d.ts +10 -0
- package/lib/typescript/src/core/font/compile.d.ts.map +1 -0
- package/lib/typescript/src/core/font/metrics.d.ts +2 -0
- package/lib/typescript/src/core/font/metrics.d.ts.map +1 -0
- package/lib/typescript/src/core/pipeline/config.d.ts +15 -0
- package/lib/typescript/src/core/pipeline/config.d.ts.map +1 -0
- package/lib/typescript/src/core/pipeline/index.d.ts +4 -0
- package/lib/typescript/src/core/pipeline/index.d.ts.map +1 -0
- package/lib/typescript/src/core/pipeline/managers.d.ts +12 -0
- package/lib/typescript/src/core/pipeline/managers.d.ts.map +1 -0
- package/lib/typescript/src/core/pipeline/run.d.ts +15 -0
- package/lib/typescript/src/core/pipeline/run.d.ts.map +1 -0
- package/lib/typescript/src/core/svg/layers.d.ts +25 -0
- package/lib/typescript/src/core/svg/layers.d.ts.map +1 -0
- package/lib/typescript/src/core/svg/svg_dom.d.ts +23 -0
- package/lib/typescript/src/core/svg/svg_dom.d.ts.map +1 -0
- package/lib/typescript/src/core/svg/svg_pathops.d.ts +22 -0
- package/lib/typescript/src/core/svg/svg_pathops.d.ts.map +1 -0
- package/lib/typescript/src/core/types.d.ts +121 -0
- package/lib/typescript/src/core/types.d.ts.map +1 -0
- package/lib/typescript/src/createNanoIconsSet.d.ts +19 -0
- package/lib/typescript/src/createNanoIconsSet.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/index.node.d.ts +2 -0
- package/lib/typescript/src/index.node.d.ts.map +1 -0
- package/lib/typescript/src/utils/fingerPrint.d.ts +2 -0
- package/lib/typescript/src/utils/fingerPrint.d.ts.map +1 -0
- package/lib/typescript/src/utils/parse.d.ts +3 -0
- package/lib/typescript/src/utils/parse.d.ts.map +1 -0
- package/package.json +160 -1
- package/plugin/src/buildFonts.ts +29 -0
- package/plugin/src/index.ts +68 -0
- package/plugin/src/types.ts +33 -0
- package/plugin/src/withNanoIconsFontLinking.ts +119 -0
- package/plugin/tsconfig.json +9 -0
- package/scripts/cli.ts +34 -0
- package/scripts/tsconfig.json +25 -0
- package/src/const/colors.ts +150 -0
- package/src/core/font/compile.ts +96 -0
- package/src/core/font/metrics.ts +44 -0
- package/src/core/pipeline/config.ts +24 -0
- package/src/core/pipeline/index.ts +3 -0
- package/src/core/pipeline/managers.ts +114 -0
- package/src/core/pipeline/run.ts +151 -0
- package/src/core/shims/pathops.py +181 -0
- package/src/core/svg/layers.ts +66 -0
- package/src/core/svg/svg_dom.ts +99 -0
- package/src/core/svg/svg_pathops.ts +796 -0
- package/src/core/tsconfig.json +32 -0
- package/src/core/types.ts +138 -0
- package/src/createNanoIconsSet.tsx +131 -0
- package/src/index.node.ts +14 -0
- package/src/index.ts +7 -0
- package/src/utils/fingerPrint.ts +20 -0
- package/src/utils/parse.ts +67 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import fsp from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { compileTtfFromGlyphSVGs } from '../font/compile.js';
|
|
7
|
+
import { picoFromFile } from './managers.js';
|
|
8
|
+
import { ensureDir, ensureEmptyDir } from './config.js';
|
|
9
|
+
import { parseFlattenedSvg, preprocessSvg, shouldSkipPath, validateSvg } from '../svg/svg_dom.js';
|
|
10
|
+
import { computePlacement, writeLayerSvg } from '../svg/layers.js';
|
|
11
|
+
/**
|
|
12
|
+
* Run the font pipeline with given config and paths.
|
|
13
|
+
* Uses the singleton Pyodide/PathKit instance (initialized on first call).
|
|
14
|
+
*/
|
|
15
|
+
export async function runPipeline(config, paths, options) {
|
|
16
|
+
const startTime = Date.now();
|
|
17
|
+
const logger = options?.logger;
|
|
18
|
+
logger?.update(`Building "${config.fontFamily}"…`);
|
|
19
|
+
ensureEmptyDir(paths.tempDir);
|
|
20
|
+
ensureDir(paths.outputDir);
|
|
21
|
+
const files = (await fsp.readdir(paths.inputDir)).filter(f => f.toLowerCase().endsWith('.svg'));
|
|
22
|
+
const glyphMap = {
|
|
23
|
+
meta: {
|
|
24
|
+
fontFamily: config.fontFamily,
|
|
25
|
+
upm: config.upm,
|
|
26
|
+
safeZone: config.safeZone,
|
|
27
|
+
startUnicode: config.startUnicode
|
|
28
|
+
},
|
|
29
|
+
icons: {}
|
|
30
|
+
};
|
|
31
|
+
let currentUnicode = config.startUnicode;
|
|
32
|
+
for (const file of files) {
|
|
33
|
+
const iconName = path.parse(file).name;
|
|
34
|
+
const filePath = path.join(paths.inputDir, file);
|
|
35
|
+
logger?.info(`Processing ${file}`);
|
|
36
|
+
const rawContent = await fsp.readFile(filePath, 'utf-8');
|
|
37
|
+
const validation = validateSvg(rawContent);
|
|
38
|
+
if (validation.valid === false) {
|
|
39
|
+
logger?.warn(`Skipping "${config.fontFamily}:${file}": ${validation.reason}`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const preprocessed = preprocessSvg(rawContent);
|
|
43
|
+
const flattenedSvg = await picoFromFile(filePath, preprocessed);
|
|
44
|
+
const parsed = parseFlattenedSvg(flattenedSvg);
|
|
45
|
+
const {
|
|
46
|
+
vx,
|
|
47
|
+
vy,
|
|
48
|
+
scale,
|
|
49
|
+
xOff,
|
|
50
|
+
yOff,
|
|
51
|
+
adv
|
|
52
|
+
} = computePlacement({
|
|
53
|
+
upm: config.upm,
|
|
54
|
+
safeZone: config.safeZone,
|
|
55
|
+
viewBox: parsed.viewBox
|
|
56
|
+
});
|
|
57
|
+
const entry = {
|
|
58
|
+
adv,
|
|
59
|
+
layers: []
|
|
60
|
+
};
|
|
61
|
+
for (const p of parsed.paths) {
|
|
62
|
+
if (shouldSkipPath(p.d, p.fill)) continue;
|
|
63
|
+
const cp = currentUnicode++;
|
|
64
|
+
await writeLayerSvg({
|
|
65
|
+
tempDir: paths.tempDir,
|
|
66
|
+
upm: config.upm,
|
|
67
|
+
adv,
|
|
68
|
+
vx,
|
|
69
|
+
vy,
|
|
70
|
+
scale,
|
|
71
|
+
xOff,
|
|
72
|
+
yOff,
|
|
73
|
+
d: p.d,
|
|
74
|
+
codepoint: cp
|
|
75
|
+
});
|
|
76
|
+
entry.layers.push({
|
|
77
|
+
codepoint: cp,
|
|
78
|
+
color: p.fill || 'black'
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (entry.layers.length > 0) {
|
|
82
|
+
glyphMap.icons[iconName] = entry;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const glyphmapPath = path.join(paths.outputDir, `${config.fontFamily}.glyphmap.json`);
|
|
86
|
+
if (options?.inputHash) {
|
|
87
|
+
glyphMap.meta.hash = options.inputHash;
|
|
88
|
+
}
|
|
89
|
+
await fsp.writeFile(glyphmapPath, JSON.stringify(glyphMap, null, 2), 'utf8');
|
|
90
|
+
logger?.info(`Compiling TTF…`);
|
|
91
|
+
const ttfPath = path.join(paths.outputDir, `${config.fontFamily}.ttf`);
|
|
92
|
+
await compileTtfFromGlyphSVGs({
|
|
93
|
+
glyphDir: paths.tempDir,
|
|
94
|
+
outTtfPath: ttfPath,
|
|
95
|
+
fontName: config.fontFamily,
|
|
96
|
+
upm: config.upm,
|
|
97
|
+
ascent: config.upm,
|
|
98
|
+
descent: 0
|
|
99
|
+
});
|
|
100
|
+
if (fs.existsSync(paths.tempDir)) {
|
|
101
|
+
fs.rmSync(paths.tempDir, {
|
|
102
|
+
recursive: true,
|
|
103
|
+
force: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const iconCount = Object.keys(glyphMap.icons).length;
|
|
107
|
+
const elapsed = Date.now() - startTime;
|
|
108
|
+
logger?.succeed(`Built ${config.fontFamily}.ttf [${iconCount} icon${iconCount === 1 ? '' : 's'} in ${elapsed}ms]`);
|
|
109
|
+
return {
|
|
110
|
+
ttfPath,
|
|
111
|
+
glyphmapPath
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","fsp","path","compileTtfFromGlyphSVGs","picoFromFile","ensureDir","ensureEmptyDir","parseFlattenedSvg","preprocessSvg","shouldSkipPath","validateSvg","computePlacement","writeLayerSvg","runPipeline","config","paths","options","startTime","Date","now","logger","update","fontFamily","tempDir","outputDir","files","readdir","inputDir","filter","f","toLowerCase","endsWith","glyphMap","meta","upm","safeZone","startUnicode","icons","currentUnicode","file","iconName","parse","name","filePath","join","info","rawContent","readFile","validation","valid","warn","reason","preprocessed","flattenedSvg","parsed","vx","vy","scale","xOff","yOff","adv","viewBox","entry","layers","p","d","fill","cp","codepoint","push","color","length","glyphmapPath","inputHash","hash","writeFile","JSON","stringify","ttfPath","glyphDir","outTtfPath","fontName","ascent","descent","existsSync","rmSync","recursive","force","iconCount","Object","keys","elapsed","succeed"],"sourceRoot":"../../../../src","sources":["core/pipeline/run.ts"],"mappings":";;AAAA,OAAOA,EAAE,MAAM,SAAS;AACxB,OAAOC,GAAG,MAAM,kBAAkB;AAClC,OAAOC,IAAI,MAAM,WAAW;AAE5B,SAASC,uBAAuB,QAAQ,oBAAoB;AAC5D,SAASC,YAAY,QAAQ,eAAe;AAE5C,SACEC,SAAS,EACTC,cAAc,QAGT,aAAa;AACpB,SACEC,iBAAiB,EACjBC,aAAa,EACbC,cAAc,EACdC,WAAW,QACN,mBAAmB;AAC1B,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,kBAAkB;AASlE;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAC/BC,MAAsB,EACtBC,KAAoB,EACpBC,OAAqD,EAC5B;EACzB,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EAC5B,MAAMC,MAAM,GAAGJ,OAAO,EAAEI,MAAM;EAE9BA,MAAM,EAAEC,MAAM,CAAC,aAAaP,MAAM,CAACQ,UAAU,IAAI,CAAC;EAElDhB,cAAc,CAACS,KAAK,CAACQ,OAAO,CAAC;EAC7BlB,SAAS,CAACU,KAAK,CAACS,SAAS,CAAC;EAE1B,MAAMC,KAAK,GAAG,CAAC,MAAMxB,GAAG,CAACyB,OAAO,CAACX,KAAK,CAACY,QAAQ,CAAC,EAAEC,MAAM,CAAEC,CAAC,IACzDA,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,M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AC,CAAC,EAAE,MAAM,CAAC;EAE5EZ,MAAM,EAAEyB,IAAI,CAAC,gBAAgB,CAAC;EAC9B,MAAMiC,OAAO,GAAG5E,IAAI,CAAC0C,IAAI,CAAC7B,KAAK,CAACS,SAAS,EAAE,GAAGV,MAAM,CAACQ,UAAU,MAAM,CAAC;EAEtE,MAAMnB,uBAAuB,CAAC;IAC5B4E,QAAQ,EAAEhE,KAAK,CAACQ,OAAO;IACvByD,UAAU,EAAEF,OAAO;IACnBG,QAAQ,EAAEnE,MAAM,CAACQ,UAAU;IAC3BY,GAAG,EAAEpB,MAAM,CAACoB,GAAG;IACfgD,MAAM,EAAEpE,MAAM,CAACoB,GAAG;IAClBiD,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAInF,EAAE,CAACoF,UAAU,CAACrE,KAAK,CAACQ,OAAO,CAAC,EAAE;IAChCvB,EAAE,CAACqF,MAAM,CAACtE,KAAK,CAACQ,OAAO,EAAE;MAAE+D,SAAS,EAAE,IAAI;MAAEC,KAAK,EAAE;IAAK,CAAC,CAAC;EAC5D;EAEA,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAAC1D,QAAQ,CAACK,KAAK,CAAC,CAACkC,MAAM;EACpD,MAAMoB,OAAO,GAAGzE,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS;EACtCG,MAAM,EAAEwE,OAAO,CACb,SAAS9E,MAAM,CAACQ,UAAU,SAASkE,SAAS,QAC1CA,SAAS,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,OACrBG,OAAO,KAChB,CAAC;EAED,OAAO;IAAEb,OAAO;IAAEN;EAAa,CAAC;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# shims/pathops.py
|
|
2
|
+
#
|
|
3
|
+
# Minimal skia-pathops-compatible API backed by a JS module registered as "_pathops_js".
|
|
4
|
+
# This is designed to satisfy picosvg's usage of pathops (Path, op, enums, iteration).
|
|
5
|
+
#
|
|
6
|
+
# IMPORTANT BEHAVIOR:
|
|
7
|
+
# - skia-pathops simplify(fix_winding=True) forces fillType to WINDING.
|
|
8
|
+
# PathKit does not do that, so we emulate it here by explicitly setting fillType.
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from typing import Iterable, Iterator, List, Sequence, Tuple, Optional, Any
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
import _pathops_js # provided via pyodide.registerJsModule(...)
|
|
16
|
+
except Exception as e:
|
|
17
|
+
raise ImportError("Missing JS backend module _pathops_js") from e
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# ---- Exceptions ----
|
|
21
|
+
class PathOpsError(RuntimeError):
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# ---- Enums (values chosen to match our JS backend verb mapping) ----
|
|
26
|
+
class PathVerb:
|
|
27
|
+
MOVE = 0
|
|
28
|
+
LINE = 1
|
|
29
|
+
QUAD = 2
|
|
30
|
+
CUBIC = 3
|
|
31
|
+
CLOSE = 4
|
|
32
|
+
CONIC = 5 # should not occur for picosvg after conversions
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class FillType:
|
|
36
|
+
WINDING = 0
|
|
37
|
+
EVEN_ODD = 1
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class PathOp:
|
|
41
|
+
UNION = 0
|
|
42
|
+
INTERSECTION = 1
|
|
43
|
+
DIFFERENCE = 2
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class LineCap:
|
|
47
|
+
BUTT_CAP = 0
|
|
48
|
+
ROUND_CAP = 1
|
|
49
|
+
SQUARE_CAP = 2
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class LineJoin:
|
|
53
|
+
MITER_JOIN = 0
|
|
54
|
+
ROUND_JOIN = 1
|
|
55
|
+
BEVEL_JOIN = 2
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
Point = Tuple[float, float]
|
|
59
|
+
SvgCmd = Tuple[str, Tuple[float, ...]]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@dataclass
|
|
63
|
+
class _Handle:
|
|
64
|
+
h: Any # opaque handle owned by JS backend
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class Path:
|
|
68
|
+
def __init__(self, other: "Path" = None, *, fillType: int = FillType.WINDING):
|
|
69
|
+
if other is not None:
|
|
70
|
+
self._handle = _Handle(_pathops_js.clone_path(other._handle.h))
|
|
71
|
+
else:
|
|
72
|
+
self._handle = _Handle(_pathops_js.create_path(int(fillType)))
|
|
73
|
+
|
|
74
|
+
# ---- fillType property ----
|
|
75
|
+
@property
|
|
76
|
+
def fillType(self) -> int:
|
|
77
|
+
return int(_pathops_js.get_fill_type(self._handle.h))
|
|
78
|
+
|
|
79
|
+
@fillType.setter
|
|
80
|
+
def fillType(self, ft: int) -> None:
|
|
81
|
+
_pathops_js.set_fill_type(self._handle.h, int(ft))
|
|
82
|
+
|
|
83
|
+
# ---- drawing commands ----
|
|
84
|
+
def moveTo(self, x: float, y: float) -> None:
|
|
85
|
+
_pathops_js.move_to(self._handle.h, float(x), float(y))
|
|
86
|
+
|
|
87
|
+
def lineTo(self, x: float, y: float) -> None:
|
|
88
|
+
_pathops_js.line_to(self._handle.h, float(x), float(y))
|
|
89
|
+
|
|
90
|
+
def quadTo(self, x1: float, y1: float, x2: float, y2: float) -> None:
|
|
91
|
+
_pathops_js.quad_to(self._handle.h, float(x1), float(y1), float(x2), float(y2))
|
|
92
|
+
|
|
93
|
+
def cubicTo(self, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> None:
|
|
94
|
+
_pathops_js.cubic_to(self._handle.h, float(x1), float(y1), float(x2), float(y2), float(x3), float(y3))
|
|
95
|
+
|
|
96
|
+
def close(self) -> None:
|
|
97
|
+
_pathops_js.close(self._handle.h)
|
|
98
|
+
|
|
99
|
+
# ---- transforms ----
|
|
100
|
+
def transform(self, a: float, b: float, c: float, d: float, e: float, f: float) -> "Path":
|
|
101
|
+
out_h = _pathops_js.transform(self._handle.h, float(a), float(b), float(c), float(d), float(e), float(f))
|
|
102
|
+
out = Path.__new__(Path)
|
|
103
|
+
out._handle = _Handle(out_h)
|
|
104
|
+
return out
|
|
105
|
+
|
|
106
|
+
# ---- simplify / stroke ----
|
|
107
|
+
def simplify(self, fix_winding: bool = False) -> None:
|
|
108
|
+
ok = bool(_pathops_js.simplify(self._handle.h, bool(fix_winding)))
|
|
109
|
+
# In skia-pathops, simplify(fix_winding=True) forces WINDING fill type.
|
|
110
|
+
if fix_winding:
|
|
111
|
+
_pathops_js.set_fill_type(self._handle.h, int(FillType.WINDING))
|
|
112
|
+
if not ok:
|
|
113
|
+
# skia-pathops may throw PathOpsError; picosvg usually expects simplify to succeed
|
|
114
|
+
# but some paths can be tricky. We'll be conservative and not throw.
|
|
115
|
+
return
|
|
116
|
+
|
|
117
|
+
def stroke(
|
|
118
|
+
self,
|
|
119
|
+
stroke_width: float,
|
|
120
|
+
cap: int,
|
|
121
|
+
join: int,
|
|
122
|
+
miter_limit: float,
|
|
123
|
+
dash_array: Sequence[float] = (),
|
|
124
|
+
dash_offset: float = 0.0,
|
|
125
|
+
) -> None:
|
|
126
|
+
out_h = _pathops_js.stroke(
|
|
127
|
+
self._handle.h,
|
|
128
|
+
float(stroke_width),
|
|
129
|
+
int(cap),
|
|
130
|
+
int(join),
|
|
131
|
+
float(miter_limit),
|
|
132
|
+
list(map(float, dash_array)) if dash_array else [],
|
|
133
|
+
float(dash_offset),
|
|
134
|
+
)
|
|
135
|
+
if out_h is None:
|
|
136
|
+
raise PathOpsError("stroke failed")
|
|
137
|
+
# Replace in-place (matches typical expectations)
|
|
138
|
+
self._handle = _Handle(out_h)
|
|
139
|
+
|
|
140
|
+
def convertConicsToQuads(self, tolerance: float = 0.25) -> None:
|
|
141
|
+
# PathKit roundtrip already avoids conics for our use cases
|
|
142
|
+
_pathops_js.convert_conics_to_quads(self._handle.h, float(tolerance))
|
|
143
|
+
|
|
144
|
+
# ---- geometry ----
|
|
145
|
+
@property
|
|
146
|
+
def bounds(self) -> Tuple[float, float, float, float]:
|
|
147
|
+
b = _pathops_js.bounds(self._handle.h)
|
|
148
|
+
return (float(b[0]), float(b[1]), float(b[2]), float(b[3]))
|
|
149
|
+
|
|
150
|
+
@property
|
|
151
|
+
def area(self) -> float:
|
|
152
|
+
return float(_pathops_js.area(self._handle.h))
|
|
153
|
+
|
|
154
|
+
# ---- iteration ----
|
|
155
|
+
def __iter__(self) -> Iterator[Tuple[int, List[Point]]]:
|
|
156
|
+
# JS backend returns list of [verbInt, [[x,y], ...]]
|
|
157
|
+
segs = _pathops_js.iter_segments(self._handle.h)
|
|
158
|
+
for verb, pts in segs:
|
|
159
|
+
out_pts: List[Point] = [(float(p[0]), float(p[1])) for p in pts]
|
|
160
|
+
yield int(verb), out_pts
|
|
161
|
+
|
|
162
|
+
# ---- cleanup ----
|
|
163
|
+
def __del__(self):
|
|
164
|
+
try:
|
|
165
|
+
_pathops_js.delete_path(self._handle.h)
|
|
166
|
+
except Exception:
|
|
167
|
+
pass
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def op(path1: Path, path2: Path, op: int, fix_winding: bool = False) -> Path:
|
|
171
|
+
out_h = _pathops_js.op(path1._handle.h, path2._handle.h, int(op))
|
|
172
|
+
if out_h is None:
|
|
173
|
+
raise PathOpsError("operation did not succeed")
|
|
174
|
+
|
|
175
|
+
out = Path.__new__(Path)
|
|
176
|
+
out._handle = _Handle(out_h)
|
|
177
|
+
|
|
178
|
+
if fix_winding:
|
|
179
|
+
_pathops_js.set_fill_type(out._handle.h, int(FillType.WINDING))
|
|
180
|
+
|
|
181
|
+
return out
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
function roundInt(n) {
|
|
6
|
+
return Math.round(n);
|
|
7
|
+
}
|
|
8
|
+
export function computePlacement(opts) {
|
|
9
|
+
const [vx, vy, vw, vh] = opts.viewBox;
|
|
10
|
+
|
|
11
|
+
// Guard against invalid viewBox height from source svg
|
|
12
|
+
const safeVh = vh === 0 ? 1 : vh;
|
|
13
|
+
|
|
14
|
+
// ✅ Fit-to-height (same visual height for all glyphs)
|
|
15
|
+
const scale = opts.safeZone / safeVh;
|
|
16
|
+
const totalPadding = (opts.upm - opts.safeZone) / 2;
|
|
17
|
+
|
|
18
|
+
// Scaled dimensions in font units
|
|
19
|
+
const scaledW = vw * scale;
|
|
20
|
+
const scaledH = vh * scale; // ~= safeZone
|
|
21
|
+
|
|
22
|
+
// ✅ proportional advance width (includes same padding concept as vertical)
|
|
23
|
+
// This is the width of the glyph coordinate space we will emit in the layer SVG.
|
|
24
|
+
const adv = Math.max(1, roundInt(scaledW + totalPadding * 2));
|
|
25
|
+
|
|
26
|
+
// Center scaled content within (adv x upm)
|
|
27
|
+
// (when adv == scaledW + 2*padding, xOff is basically padding, with rounding compensation)
|
|
28
|
+
const xOff = (adv - scaledW) / 2;
|
|
29
|
+
const yOff = (opts.upm - scaledH) / 2; // ~= totalPadding
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
vx,
|
|
33
|
+
vy,
|
|
34
|
+
scale,
|
|
35
|
+
xOff,
|
|
36
|
+
yOff,
|
|
37
|
+
adv
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export async function writeLayerSvg(opts) {
|
|
41
|
+
const hex = opts.codepoint.toString(16).padStart(4, '0');
|
|
42
|
+
const layerSvg = `
|
|
43
|
+
<svg viewBox="0 0 ${opts.adv} ${opts.upm}" xmlns="http://www.w3.org/2000/svg">
|
|
44
|
+
<rect width="${opts.adv}" height="${opts.upm}" fill="none" />
|
|
45
|
+
<g transform="translate(${opts.xOff}, ${opts.yOff}) scale(${opts.scale}) translate(${-opts.vx}, ${-opts.vy})">
|
|
46
|
+
<path d="${opts.d}" fill="black" />
|
|
47
|
+
</g>
|
|
48
|
+
</svg>`.trim();
|
|
49
|
+
await fsp.writeFile(path.join(opts.tempDir, `u${hex}.svg`), layerSvg, 'utf8');
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=layers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fsp","path","roundInt","n","Math","round","computePlacement","opts","vx","vy","vw","vh","viewBox","safeVh","scale","safeZone","totalPadding","upm","scaledW","scaledH","adv","max","xOff","yOff","writeLayerSvg","hex","codepoint","toString","padStart","layerSvg","d","trim","writeFile","join","tempDir"],"sourceRoot":"../../../../src","sources":["core/svg/layers.ts"],"mappings":";;AAAA,OAAOA,GAAG,MAAM,kBAAkB;AAClC,OAAOC,IAAI,MAAM,WAAW;AAE5B,SAASC,QAAQA,CAACC,CAAS,EAAU;EACnC,OAAOC,IAAI,CAACC,KAAK,CAACF,CAAC,CAAC;AACtB;AAEA,OAAO,SAASG,gBAAgBA,CAACC,IAIhC,EAAE;EACD,MAAM,CAACC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE,CAAC,GAAGJ,IAAI,CAACK,OAAO;;EAErC;EACA,MAAMC,MAAM,GAAGF,EAAE,KAAK,CAAC,GAAG,CAAC,GAAGA,EAAE;;EAEhC;EACA,MAAMG,KAAK,GAAGP,IAAI,CAACQ,QAAQ,GAAGF,MAAM;EAEpC,MAAMG,YAAY,GAAG,CAACT,IAAI,CAACU,GAAG,GAAGV,IAAI,CAACQ,QAAQ,IAAI,CAAC;;EAEnD;EACA,MAAMG,OAAO,GAAGR,EAAE,GAAGI,KAAK;EAC1B,MAAMK,OAAO,GAAGR,EAAE,GAAGG,KAAK,CAAC,CAAC;;EAE5B;EACA;EACA,MAAMM,GAAG,GAAGhB,IAAI,CAACiB,GAAG,CAAC,CAAC,EAAEnB,QAAQ,CAACgB,OAAO,GAAGF,YAAY,GAAG,CAAC,CAAC,CAAC;;EAE7D;EACA;EACA,MAAMM,IAAI,GAAG,CAACF,GAAG,GAAGF,OAAO,IAAI,CAAC;EAChC,MAAMK,IAAI,GAAG,CAAChB,IAAI,CAACU,GAAG,GAAGE,OAAO,IAAI,CAAC,CAAC,CAAC;;EAEvC,OAAO;IAAEX,EAAE;IAAEC,EAAE;IAAEK,KAAK;IAAEQ,IAAI;IAAEC,IAAI;IAAEH;EAAI,CAAC;AAC3C;AAEA,OAAO,eAAeI,aAAaA,CAACjB,IAWnC,EAAiB;EAChB,MAAMkB,GAAG,GAAGlB,IAAI,CAACmB,SAAS,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAExD,MAAMC,QAAQ,GAAG;AACnB,wBAAwBtB,IAAI,CAACa,GAAG,IAC5Bb,IAAI,CAACU,GAAG;AACZ,qBACqBV,IAAI,CAACa,GAAG,aAAab,IAAI,CAACU,GAAG;AAClD,gCAAgCV,IAAI,CAACe,IAAI,KAAKf,IAAI,CAACgB,IAAI,WACnDhB,IAAI,CAACO,KAAK,eACG,CAACP,IAAI,CAACC,EAAE,KAAK,CAACD,IAAI,CAACE,EAAE;AACtC,mBAAmBF,IAAI,CAACuB,CAAC;AACzB;AACA,WAAW,CAACC,IAAI,CAAC,CAAC;EAEhB,MAAM/B,GAAG,CAACgC,SAAS,CAAC/B,IAAI,CAACgC,IAAI,CAAC1B,IAAI,CAAC2B,OAAO,EAAE,IAAIT,GAAG,MAAM,CAAC,EAAEI,QAAQ,EAAE,MAAM,CAAC;AAC/E","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { JSDOM } from 'jsdom';
|
|
4
|
+
import { parseColor } from "../../utils/parse.js";
|
|
5
|
+
// if the fill is implicit, walk ancestors for the first explicit fill value
|
|
6
|
+
function resolveInheritedFill(el) {
|
|
7
|
+
let current = el.parentElement;
|
|
8
|
+
while (current !== null) {
|
|
9
|
+
const fill = current.getAttribute('fill');
|
|
10
|
+
if (fill !== null && fill !== 'inherit') return fill;
|
|
11
|
+
current = current.parentElement;
|
|
12
|
+
}
|
|
13
|
+
return 'black';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// bake opacity into the fill as an rgba(...)
|
|
17
|
+
export function calculateOpColor(fill, opacity, el) {
|
|
18
|
+
const resolvedFill = fill ?? resolveInheritedFill(el);
|
|
19
|
+
const [r, g, b, a] = parseColor(resolvedFill);
|
|
20
|
+
const finalAlpha = +(a * opacity).toFixed(4);
|
|
21
|
+
return `rgba(${r},${g},${b},${finalAlpha})`;
|
|
22
|
+
}
|
|
23
|
+
export const parsePath = p => {
|
|
24
|
+
const d = p.getAttribute('d') ?? '';
|
|
25
|
+
const op = p.getAttribute('opacity');
|
|
26
|
+
const fillOp = p.getAttribute('fill-opacity');
|
|
27
|
+
const fill = p.getAttribute('fill');
|
|
28
|
+
if (op !== null || fillOp !== null) {
|
|
29
|
+
const opVal = op !== null ? parseFloat(op) : 1;
|
|
30
|
+
const fillOpVal = fillOp !== null ? parseFloat(fillOp) : 1;
|
|
31
|
+
const combinedOpacity = opVal * fillOpVal;
|
|
32
|
+
return {
|
|
33
|
+
d,
|
|
34
|
+
fill: calculateOpColor(fill, combinedOpacity, p)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
d,
|
|
39
|
+
fill
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export function parseFlattenedSvg(flattenedSvg) {
|
|
43
|
+
const dom = new JSDOM(flattenedSvg);
|
|
44
|
+
const doc = dom.window.document;
|
|
45
|
+
const svgEl = doc.querySelector('svg');
|
|
46
|
+
const viewBoxRaw = svgEl?.getAttribute('viewBox')?.split(/\s+/).map(Number) ?? [0, 0, 100, 100];
|
|
47
|
+
const viewBox = viewBoxRaw.length === 4 && viewBoxRaw.every(n => Number.isFinite(n)) ? [viewBoxRaw[0], viewBoxRaw[1], viewBoxRaw[2], viewBoxRaw[3]] : [0, 0, 100, 100];
|
|
48
|
+
const pathEls = Array.from(doc.querySelectorAll('path'));
|
|
49
|
+
const paths = pathEls.map(parsePath).filter(p => p.d.trim() !== '');
|
|
50
|
+
return {
|
|
51
|
+
viewBox,
|
|
52
|
+
paths
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function shouldSkipPath(d, fill) {
|
|
56
|
+
if (!d || d.trim() === '') return true;
|
|
57
|
+
const f = (fill ?? '').trim().toLowerCase();
|
|
58
|
+
return f === 'transparent' || f === 'none';
|
|
59
|
+
}
|
|
60
|
+
export function validateSvg(content) {
|
|
61
|
+
if (/<mask[\s>]/i.test(content)) {
|
|
62
|
+
return {
|
|
63
|
+
valid: false,
|
|
64
|
+
reason: '<mask> is not supported yet'
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (/<filter[\s>]/i.test(content)) {
|
|
68
|
+
return {
|
|
69
|
+
valid: false,
|
|
70
|
+
reason: '<filter> is not supported yet'
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
valid: true
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ensure the svg has a xmlns attribute
|
|
79
|
+
export function preprocessSvg(content) {
|
|
80
|
+
if (/xmlns\s*=/.test(content)) return content;
|
|
81
|
+
return content.replace(/<svg\b/, '<svg xmlns="http://www.w3.org/2000/svg"');
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=svg_dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["JSDOM","parseColor","resolveInheritedFill","el","current","parentElement","fill","getAttribute","calculateOpColor","opacity","resolvedFill","r","g","b","a","finalAlpha","toFixed","parsePath","p","d","op","fillOp","opVal","parseFloat","fillOpVal","combinedOpacity","parseFlattenedSvg","flattenedSvg","dom","doc","window","document","svgEl","querySelector","viewBoxRaw","split","map","Number","viewBox","length","every","n","isFinite","pathEls","Array","from","querySelectorAll","paths","filter","trim","shouldSkipPath","f","toLowerCase","validateSvg","content","test","valid","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