-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
UIAll things user interface relatedAll things user interface relatedenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework
Description
Overview
Create a rendering pipeline that draws laid-out text using the glyph atlas,
producing visible text on screen.
Current State
No response
Scope
Goals:
- Shader for rendering atlas glyphs
- Batch multiple text draws efficiently
- Support text color
- Integrate with existing render command system
Non-Goals:
- Text effects (shadows, outlines)
- SDF rendering
Proposed API
pub struct TextRenderer {
pipeline: ResourceId,
vertex_buffer: Buffer,
bind_group: ResourceId,
}
impl TextRenderer {
pub fn new(render_context: &mut RenderContext, atlas: &GlyphAtlas) -> Self;
pub fn draw(
&mut self,
layout: &TextLayout,
position: [f32; 2],
color: [f32; 4],
) -> Vec<RenderCommand>;
pub fn update_atlas(&mut self, atlas: &GlyphAtlas);
}
// Or integrated with RenderContext
impl RenderContext {
pub fn draw_text(
&mut self,
text: &str,
font: Handle<Font>,
size: f32,
position: [f32; 2],
color: [f32; 4],
) -> Vec<RenderCommand>;
}Acceptance Criteria
- Text renders at correct position
- Text color applies correctly
- Multiple text draws batch together
- Transparent background (alpha blending)
- Example rendering "Hello World"
Affected Crates
lambda-rs
Notes
- Use instancing for glyph quads
- Alpha blending required for smooth edges
Metadata
Metadata
Assignees
Labels
UIAll things user interface relatedAll things user interface relatedenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework