textmode.js 0.1.9-beta.6 → 0.2.0-beta.1

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 (67) hide show
  1. package/README.md +14 -13
  2. package/dist/textmode.esm.js +1408 -1419
  3. package/dist/textmode.esm.min.js +1488 -1499
  4. package/dist/textmode.umd.js +19 -56
  5. package/dist/textmode.umd.min.js +19 -56
  6. package/dist/types/Textmode.d.ts +10 -38
  7. package/dist/types/export/base/DataExtractor.d.ts +3 -3
  8. package/dist/types/export/image/ImageExporter.d.ts +4 -11
  9. package/dist/types/export/image/types.d.ts +2 -3
  10. package/dist/types/export/svg/SVGExporter.d.ts +1 -1
  11. package/dist/types/export/svg/types.d.ts +1 -0
  12. package/dist/types/export/txt/TXTDataExtractor.d.ts +3 -3
  13. package/dist/types/export/txt/TXTExporter.d.ts +1 -1
  14. package/dist/types/export/txt/types.d.ts +4 -2
  15. package/dist/types/index.d.ts +1 -6
  16. package/dist/types/rendering/index.d.ts +2 -2
  17. package/dist/types/rendering/webgl/DrawQueue.d.ts +26 -0
  18. package/dist/types/rendering/webgl/Framebuffer.d.ts +38 -52
  19. package/dist/types/rendering/webgl/InstanceBatch.d.ts +91 -0
  20. package/dist/types/rendering/webgl/InstanceData.d.ts +65 -0
  21. package/dist/types/rendering/webgl/RenderPipeline.d.ts +15 -0
  22. package/dist/types/rendering/webgl/RenderState.d.ts +76 -0
  23. package/dist/types/rendering/webgl/Renderer.d.ts +58 -83
  24. package/dist/types/rendering/webgl/Shader.d.ts +23 -12
  25. package/dist/types/rendering/webgl/VAOManager.d.ts +15 -0
  26. package/dist/types/rendering/webgl/geometries/Arc.d.ts +16 -0
  27. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +35 -29
  28. package/dist/types/rendering/webgl/geometries/BezierCurve.d.ts +22 -0
  29. package/dist/types/rendering/webgl/geometries/Ellipse.d.ts +20 -0
  30. package/dist/types/rendering/webgl/geometries/Line.d.ts +13 -4
  31. package/dist/types/rendering/webgl/geometries/Rectangle.d.ts +13 -8
  32. package/dist/types/rendering/webgl/geometries/Triangle.d.ts +20 -0
  33. package/dist/types/rendering/webgl/geometries/index.d.ts +4 -1
  34. package/dist/types/rendering/webgl/index.d.ts +17 -1
  35. package/dist/types/rendering/webgl/types/DrawCommand.d.ts +9 -0
  36. package/dist/types/rendering/webgl/types/GeometryTypes.d.ts +144 -0
  37. package/dist/types/rendering/webgl/types/RenderTypes.d.ts +12 -0
  38. package/dist/types/textmode/AnimationController.d.ts +81 -0
  39. package/dist/types/textmode/Canvas.d.ts +18 -19
  40. package/dist/types/textmode/Grid.d.ts +1 -34
  41. package/dist/types/textmode/Textmodifier.d.ts +36 -277
  42. package/dist/types/textmode/font/CharacterColorMapper.d.ts +3 -3
  43. package/dist/types/textmode/font/TextmodeFont.d.ts +8 -13
  44. package/dist/types/textmode/font/TextureAtlas.d.ts +2 -2
  45. package/dist/types/textmode/font/types.d.ts +1 -1
  46. package/dist/types/textmode/font/typr/types.d.ts +1 -1
  47. package/dist/types/textmode/font/utils/index.d.ts +0 -1
  48. package/dist/types/textmode/mixins/AnimationMixin.d.ts +120 -0
  49. package/dist/types/textmode/mixins/ExportMixin.d.ts +4 -6
  50. package/dist/types/textmode/mixins/FontMixin.d.ts +4 -10
  51. package/dist/types/textmode/mixins/RenderingMixin.d.ts +224 -246
  52. package/dist/types/textmode/mixins/TextmodifierMixin.d.ts +13 -4
  53. package/dist/types/textmode/mixins/index.d.ts +2 -2
  54. package/package.json +1 -1
  55. package/dist/types/ColorPalette.d.ts +0 -38
  56. package/dist/types/rendering/core/AbstractFramebuffer.d.ts +0 -1
  57. package/dist/types/rendering/core/AbstractGeometry.d.ts +0 -1
  58. package/dist/types/rendering/core/AbstractShader.d.ts +0 -1
  59. package/dist/types/rendering/core/AbstractTexture.d.ts +0 -1
  60. package/dist/types/rendering/core/GraphicsContext.d.ts +0 -1
  61. package/dist/types/textmode/ConversionPipeline.d.ts +0 -110
  62. package/dist/types/textmode/converters/BrightnessConverter.d.ts +0 -58
  63. package/dist/types/textmode/converters/Converter.d.ts +0 -62
  64. package/dist/types/textmode/converters/FeatureConverter.d.ts +0 -106
  65. package/dist/types/textmode/converters/index.d.ts +0 -3
  66. package/dist/types/textmode/font/utils/FontConstants.d.ts +0 -60
  67. package/dist/types/textmode/mixins/ConversionMixin.d.ts +0 -62
package/README.md CHANGED
@@ -14,7 +14,9 @@
14
14
 
15
15
  Transform any `<canvas>` or `<video>` element into dynamic ASCII representations with blazing-fast WebGL rendering. Whether you're using p5.js, three.js, or vanilla JavaScript, textmode.js seamlessly integrates with your existing projects to create interactive textmode games, live visual performances, and artistic installations.
16
16
 
17
- For standalone projects, textmode.js provides its own p5.js-inspired drawing API, letting you create compelling ASCII experiences without additional dependencies. The library powers live coding performances, interactive installations, and digital art projects worldwide, bringing the nostalgic aesthetic of textmode art into modern web development.
17
+ For standalone projects, textmode.js provides its own p5.js-inspired drawing API, letting you create compelling ASCII experiences without additional dependencies.
18
+
19
+ The library powers live coding performances, interactive installations, and digital art projects worldwide, bringing the nostalgic aesthetic of textmode art into modern web development.
18
20
 
19
21
  ## Features
20
22
  - **Dependency-free**: No external libraries required, making it lightweight and easy to integrate into any project.
@@ -23,7 +25,7 @@ For standalone projects, textmode.js provides its own p5.js-inspired drawing API
23
25
  - **Standalone drawing API**: Use the built-in `p5.js`-like drawing API for creating textmode art without any other dependencies.
24
26
  - **Injectable**: Easily inject `textmode.js` into websites like YouTube to convert `<video>` or `<canvas>` elements into textmode representations for a unique viewing experience.
25
27
  - **WebGL1/WebGL2 support**: All shader code provided by `textmode.js` is written in `GLSL ES 1.0`, making it compatible with both `WebGL1` and `WebGL2` contexts, allowing for a wide range of devices to run your ASCII projects.
26
- - **Exporting**: Export your creations to various image formats, and as `.txt`, `.svg` and `.json` files for easy sharing, printing and plotting.
28
+ - **Exporting**: Export your creations to various image formats, and as `.txt`, `.svg` and image files for easy sharing, printing and plotting.
27
29
  - **Typescript support**: Fully typed library with TypeScript definitions, making it easy to integrate into TypeScript projects and ensuring type safety.
28
30
 
29
31
  ## Installation
@@ -41,20 +43,18 @@ To get started with `textmode.js`, you'll need:
41
43
 
42
44
  | Bundle type | File size | Font included? | Best for |
43
45
  |-------------|-----------|---------------|----------|
44
- | **Standard UMD**<br/> (`textmode.umd.js`) | ~117kB | ✅ [UrsaFont](https://ursafrank.itch.io/ursafont) embedded | Quick setup, prototyping |
45
- | **Standard ESM**<br/> (`textmode.esm.js`) | ~183kB | ✅ [UrsaFont](https://ursafrank.itch.io/ursafont) embedded | Quick setup, prototyping |
46
- | **Minified UMD**<br/> (`textmode.umd.min.js`) | ~71kB | ❌ Requires external font | Production apps, custom fonts |
47
- | **Minified ESM**<br/> (`textmode.esm.min.js`) | ~136kB | ❌ Requires external font | Production apps, custom fonts |
46
+ | **Standard UMD**<br/>(`textmode.umd.js`) | ~111kB | ✅ [UrsaFont](https://ursafrank.itch.io/ursafont) embedded | Quick setup, prototyping |
47
+ | **Standard ESM**<br/>(`textmode.esm.js`) | ~128kB | ✅ [UrsaFont](https://ursafrank.itch.io/ursafont) embedded | Quick setup, prototyping |
48
+ | **Minified UMD**<br/>(`textmode.umd.min.js`) | ~64kB | ❌ Requires external font | Production apps, custom fonts |
49
+ | **Minified ESM**<br/>(`textmode.esm.min.js`) | ~82kB | ❌ Requires external font | Production apps, custom fonts |
48
50
 
49
- **Choose Standard bundles for:**
50
- - The simplest setup with no additional configuration
51
+ **Choose standard bundles for:**
52
+ - Quick setup with no additional configuration
51
53
  - Everything embedded and ready to use
52
54
  - Getting started without worrying about fonts
53
55
 
54
- **Choose Minified bundles for:**
55
- - Bundle size optimization *(25-40% smaller)*
56
- - Custom fonts instead of the default
57
- - Production applications requiring maximum performance
56
+ **Choose minified bundles for:**
57
+ - Production applications that don't use the embedded font
58
58
 
59
59
  #### UMD
60
60
 
@@ -142,7 +142,8 @@ The documentation will help you unlock the full potential of `textmode.js` in yo
142
142
 
143
143
  ## Acknowledgements
144
144
 
145
- `textmode.js` uses a custom-made minified version of [`Typr.js`](https://github.com/photopea/Typr.js) by [**Photopea**](https://github.com/photopea) for font loading and parsing, containing only the necessary components for our use case. `Typr.js` is licensed under the [**MIT License**](https://github.com/photopea/Typr.js/blob/main/LICENSE).
145
+ `textmode.js` uses a custom-made TypeScript rewrite and minified version of [`Typr.js`](https://github.com/photopea/Typr.js) by [**Photopea**](https://github.com/photopea) for font loading and parsing, containing only the necessary components for our use case. `Typr.js` is licensed under the [**MIT License**](https://github.com/photopea/Typr.js/blob/main/LICENSE).
146
+
146
147
 
147
148
  The non-minified version of `textmode.js` ships with [`UrsaFont`](https://ursafrank.itch.io/ursafont) as the default font, created by [**UrsaFrank**](https://ursafrank.itch.io/). This font is available under the [**CC0 (Creative Commons Zero) license**](https://creativecommons.org/publicdomain/zero/1.0/).
148
149