got it to compile with vefontcache changes, runtime issues..

This commit is contained in:
Edward R. Gonzalez 2025-01-12 16:41:55 -05:00
parent 9da0e73d3b
commit 9d5ac7b0d2
2 changed files with 11 additions and 16 deletions

View File

@ -869,10 +869,8 @@ draw_text_string_pos_norm :: #force_inline proc( text : string, id : FontID, fon
ve_id,
f32(resolved_size),
color_norm,
screen_size,
pos,
draw_scale,
1.0,
text
)
return
@ -886,9 +884,12 @@ draw_text_shape_pos_norm :: #force_inline proc( shape : ShapedText, id : FontID,
screen_size_norm := 1 / get_screen_extent() * 0.5
// ve.set_px_scalar( & font_provider_ctx.ve_ctx, config.font_size_screen_scalar )
// ve.set_colour( & font_provider_ctx.ve_ctx, color_norm )
ve.draw_text_shape_normalized_space( & get_state().font_provider_ctx.ve_ctx, ve_id, f32(resolved_size), color_norm, {}, pos, screen_size_norm * scale, 1.0, shape )
ve.draw_shape_normalized_space( & get_state().font_provider_ctx.ve_ctx,
color_norm,
pos,
screen_size_norm * scale,
shape
)
return
}
@ -947,14 +948,10 @@ draw_text_shape_pos_extent_zoomed :: #force_inline proc( shape : ShapedText, id
color_norm := normalize_rgba8(color)
// ve.set_px_scalar( & get_state().font_provider_ctx.ve_ctx, config.font_size_canvas_scalar )
ve.draw_text_shape_normalized_space( & font_provider_ctx.ve_ctx,
ve_id,
f32_resolved_size,
ve.draw_shape_normalized_space( & font_provider_ctx.ve_ctx,
color_norm,
screen_size,
normalized_pos,
text_scale,
1.0,
shape
)
}
@ -988,10 +985,8 @@ draw_text_string_pos_extent_zoomed :: #force_inline proc( text : string, id : Fo
ve_id,
f32(resolved_size),
color_norm,
screen_size,
normalized_pos,
text_scale,
1.0,
text
)
}

View File

@ -153,7 +153,7 @@ font_provider_resolve_draw_id :: #force_inline proc( id : FontID, size := Font_U
measure_text_shape :: #force_inline proc( shape : ShapedText ) -> Vec2
{
measured := ve.measure_shape_size( & get_state().font_provider_ctx.ve_ctx, shape )
measured := ve.measure_shape_size( get_state().font_provider_ctx.ve_ctx, shape )
return measured
}
@ -167,20 +167,20 @@ measure_text_size :: #force_inline proc( text : string, font : FontID, font_size
get_font_vertical_metrics :: #force_inline proc ( font : FontID, font_size := Font_Use_Default_Size ) -> ( ascent, descent, line_gap : f32 )
{
ve_id, size := font_provider_resolve_draw_id( font, font_size )
ascent, descent, line_gap = ve.get_font_vertical_metrics( & get_state().font_provider_ctx.ve_ctx, ve_id, font_size )
ascent, descent, line_gap = ve.get_font_vertical_metrics( get_state().font_provider_ctx.ve_ctx, ve_id, font_size )
return
}
shape_text_cached_latin :: #force_inline proc( text : string, font : FontID, font_size := Font_Use_Default_Size, scalar : f32 ) -> ShapedText
{
ve_id, size := font_provider_resolve_draw_id( font, font_size * scalar )
shape := ve.shape_text_latin( & get_state().font_provider_ctx.ve_ctx, ve_id, f32(size), text )
shape := ve.shape_text( & get_state().font_provider_ctx.ve_ctx, ve_id, f32(size), text, ve.shaper_shape_text_latin )
return shape
}
shape_text_cached :: #force_inline proc( text : string, font : FontID, font_size := Font_Use_Default_Size, scalar : f32 ) -> ShapedText
{
ve_id, size := font_provider_resolve_draw_id( font, font_size * scalar )
shape := ve.shape_text_advanced( & get_state().font_provider_ctx.ve_ctx, ve_id, f32(size), text )
shape := ve.shape_text( & get_state().font_provider_ctx.ve_ctx, ve_id, f32(size), text )
return shape
}