remove draw / gfx, baseline
This commit is contained in:
@@ -89,7 +89,8 @@ fn i64 rn_get_line_spacing(rn_font_t *font) {
|
||||
}
|
||||
|
||||
fn v2f32_t rn_base_draw_string(rn_font_t *font, s8_t string, v2f32_t pos, v4f32_t color, b32 draw) {
|
||||
pos.y += rn_get_line_spacing(font) + font->descent;
|
||||
// old formula :: pos.y += rn_get_line_spacing(font) + font->descent;
|
||||
pos.y += font->ascent;
|
||||
v2f32_t original_pos = pos;
|
||||
|
||||
for (utf8_iter_t iter = utf8_iterate_ex(string.str, (int)string.len); iter.item; utf8_advance(&iter)) {
|
||||
|
||||
@@ -4,6 +4,7 @@ void mt_render(ma_arena_t *arena) {
|
||||
|
||||
sb8_printf(sb, "gb_read_only ");
|
||||
s8_t content = OS_ReadFile(&Perm, s8_lit("../package/FiraCode-Regular.ttf"));
|
||||
// s8_t content = OS_ReadFile(&Perm, s8_lit("C:/Windows/Fonts/arial.ttf"));
|
||||
mt_serial_to_cbyte_array_ex(sb, content, s8_printf(arena, "main_font_data"));
|
||||
sb8_printf(sb, "gb_read_only s8_t main_font = s8_array_lit(main_font_data);\n");
|
||||
os_write_file(mt_cpath(arena), sb8_serial_end(arena, sb));
|
||||
|
||||
@@ -2,7 +2,7 @@ fn_wasm_import void wasm_clear(void);
|
||||
fn_wasm_import void wasm_draw_text(isize str, i32 len, f32 x, f32 y, isize font_str, i32 font_len, i32 font_size, f32 r, f32 g, f32 b, f32 a);
|
||||
fn_wasm_import void wasm_draw_rect(f32 x, f32 y, f32 w, f32 h, f32 r, f32 g, f32 b, f32 a);
|
||||
fn_wasm_import f32 wasm_measure_text(isize str, i32 len, isize font_str, i32 font_len, i32 font_size);
|
||||
fn_wasm_import f32 wasm_get_font_height(isize font_str, i32 font_len, i32 font_size);
|
||||
// fn_wasm_import f32 wasm_get_font_height(isize font_str, i32 font_len, i32 font_size);
|
||||
fn_wasm_import void wasm_set_clip(f32 x, f32 y, f32 w, f32 h);
|
||||
|
||||
gb_read_only s8_t font_face = s8_const_lit("main_font");
|
||||
|
||||
Reference in New Issue
Block a user