Skip to content

Add unit test coverage for WebGL text rendering #8436

@aashu2006

Description

@aashu2006

Topic

Description

WebGL text rendering currently has minimal unit test coverage, despite being a core and complex feature. This makes regressions harder to catch and increases risk when modifying WebGL text-related code.

Current State

  • src/webgl/text.js contains the WebGL text implementation
  • Existing WebGL unit tests do not cover text rendering behavior
  • No tests currently verify basic text rendering, fill behavior, or text sizing in WEBGL mode

Proposed Improvement

Add initial unit tests to verify:

  • Text renders with a loaded OpenType/TrueType font in WEBGL
  • noFill() prevents text rendering
  • Fill color behavior is consistent between 2D and WEBGL
  • textSize() affects rendered output in WEBGL

Why This Matters

Improved test coverage will:

  • Increase confidence in the WebGL text rendering pipeline
  • Reduce risk when fixing TODOs or refactoring WebGL text code
  • Help ensure consistency between 2D and WEBGL text behavior

Scope

This issue focuses on tests only and does not propose changes to existing implementation code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions