tegaki 0.11.0 → 0.12.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +4 -4
  3. package/dist/core/index.d.mts +2 -2
  4. package/dist/core/index.mjs +2 -2
  5. package/dist/{core-I9K3LqxK.mjs → core-CIzLDu_Q.mjs} +250 -152
  6. package/dist/core-CIzLDu_Q.mjs.map +1 -0
  7. package/dist/fonts/caveat/bundle.d.mts +5 -2
  8. package/dist/fonts/caveat/bundle.mjs +7 -3
  9. package/dist/fonts/caveat/bundle.mjs.map +1 -1
  10. package/dist/fonts/caveat/caveat-3dc76002.ttf +0 -0
  11. package/dist/fonts/italianno/bundle.d.mts +5 -2
  12. package/dist/fonts/italianno/bundle.mjs +7 -3
  13. package/dist/fonts/italianno/bundle.mjs.map +1 -1
  14. package/dist/fonts/italianno/italianno-3dc76002.ttf +0 -0
  15. package/dist/fonts/parisienne/bundle.d.mts +5 -2
  16. package/dist/fonts/parisienne/bundle.mjs +7 -3
  17. package/dist/fonts/parisienne/bundle.mjs.map +1 -1
  18. package/dist/fonts/parisienne/parisienne-3dc76002.ttf +0 -0
  19. package/dist/fonts/tangerine/bundle.d.mts +5 -2
  20. package/dist/fonts/tangerine/bundle.mjs +7 -3
  21. package/dist/fonts/tangerine/bundle.mjs.map +1 -1
  22. package/dist/fonts/tangerine/tangerine-3dc76002.ttf +0 -0
  23. package/dist/{index-CZFVynOK.d.mts → index-DtvcCtXG.d.mts} +109 -7
  24. package/dist/{index-vDbG4xkP.d.mts → index-d5-O-2U1.d.mts} +2 -2
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.mjs +3 -3
  27. package/dist/react/index.d.mts +3 -3
  28. package/dist/react/index.mjs +3 -3
  29. package/dist/{react-DGPG66n-.mjs → react-CVoAINjv.mjs} +5 -4
  30. package/dist/react-CVoAINjv.mjs.map +1 -0
  31. package/dist/solid/index.d.mts +2 -2
  32. package/dist/solid/index.mjs +6 -4
  33. package/dist/solid/index.mjs.map +1 -1
  34. package/dist/wc/index.d.mts +12 -3
  35. package/dist/wc/index.mjs +38 -7
  36. package/dist/wc/index.mjs.map +1 -1
  37. package/fonts/caveat/bundle.ts +7 -3
  38. package/fonts/caveat/caveat-3dc76002.ttf +0 -0
  39. package/fonts/italianno/bundle.ts +7 -3
  40. package/fonts/italianno/italianno-3dc76002.ttf +0 -0
  41. package/fonts/parisienne/bundle.ts +7 -3
  42. package/fonts/parisienne/parisienne-3dc76002.ttf +0 -0
  43. package/fonts/tangerine/bundle.ts +7 -3
  44. package/fonts/tangerine/tangerine-3dc76002.ttf +0 -0
  45. package/package.json +9 -5
  46. package/src/astro/TegakiRenderer.astro +2 -2
  47. package/src/core/bundle-registry.ts +16 -1
  48. package/src/core/createBundle.ts +13 -2
  49. package/src/core/engine.ts +81 -16
  50. package/src/core/index.ts +2 -1
  51. package/src/core/render-elements.ts +5 -3
  52. package/src/core/types.ts +33 -1
  53. package/src/lib/drawGlyph.ts +140 -166
  54. package/src/lib/strokeCache.ts +77 -0
  55. package/src/lib/textLayout.ts +5 -3
  56. package/src/lib/timeline.ts +13 -1
  57. package/src/lib/utils.ts +10 -1
  58. package/src/react/TegakiRenderer.tsx +4 -2
  59. package/src/solid/TegakiRenderer.tsx +4 -2
  60. package/src/svelte/TegakiRenderer.svelte +4 -3
  61. package/src/types.ts +24 -0
  62. package/src/vue/TegakiRenderer.vue +5 -3
  63. package/src/wc/TegakiElement.ts +34 -2
  64. package/dist/core-I9K3LqxK.mjs.map +0 -1
  65. package/dist/react-DGPG66n-.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # tegaki
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - be16624: Add bundle format versioning. Generated bundles now include a `version` field (currently `0`) so the engine can detect incompatible bundles. The engine checks the version when a bundle is registered or resolved and logs a console warning (once per bundle) if the version is missing or unsupported.
8
+
9
+ New exports: `BUNDLE_VERSION`, `COMPATIBLE_BUNDLE_VERSIONS`. New optional `TegakiBundle` field: `version`. Existing bundles without a version field trigger the warning but continue to work.
10
+
11
+ - 9776ca3: Cache stroke subdivision across glyph instances. Subdivision now depends
12
+ only on (stroke points, fontSize, segmentSize) and is reused by every
13
+ occurrence of the same glyph in the rendered text. Wobble, progress
14
+ truncation, pressure, taper, and gradient are applied at draw time on
15
+ top of the shared geometry, and effect config changes no longer
16
+ invalidate the cache. Glow draws the full truncated polyline in a single
17
+ stroke() call, removing the previous per-sub-segment shadowBlur cost.
18
+
19
+ Wobble is now sampled per sub-vertex (fractional original-point index
20
+ keeps phase continuous), giving smoother curves than the previous
21
+ lerp-between-wobbled-raw-vertices.
22
+
23
+ - 1ce1324: Add subset font bundling with full-font fallback. Bundles generated from a character subset now ship two font files: a subsetted TTF for the generated glyphs and the full TTF as a CSS fallback. The subset font is registered under a scoped family name (`<family> Tegaki <hash>`) to avoid colliding with user-loaded fonts, while the full font uses the original family name. The renderer composes both in `font-family` so the browser automatically falls back to the full font for non-generated characters.
24
+
25
+ New `TegakiBundle` fields: `fullFamily`, `fullFontUrl`. Existing bundles without these fields continue to work unchanged.
26
+
27
+ ### Patch Changes
28
+
29
+ - 73a6b7e: Introduces TegakiQuality ({ pixelRatio, segmentSize }) on the engine
30
+ options, replacing the top-level segmentSize. pixelRatio multiplies
31
+ devicePixelRatio when sizing the canvas backing store and root
32
+ transform, letting the browser downsample to the displayed size for
33
+ higher-quality antialiasing at a quadratic cost in pixels filled.
34
+ segmentSize retains its prior meaning under the new namespace.
35
+ - d9b7c85: feat: add stroke and glyph easing functions
36
+ - 7aaf5d2: add rtl direction support
37
+ - 23757ca: Breaking: `quality.segmentSize` is now measured in CSS pixels instead of
38
+ font units. Subdivision count now scales with rendered size, so small
39
+ glyphs are no longer over-subdivided. A 100px stroke with segmentSize=1
40
+ yields ~100 sub-segments; the same stroke at 10px yields ~10.
41
+
42
+ ## 0.11.1
43
+
44
+ ### Patch Changes
45
+
46
+ - [`5e5049f`](https://github.com/KurtGokhan/tegaki/commit/5e5049ffc86a275fd2892fcb683d1e1ad702542e) Thanks [@KurtGokhan](https://github.com/KurtGokhan)! - use correct import path for node/ssr imports
47
+
3
48
  ## 0.11.0
4
49
 
5
50
  ### Minor Changes
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Handwriting animation for any font**
4
4
 
5
- Tegaki (手書き) turns any Google Font into animated handwriting.
5
+ Tegaki (手書き) turns any font into animated handwriting.
6
6
  No manual path authoring. No native dependencies. Just pick a font.
7
7
 
8
8
  [![npm](https://img.shields.io/npm/v/tegaki)](https://www.npmjs.com/package/tegaki)
@@ -72,7 +72,7 @@ Four handwriting fonts are bundled and ready to use:
72
72
  - **Tangerine** — `tegaki/fonts/tangerine`
73
73
  - **Parisienne** — `tegaki/fonts/parisienne`
74
74
 
75
- For other Google Fonts, use the [interactive generator](https://gkurt.com/tegaki/generator/) to create a custom bundle.
75
+ For other fonts, use the [interactive generator](https://gkurt.com/tegaki/generator/) to create a custom bundle.
76
76
 
77
77
  ## Documentation
78
78
 
@@ -80,8 +80,8 @@ Visit **[gkurt.com/tegaki](https://gkurt.com/tegaki)** for full documentation:
80
80
 
81
81
  - [Getting Started](https://gkurt.com/tegaki/getting-started/)
82
82
  - [Framework Guides](https://gkurt.com/tegaki/frameworks/react/) (React, Svelte, Vue, SolidJS, Astro, Web Components, Vanilla)
83
- - [Generating Fonts](https://gkurt.com/tegaki/guides/generating-fonts/)
84
- - [API Reference](https://gkurt.com/tegaki/api/tegaki-renderer/)
83
+ - [Generating Fonts](https://gkurt.com/tegaki/guides/generating/)
84
+ - [API Reference](https://gkurt.com/tegaki/api/renderer/)
85
85
 
86
86
  ## License
87
87
 
@@ -1,2 +1,2 @@
1
- import { A as Stroke, C as BBox, D as LineCap, E as GlyphData, F as TegakiGlyphData, I as TegakiMultiEffectName, L as TegakiSingletonEffectName, M as TegakiEffectConfigs, N as TegakiEffectName, O as PathCommand, P as TegakiEffects, R as TimedPoint, S as resolveEffects, T as FontOutput, _ as TextLayout, a as CreateElementFn, b as drawGlyph, c as TimeControlProp, d as registerBundle, f as resolveBundle, g as computeTimeline, h as TimelineEntry, i as TegakiEngine, j as TegakiBundle, k as Point, l as createBundle, m as TimelineConfig, n as buildRootProps, o as TegakiEngineOptions, p as Timeline, r as domCreateElement, s as TimeControlMode, t as buildChildren, u as getBundle, v as computeTextLayout, w as CSSLength, x as ResolvedEffect, y as ensureFontFace } from "../index-CZFVynOK.mjs";
2
- export { BBox, CSSLength, CreateElementFn, FontOutput, GlyphData, LineCap, PathCommand, Point, ResolvedEffect, Stroke, TegakiBundle, TegakiEffectConfigs, TegakiEffectName, TegakiEffects, TegakiEngine, TegakiEngineOptions, TegakiGlyphData, TegakiMultiEffectName, TegakiSingletonEffectName, TextLayout, TimeControlMode, TimeControlProp, TimedPoint, Timeline, TimelineConfig, TimelineEntry, buildChildren, buildRootProps, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, getBundle, registerBundle, resolveBundle, resolveEffects };
1
+ import { A as LineCap, B as TegakiSingletonEffectName, C as resolveEffects, D as CSSLength, E as COMPATIBLE_BUNDLE_VERSIONS, F as TegakiEffectConfigs, I as TegakiEffectName, L as TegakiEffects, M as Point, N as Stroke, O as FontOutput, P as TegakiBundle, R as TegakiGlyphData, S as ResolvedEffect, T as BUNDLE_VERSION, V as TimedPoint, _ as computeTimeline, a as CreateElementFn, b as ensureFontFace, c as TimeControlMode, d as getBundle, f as registerBundle, g as TimelineEntry, h as TimelineConfig, i as TegakiEngine, j as PathCommand, k as GlyphData, 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 TextLayout, w as BBox, x as drawGlyph, y as computeTextLayout, z as TegakiMultiEffectName } from "../index-DtvcCtXG.mjs";
2
+ export { BBox, BUNDLE_VERSION, COMPATIBLE_BUNDLE_VERSIONS, CSSLength, CreateElementFn, FontOutput, GlyphData, LineCap, PathCommand, Point, ResolvedEffect, Stroke, TegakiBundle, TegakiEffectConfigs, TegakiEffectName, TegakiEffects, TegakiEngine, TegakiEngineOptions, TegakiGlyphData, TegakiMultiEffectName, TegakiQuality, TegakiSingletonEffectName, TextLayout, TimeControlMode, TimeControlProp, TimedPoint, Timeline, TimelineConfig, TimelineEntry, buildChildren, buildRootProps, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, getBundle, registerBundle, resolveBundle, resolveEffects };
@@ -1,2 +1,2 @@
1
- import { a as createBundle, c as resolveBundle, d as ensureFontFace, f as drawGlyph, i as domCreateElement, l as computeTimeline, m as resolveEffects, n as buildChildren, o as getBundle, r as buildRootProps, s as registerBundle, t as TegakiEngine, u as computeTextLayout } from "../core-I9K3LqxK.mjs";
2
- export { TegakiEngine, buildChildren, buildRootProps, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, getBundle, registerBundle, resolveBundle, resolveEffects };
1
+ import { a as createBundle, c as resolveBundle, d as computeTimeline, f as computeTextLayout, g as resolveEffects, i as domCreateElement, l as BUNDLE_VERSION, m as drawGlyph, n as buildChildren, o as getBundle, p as ensureFontFace, r as buildRootProps, s as registerBundle, t as TegakiEngine, u as COMPATIBLE_BUNDLE_VERSIONS } from "../core-CIzLDu_Q.mjs";
2
+ export { BUNDLE_VERSION, COMPATIBLE_BUNDLE_VERSIONS, TegakiEngine, buildChildren, buildRootProps, computeTextLayout, computeTimeline, createBundle, domCreateElement, drawGlyph, ensureFontFace, getBundle, registerBundle, resolveBundle, resolveEffects };