tegaki 0.15.0 → 0.17.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 (114) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/FONTS-LICENSE.md +24 -0
  3. package/README.md +14 -5
  4. package/dist/core/index.d.mts +3 -2
  5. package/dist/core/index.mjs +1 -1
  6. package/dist/{core-B7NiOWkP.mjs → core-BrU5Htjs.mjs} +678 -90
  7. package/dist/core-BrU5Htjs.mjs.map +1 -0
  8. package/dist/fonts/amiri/amiri-7df37680.ttf +0 -0
  9. package/dist/fonts/amiri/amiri.ttf +0 -0
  10. package/dist/fonts/amiri/bundle.d.mts +10631 -0
  11. package/dist/fonts/amiri/bundle.mjs +130866 -0
  12. package/dist/fonts/amiri/bundle.mjs.map +1 -0
  13. package/dist/fonts/caveat/bundle.d.mts +1992 -10
  14. package/dist/fonts/caveat/bundle.mjs +31054 -105
  15. package/dist/fonts/caveat/bundle.mjs.map +1 -1
  16. package/dist/fonts/italianno/bundle.d.mts +1548 -10
  17. package/dist/fonts/italianno/bundle.mjs +32832 -198
  18. package/dist/fonts/italianno/bundle.mjs.map +1 -1
  19. package/dist/fonts/klee-one/bundle.d.mts +11442 -0
  20. package/dist/fonts/klee-one/bundle.mjs +234910 -0
  21. package/dist/fonts/klee-one/bundle.mjs.map +1 -0
  22. package/dist/fonts/klee-one/klee-one-d192e144.ttf +0 -0
  23. package/dist/fonts/klee-one/klee-one.ttf +0 -0
  24. package/dist/fonts/parisienne/bundle.d.mts +939 -10
  25. package/dist/fonts/parisienne/bundle.mjs +19540 -192
  26. package/dist/fonts/parisienne/bundle.mjs.map +1 -1
  27. package/dist/fonts/suez-one/bundle.d.mts +2181 -0
  28. package/dist/fonts/suez-one/bundle.mjs +30466 -0
  29. package/dist/fonts/suez-one/bundle.mjs.map +1 -0
  30. package/dist/fonts/suez-one/suez-one-ac7f1d1c.ttf +0 -0
  31. package/dist/fonts/suez-one/suez-one.ttf +0 -0
  32. package/dist/fonts/tangerine/bundle.d.mts +40 -10
  33. package/dist/fonts/tangerine/bundle.mjs +52 -119
  34. package/dist/fonts/tangerine/bundle.mjs.map +1 -1
  35. package/dist/fonts/tillana/bundle.d.mts +8557 -0
  36. package/dist/fonts/tillana/bundle.mjs +224308 -0
  37. package/dist/fonts/tillana/bundle.mjs.map +1 -0
  38. package/dist/fonts/tillana/tillana-12e48378.ttf +0 -0
  39. package/dist/fonts/tillana/tillana.ttf +0 -0
  40. package/dist/{index-DMa72T_I.d.mts → index-JT-cQ_gO.d.mts} +3 -2
  41. package/dist/{index-B_c_g7Y-.d.mts → index-vDGB0qjx.d.mts} +150 -191
  42. package/dist/index.d.mts +4 -3
  43. package/dist/index.mjs +2 -2
  44. package/dist/react/index.d.mts +4 -3
  45. package/dist/react/index.mjs +2 -2
  46. package/dist/{react-ZkNwynZ5.mjs → react-DBKcqp07.mjs} +6 -4
  47. package/dist/react-DBKcqp07.mjs.map +1 -0
  48. package/dist/shaper-harfbuzz/index.d.mts +44 -0
  49. package/dist/shaper-harfbuzz/index.mjs +194 -0
  50. package/dist/shaper-harfbuzz/index.mjs.map +1 -0
  51. package/dist/shaper-registry-DVS5R37Q.d.mts +246 -0
  52. package/dist/solid/index.d.mts +3 -2
  53. package/dist/solid/index.mjs +7 -2
  54. package/dist/solid/index.mjs.map +1 -1
  55. package/dist/wc/index.d.mts +8 -3
  56. package/dist/wc/index.mjs +16 -3
  57. package/dist/wc/index.mjs.map +1 -1
  58. package/fonts/amiri/amiri-7df37680.ttf +0 -0
  59. package/fonts/amiri/amiri.ttf +0 -0
  60. package/fonts/amiri/bundle.ts +23 -0
  61. package/fonts/amiri/glyphData.json +1 -0
  62. package/fonts/amiri/glyphDataById.json +1 -0
  63. package/fonts/caveat/bundle.ts +3 -0
  64. package/fonts/caveat/glyphData.json +1 -1
  65. package/fonts/caveat/glyphDataById.json +1 -0
  66. package/fonts/italianno/bundle.ts +3 -0
  67. package/fonts/italianno/glyphData.json +1 -1
  68. package/fonts/italianno/glyphDataById.json +1 -0
  69. package/fonts/klee-one/bundle.ts +23 -0
  70. package/fonts/klee-one/glyphData.json +1 -0
  71. package/fonts/klee-one/glyphDataById.json +1 -0
  72. package/fonts/klee-one/klee-one-d192e144.ttf +0 -0
  73. package/fonts/klee-one/klee-one.ttf +0 -0
  74. package/fonts/parisienne/bundle.ts +3 -0
  75. package/fonts/parisienne/glyphData.json +1 -1
  76. package/fonts/parisienne/glyphDataById.json +1 -0
  77. package/fonts/suez-one/bundle.ts +23 -0
  78. package/fonts/suez-one/glyphData.json +1 -0
  79. package/fonts/suez-one/glyphDataById.json +1 -0
  80. package/fonts/suez-one/suez-one-ac7f1d1c.ttf +0 -0
  81. package/fonts/suez-one/suez-one.ttf +0 -0
  82. package/fonts/tangerine/glyphData.json +1 -1
  83. package/fonts/tillana/bundle.ts +23 -0
  84. package/fonts/tillana/glyphData.json +1 -0
  85. package/fonts/tillana/glyphDataById.json +1 -0
  86. package/fonts/tillana/tillana-12e48378.ttf +0 -0
  87. package/fonts/tillana/tillana.ttf +0 -0
  88. package/package.json +42 -2
  89. package/src/astro/TegakiRenderer.astro +5 -4
  90. package/src/core/engine.ts +213 -65
  91. package/src/core/index.ts +2 -0
  92. package/src/core/render-elements.ts +2 -0
  93. package/src/core/shaper-registry.ts +45 -0
  94. package/src/core/types.ts +18 -1
  95. package/src/lib/drawGlyph.ts +20 -4
  96. package/src/lib/features.ts +28 -0
  97. package/src/lib/font.ts +27 -15
  98. package/src/lib/harfbuzzjs.d.ts +71 -0
  99. package/src/lib/shaper.ts +22 -0
  100. package/src/lib/textLayout.ts +216 -0
  101. package/src/lib/timeline.test.ts +203 -0
  102. package/src/lib/timeline.ts +366 -23
  103. package/src/lib/utils.test.ts +73 -0
  104. package/src/lib/utils.ts +20 -1
  105. package/src/react/TegakiRenderer.tsx +4 -0
  106. package/src/shaper-harfbuzz/index.test.ts +148 -0
  107. package/src/shaper-harfbuzz/index.ts +277 -0
  108. package/src/solid/TegakiRenderer.tsx +5 -1
  109. package/src/svelte/TegakiRenderer.svelte +5 -3
  110. package/src/types.ts +42 -1
  111. package/src/vue/TegakiRenderer.vue +6 -2
  112. package/src/wc/TegakiElement.ts +15 -0
  113. package/dist/core-B7NiOWkP.mjs.map +0 -1
  114. package/dist/react-ZkNwynZ5.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # tegaki
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2b4b435: Support Devanagari writing system and add Tillana as built-in font. Also fixed a bug with generating n-grams, which affected Arabic fonts.
8
+
9
+ ### Patch Changes
10
+
11
+ - ee2db76: Fix GPOS and advance width features for some Arabic fonts like "Aref Ruqaa"
12
+
13
+ ## 0.16.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 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).
18
+
3
19
  ## 0.15.0
4
20
 
5
21
  ### Minor Changes
package/FONTS-LICENSE.md CHANGED
@@ -27,6 +27,30 @@ 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
+
48
+ ## Tillana
49
+
50
+ - **Designer**: Indian Type Foundry, Shiva Nallaperumal
51
+ - **Copyright**: Copyright (c) 2014, Indian Type Foundry (info@indiantypefoundry.com)
52
+ - **License**: SIL Open Font License, Version 1.1
53
+
30
54
  ---
31
55
 
32
56
  ## SIL Open Font License, Version 1.1
package/README.md CHANGED
@@ -65,12 +65,16 @@ import { registerTegakiElement } from 'tegaki/wc'; // Web Components
65
65
 
66
66
  ## Built-in Fonts
67
67
 
68
- Four handwriting fonts are bundled and ready to use:
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
+ - **Tillana** — `tegaki/fonts/tillana` _(Devanagari + Latin)_
77
+ - **Klee One** — `tegaki/fonts/klee-one` _(Japanese: kana + Kyōiku grade 1–2 kanji + Latin)_
74
78
 
75
79
  For other fonts, use the [interactive generator](https://gkurt.com/tegaki/generator/) to create a custom bundle.
76
80
 
@@ -83,6 +87,11 @@ Visit **[gkurt.com/tegaki](https://gkurt.com/tegaki)** for full documentation:
83
87
  - [Generating Fonts](https://gkurt.com/tegaki/guides/generating/)
84
88
  - [API Reference](https://gkurt.com/tegaki/api/renderer/)
85
89
 
90
+ ## Integrations
91
+
92
+ - [Sli.dev](https://sli.dev/) - Create presentations using markdown. [See Tegaki integration example](https://andreas-taranetz.github.io/slidev-addon-animated-text/)
93
+ - [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)
94
+
86
95
  ## License
87
96
 
88
97
  [MIT](LICENSE)
@@ -1,2 +1,3 @@
1
- import { A as computeLayoutBbox, B as Point, C as findEffect, D as resolveEffects, E as hasRenderHooks, F as CSSLength, G as TegakiEffects, H as TegakiBundle, I as FontOutput, J as TegakiSingletonEffectName, K as TegakiGlyphData, L as GlyphData, M as BBox, N as BUNDLE_VERSION, O as LayoutBBox, P as COMPATIBLE_BUNDLE_VERSIONS, R as LineCap, S as ResolvedEffect, T as getEffectDefinition, U as TegakiEffectConfigs, V as Stroke, W as TegakiEffectName, Y as TimedPoint, _ 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, q as TegakiMultiEffectName, r as domCreateElement, s as TegakiQuality, t as buildChildren, u as createBundle, v as ensureFontFace, w as findEffects, x as RenderStageContext, y as drawGlyph, z as PathCommand } from "../index-B_c_g7Y-.mjs";
2
- export { BBox, BUNDLE_VERSION, COMPATIBLE_BUNDLE_VERSIONS, CSSLength, CreateElementFn, EffectDefinition, FontOutput, GlyphData, LayoutBBox, LineCap, PathCommand, Point, RenderStageContext, ResolvedEffect, 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 };
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-DVS5R37Q.mjs";
2
+ import { A as TimelineEntry, C as resolveEffects, D as computeTextLayout, E as computeLayoutBbox, O as Timeline, S as hasRenderHooks, T as TextLayout, _ as RenderStageContext, a as CreateElementFn, b as findEffects, c as TimeControlMode, d as getBundle, f as registerBundle, g as EffectDefinition, h as drawGlyph, i as TegakiEngine, j as computeTimeline, k as TimelineConfig, l as TimeControlProp, m as ensureFontFace, n as buildRootProps, o as TegakiEngineOptions, p as resolveBundle, r as domCreateElement, s as TegakiQuality, t as buildChildren, u as createBundle, v as ResolvedEffect, w as LayoutBBox, x as getEffectDefinition, y as findEffect } from "../index-vDGB0qjx.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 };
@@ -1,2 +1,2 @@
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-B7NiOWkP.mjs";
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-BrU5Htjs.mjs";
2
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 };