@zebrash/core 1.0.0 → 1.0.2
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/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @zebrash/core
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@zebrash/core)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Internal engine for the `@zebrash` family — the
|
|
7
|
+
[ZPL II](https://en.wikipedia.org/wiki/Zebra_Programming_Language) parser,
|
|
8
|
+
drawer, and barcode encoders, plus a platform abstraction selected at bundle
|
|
9
|
+
time via the `"browser"` field in `package.json`.
|
|
10
|
+
|
|
11
|
+
> **End users should not import `@zebrash/core` directly.** It has no built-in
|
|
12
|
+
> rasterization backend. Pick the runtime-appropriate wrapper instead:
|
|
13
|
+
>
|
|
14
|
+
> - **Node / Bun:** [`@zebrash/node`](https://www.npmjs.com/package/@zebrash/node)
|
|
15
|
+
> - **Browser:** [`@zebrash/browser`](https://www.npmjs.com/package/@zebrash/browser)
|
|
16
|
+
>
|
|
17
|
+
> Both expose the same `Parser` / `Drawer` / `LabelInfo` / `DrawerOptions` API.
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
See the [main README](https://github.com/Fountain-Bio/zebrash-ts#readme) for
|
|
22
|
+
usage, supported ZPL commands, and the SVG-output reference.
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT.
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* the bytes, and returns them as `Uint8Array`. Called via the `package.json`
|
|
6
6
|
* `"browser"` field swap when bundling for the browser.
|
|
7
7
|
*
|
|
8
|
-
* Default base URL serves the fonts
|
|
9
|
-
* jsdelivr.
|
|
10
|
-
*
|
|
8
|
+
* Default base URL serves the fonts from the published `@zebrash/core`
|
|
9
|
+
* tarball via jsdelivr. The `files` field in core's package.json includes
|
|
10
|
+
* `src/assets/fonts`, so this path is stable across repo restructures and
|
|
11
|
+
* doesn't depend on branch state. Override via `setFontBaseUrl(...)` to
|
|
12
|
+
* self-host (CSP, offline, version-pinning).
|
|
11
13
|
*/
|
|
12
14
|
export type FontKey = "HelveticaBold" | "DejavuSansMono" | "DejavuSansMonoBold" | "ZplGS";
|
|
13
15
|
export declare function setFontBaseUrl(url: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts-browser.d.ts","sourceRoot":"","sources":["../../src/assets/fonts-browser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fonts-browser.d.ts","sourceRoot":"","sources":["../../src/assets/fonts-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,OAAO,CAAC;AAW1F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD;AAKD,wBAAsB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBvE"}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* the bytes, and returns them as `Uint8Array`. Called via the `package.json`
|
|
6
6
|
* `"browser"` field swap when bundling for the browser.
|
|
7
7
|
*
|
|
8
|
-
* Default base URL serves the fonts
|
|
9
|
-
* jsdelivr.
|
|
10
|
-
*
|
|
8
|
+
* Default base URL serves the fonts from the published `@zebrash/core`
|
|
9
|
+
* tarball via jsdelivr. The `files` field in core's package.json includes
|
|
10
|
+
* `src/assets/fonts`, so this path is stable across repo restructures and
|
|
11
|
+
* doesn't depend on branch state. Override via `setFontBaseUrl(...)` to
|
|
12
|
+
* self-host (CSP, offline, version-pinning).
|
|
11
13
|
*/
|
|
12
14
|
const filenames = {
|
|
13
15
|
HelveticaBold: "HelveticaBoldCondensedCustom.ttf",
|
|
@@ -15,7 +17,7 @@ const filenames = {
|
|
|
15
17
|
DejavuSansMonoBold: "DejaVuSansMonoBold.ttf",
|
|
16
18
|
ZplGS: "ZplGSCustom.ttf",
|
|
17
19
|
};
|
|
18
|
-
let baseUrl = "https://cdn.jsdelivr.net/
|
|
20
|
+
let baseUrl = "https://cdn.jsdelivr.net/npm/@zebrash/core/src/assets/fonts/";
|
|
19
21
|
export function setFontBaseUrl(url) {
|
|
20
22
|
baseUrl = url.endsWith("/") ? url : `${url}/`;
|
|
21
23
|
}
|
package/package.json
CHANGED