tegaki 0.14.0 → 0.16.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/CHANGELOG.md +44 -0
- package/FONTS-LICENSE.md +18 -0
- package/README.md +13 -5
- package/dist/core/index.d.mts +3 -2
- package/dist/core/index.mjs +2 -2
- package/dist/{core-BYU5BEaZ.mjs → core-BRYlZ8i2.mjs} +688 -115
- package/dist/core-BRYlZ8i2.mjs.map +1 -0
- package/dist/{index-DlYttK-R.d.mts → index-Duog5eW6.d.mts} +3 -2
- package/dist/{index-BBRejOMe.d.mts → index-Qr39WZaW.d.mts} +152 -164
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +3 -3
- package/dist/react/index.d.mts +4 -3
- package/dist/react/index.mjs +3 -3
- package/dist/{react-0gtC94df.mjs → react-Eq0zlDsb.mjs} +4 -3
- package/dist/react-Eq0zlDsb.mjs.map +1 -0
- package/dist/shaper-harfbuzz/index.d.mts +44 -0
- package/dist/shaper-harfbuzz/index.mjs +160 -0
- package/dist/shaper-harfbuzz/index.mjs.map +1 -0
- package/dist/shaper-registry-HD6_qkK4.d.mts +241 -0
- package/dist/solid/index.d.mts +3 -2
- package/dist/solid/index.mjs +5 -2
- package/dist/solid/index.mjs.map +1 -1
- package/dist/wc/index.d.mts +4 -3
- package/dist/wc/index.mjs +6 -3
- package/dist/wc/index.mjs.map +1 -1
- package/fonts/amiri/amiri-7df37680.ttf +0 -0
- package/fonts/amiri/amiri.ttf +0 -0
- package/fonts/amiri/bundle.ts +23 -0
- package/fonts/amiri/glyphData.json +1 -0
- package/fonts/amiri/glyphDataById.json +1 -0
- package/fonts/klee-one/bundle.ts +23 -0
- package/fonts/klee-one/glyphData.json +1 -0
- package/fonts/klee-one/glyphDataById.json +1 -0
- package/fonts/klee-one/klee-one-d192e144.ttf +0 -0
- package/fonts/klee-one/klee-one.ttf +0 -0
- package/fonts/suez-one/bundle.ts +23 -0
- package/fonts/suez-one/glyphData.json +1 -0
- package/fonts/suez-one/glyphDataById.json +1 -0
- package/fonts/suez-one/suez-one-ac7f1d1c.ttf +0 -0
- package/fonts/suez-one/suez-one.ttf +0 -0
- package/package.json +35 -2
- package/src/astro/TegakiRenderer.astro +3 -2
- package/src/core/engine.ts +204 -64
- package/src/core/index.ts +13 -2
- package/src/core/render-elements.ts +2 -0
- package/src/core/shaper-registry.ts +45 -0
- package/src/core/types.ts +9 -1
- package/src/lib/drawFallbackGlyph.ts +6 -6
- package/src/lib/drawGlyph.ts +39 -14
- package/src/lib/effects.test.ts +188 -0
- package/src/lib/effects.ts +106 -3
- package/src/lib/features.ts +28 -0
- package/src/lib/font.ts +27 -15
- package/src/lib/harfbuzzjs.d.ts +71 -0
- package/src/lib/shaper.ts +22 -0
- package/src/lib/textLayout.ts +196 -0
- package/src/lib/timeline.ts +343 -22
- package/src/react/TegakiRenderer.tsx +2 -0
- package/src/shaper-harfbuzz/index.test.ts +148 -0
- package/src/shaper-harfbuzz/index.ts +219 -0
- package/src/solid/TegakiRenderer.tsx +3 -1
- package/src/svelte/TegakiRenderer.svelte +4 -3
- package/src/types.test.ts +17 -7
- package/src/types.ts +50 -3
- package/src/vue/TegakiRenderer.vue +3 -1
- package/src/wc/TegakiElement.ts +3 -0
- package/dist/core-BYU5BEaZ.mjs.map +0 -1
- package/dist/react-0gtC94df.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# tegaki
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 39e075e: Added support for font features and ligatures, RTL languages like Arabic and Hebrew, and text shaping with Harfbuzz. Three new built-in font bundles ship for non-Latin scripts: `tegaki/fonts/suez-one` (Hebrew), `tegaki/fonts/amiri` (Arabic), and `tegaki/fonts/klee-one` (Japanese — kana, JP punctuation, and Kyōiku grade 1–2 kanji).
|
|
8
|
+
|
|
9
|
+
## 0.15.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- ecba479: Split `gradient` into `strokeGradient` + `globalGradient`, and add render-stage hooks for layout-spanning effects. Closes #26.
|
|
14
|
+
|
|
15
|
+
**Breaking**
|
|
16
|
+
|
|
17
|
+
The `gradient` effect is renamed to `strokeGradient` with unchanged behavior (each stroke independently maps its progress to the color stops; `colors: 'rainbow'` still works). Rename the key in your `effects` prop:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
// before
|
|
21
|
+
effects={{ gradient: { colors: ['#f00', '#00f'] } }}
|
|
22
|
+
// after
|
|
23
|
+
effects={{ strokeGradient: { colors: ['#f00', '#00f'] } }}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**New — `globalGradient`**
|
|
27
|
+
|
|
28
|
+
A canvas-space linear gradient that spans the full text bounding box — the leftmost pixel of the first glyph is `colors[0]` and the rightmost pixel of the last glyph is `colors[N]`, regardless of stroke boundaries. Matches CSS `background-clip: text` semantics.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
effects={{
|
|
32
|
+
globalGradient: {
|
|
33
|
+
colors: ['#f00', '#00f'],
|
|
34
|
+
angle: 0, // 0 = left→right (default); 90 = top→bottom; positive = clockwise
|
|
35
|
+
},
|
|
36
|
+
}}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`strokeGradient` and `globalGradient` can be enabled independently. If both are on, `strokeGradient` wins per segment (its per-stroke color overrides `globalGradient`'s canvas-wide paint); this combination is unusual but predictable.
|
|
40
|
+
|
|
41
|
+
**New — effect render-stage hooks**
|
|
42
|
+
|
|
43
|
+
Effects can now declare optional `beforeRender(stage, config)` / `afterRender(stage, config)` hooks on their `EffectDefinition` metadata. The stage context exposes the 2D context, the `TextLayout`, a pre-computed `LayoutBBox`, base color, and seed. Hooks run once around the glyph loop (before in forward order, after in reverse), so effects spanning the whole layout — like `globalGradient` — have a natural place to set up canvas state. Built-in per-stroke effects (`glow`, `wobble`, `pressureWidth`, `taper`, `strokeGradient`) declare no hooks and are unaffected.
|
|
44
|
+
|
|
45
|
+
**New public exports from `tegaki/core`**: `EffectDefinition`, `RenderStageContext`, `LayoutBBox`, `getEffectDefinition`, `hasRenderHooks`, `computeLayoutBbox`, plus the previously-private `findEffect` / `findEffects`.
|
|
46
|
+
|
|
3
47
|
## 0.14.0
|
|
4
48
|
|
|
5
49
|
### Minor Changes
|
package/FONTS-LICENSE.md
CHANGED
|
@@ -27,6 +27,24 @@ All fonts are licensed under the [SIL Open Font License, Version 1.1](https://op
|
|
|
27
27
|
- **Copyright**: Copyright (c) 2012 by Brian J. Bonislawsky DBA Astigmatic (AOETI)
|
|
28
28
|
- **License**: SIL Open Font License, Version 1.1
|
|
29
29
|
|
|
30
|
+
## Suez One
|
|
31
|
+
|
|
32
|
+
- **Designer**: Michal Sahar
|
|
33
|
+
- **Copyright**: Copyright 2016 Michal Sahar. All rights reserved.
|
|
34
|
+
- **License**: SIL Open Font License, Version 1.1
|
|
35
|
+
|
|
36
|
+
## Klee One
|
|
37
|
+
|
|
38
|
+
- **Designer**: Fontworks Inc.
|
|
39
|
+
- **Copyright**: Copyright 2020 The Klee Project Authors (https://github.com/fontworks-fonts/Klee)
|
|
40
|
+
- **License**: SIL Open Font License, Version 1.1
|
|
41
|
+
|
|
42
|
+
## Amiri
|
|
43
|
+
|
|
44
|
+
- **Designer**: Khaled Hosny
|
|
45
|
+
- **Copyright**: Copyright 2010-2022 The Amiri Project Authors (https://github.com/aliftype/amiri)
|
|
46
|
+
- **License**: SIL Open Font License, Version 1.1
|
|
47
|
+
|
|
30
48
|
---
|
|
31
49
|
|
|
32
50
|
## SIL Open Font License, Version 1.1
|
package/README.md
CHANGED
|
@@ -65,12 +65,15 @@ import { registerTegakiElement } from 'tegaki/wc'; // Web Components
|
|
|
65
65
|
|
|
66
66
|
## Built-in Fonts
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Several handwriting fonts are bundled and ready to use:
|
|
69
69
|
|
|
70
|
-
- **Caveat** — `tegaki/fonts/caveat`
|
|
71
|
-
- **Italianno** — `tegaki/fonts/italianno`
|
|
72
|
-
- **Tangerine** — `tegaki/fonts/tangerine`
|
|
73
|
-
- **Parisienne** — `tegaki/fonts/parisienne`
|
|
70
|
+
- **Caveat** — `tegaki/fonts/caveat` _(Latin)_
|
|
71
|
+
- **Italianno** — `tegaki/fonts/italianno` _(Latin)_
|
|
72
|
+
- **Tangerine** — `tegaki/fonts/tangerine` _(Latin)_
|
|
73
|
+
- **Parisienne** — `tegaki/fonts/parisienne` _(Latin)_
|
|
74
|
+
- **Suez One** — `tegaki/fonts/suez-one` _(Hebrew + Latin)_
|
|
75
|
+
- **Amiri** — `tegaki/fonts/amiri` _(Arabic + Latin)_
|
|
76
|
+
- **Klee One** — `tegaki/fonts/klee-one` _(Japanese: kana + Kyōiku grade 1–2 kanji + Latin)_
|
|
74
77
|
|
|
75
78
|
For other fonts, use the [interactive generator](https://gkurt.com/tegaki/generator/) to create a custom bundle.
|
|
76
79
|
|
|
@@ -83,6 +86,11 @@ Visit **[gkurt.com/tegaki](https://gkurt.com/tegaki)** for full documentation:
|
|
|
83
86
|
- [Generating Fonts](https://gkurt.com/tegaki/guides/generating/)
|
|
84
87
|
- [API Reference](https://gkurt.com/tegaki/api/renderer/)
|
|
85
88
|
|
|
89
|
+
## Integrations
|
|
90
|
+
|
|
91
|
+
- [Sli.dev](https://sli.dev/) - Create presentations using markdown. [See Tegaki integration example](https://andreas-taranetz.github.io/slidev-addon-animated-text/)
|
|
92
|
+
- [Remotion](https://www.remotion.dev/) - Create videos programmatically with React. [See Tegaki integration example](https://github.com/KurtGokhan/tegaki/blob/gokhan/support-font-features/examples/remotion/src/Root.tsx)
|
|
93
|
+
|
|
86
94
|
## License
|
|
87
95
|
|
|
88
96
|
[MIT](LICENSE)
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { S as TimedPoint, _ as TegakiEffectName, a as BBox, b as TegakiMultiEffectName, c as CSSLength, d as LineCap, f as PathCommand, g as TegakiEffectConfigs, h as TegakiBundle, i as ShapedGlyph, l as FontOutput, m as Stroke, o as BUNDLE_VERSION, p as Point, r as BundleShaper, s as COMPATIBLE_BUNDLE_VERSIONS, t as ShaperFactory, u as GlyphData, v as TegakiEffects, x as TegakiSingletonEffectName, y as TegakiGlyphData } from "../shaper-registry-HD6_qkK4.mjs";
|
|
2
|
+
import { A as computeLayoutBbox, C as findEffect, D as resolveEffects, E as hasRenderHooks, O as LayoutBBox, S as ResolvedEffect, T as getEffectDefinition, _ as computeTimeline, a as CreateElementFn, b as EffectDefinition, c as TimeControlMode, d as getBundle, f as registerBundle, g as TimelineEntry, h as TimelineConfig, i as TegakiEngine, j as computeTextLayout, k as TextLayout, l as TimeControlProp, m as Timeline, n as buildRootProps, o as TegakiEngineOptions, p as resolveBundle, r as domCreateElement, s as TegakiQuality, t as buildChildren, u as createBundle, v as ensureFontFace, w as findEffects, x as RenderStageContext, y as drawGlyph } from "../index-Qr39WZaW.mjs";
|
|
3
|
+
export { BBox, BUNDLE_VERSION, BundleShaper, COMPATIBLE_BUNDLE_VERSIONS, CSSLength, CreateElementFn, EffectDefinition, FontOutput, GlyphData, LayoutBBox, LineCap, PathCommand, Point, RenderStageContext, ResolvedEffect, ShapedGlyph, ShaperFactory, Stroke, TegakiBundle, TegakiEffectConfigs, TegakiEffectName, TegakiEffects, TegakiEngine, TegakiEngineOptions, TegakiGlyphData, TegakiMultiEffectName, TegakiQuality, TegakiSingletonEffectName, TextLayout, TimeControlMode, TimeControlProp, TimedPoint, Timeline, TimelineConfig, TimelineEntry, buildChildren, buildRootProps, computeLayoutBbox, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, findEffect, findEffects, getBundle, getEffectDefinition, hasRenderHooks, registerBundle, resolveBundle, resolveEffects };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createBundle, c as resolveBundle, d as computeTimeline, f as
|
|
2
|
-
export { BUNDLE_VERSION, COMPATIBLE_BUNDLE_VERSIONS, TegakiEngine, buildChildren, buildRootProps, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, getBundle, registerBundle, resolveBundle, resolveEffects };
|
|
1
|
+
import { _ as findEffect, a as createBundle, b as hasRenderHooks, c as resolveBundle, d as computeTimeline, f as computeLayoutBbox, h as drawGlyph, i as domCreateElement, l as BUNDLE_VERSION, m as ensureFontFace, n as buildChildren, o as getBundle, p as computeTextLayout, r as buildRootProps, s as registerBundle, t as TegakiEngine, u as COMPATIBLE_BUNDLE_VERSIONS, v as findEffects, x as resolveEffects, y as getEffectDefinition } from "../core-BRYlZ8i2.mjs";
|
|
2
|
+
export { BUNDLE_VERSION, COMPATIBLE_BUNDLE_VERSIONS, TegakiEngine, buildChildren, buildRootProps, computeLayoutBbox, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, findEffect, findEffects, getBundle, getEffectDefinition, hasRenderHooks, registerBundle, resolveBundle, resolveEffects };
|