three-text 0.2.19 → 0.3.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/README.md CHANGED
@@ -562,13 +562,15 @@ For shader-based animations and interactive effects, the library can generate pe
562
562
  const text = await Text.create({
563
563
  text: 'Sample text',
564
564
  font: '/fonts/Font.ttf',
565
- separateGlyphsWithAttributes: true,
565
+ perGlyphAttributes: true,
566
566
  });
567
567
 
568
568
  // Geometry includes these vertex attributes:
569
569
  // - glyphCenter (vec3): center point of each glyph
570
570
  // - glyphIndex (float): sequential glyph index
571
571
  // - glyphLineIndex (float): line number
572
+ // - glyphProgress (float): normalized position (0..1) along text run
573
+ // - glyphBaselineY (float): Y coordinate of glyph baseline
572
574
  ```
573
575
 
574
576
  This option bypasses overlap-based clustering and adds vertex attributes suitable for per-character manipulation in vertex shaders. Each unique glyph is still tessellated only once and cached for reuse. The tradeoff is potential visual artifacts where glyphs actually overlap (tight kerning, cursive scripts)
@@ -761,7 +763,7 @@ interface TextOptions {
761
763
  fontVariations?: { [key: string]: number }; // Variable font axis settings
762
764
  fontFeatures?: { [tag: string]: boolean | number }; // OpenType feature settings
763
765
  removeOverlaps?: boolean; // Override default overlap removal (auto-enabled for VF only)
764
- separateGlyphsWithAttributes?: boolean; // Force individual glyph tessellation and add shader attributes
766
+ perGlyphAttributes?: boolean; // Keep per-glyph identity and add per-glyph shader attributes
765
767
  color?: [number, number, number] | ColorOptions; // Text coloring (simple or complex)
766
768
  // Configuration for geometry generation and layout
767
769
  curveFidelity?: CurveFidelityConfig;
@@ -842,6 +844,8 @@ interface TextGeometryInfo {
842
844
  glyphCenter: Float32Array;
843
845
  glyphIndex: Float32Array;
844
846
  glyphLineIndex: Float32Array;
847
+ glyphProgress: Float32Array;
848
+ glyphBaselineY: Float32Array;
845
849
  };
846
850
  glyphs: GlyphGeometryInfo[];
847
851
  planeBounds: {