From 470197cb6c11ed4a8735070b67b30f5527877ec4 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 26 Jun 2024 15:23:02 -0400 Subject: [PATCH] Advance_Snap_Smallfont_Size to 0 by default, removed position rounding in shape_text_uncached Need to eventually make the rounding an option --- code/font/VEFontCache/VEFontCache.odin | 2 +- code/font/VEFontCache/shaped_text.odin | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/font/VEFontCache/VEFontCache.odin b/code/font/VEFontCache/VEFontCache.odin index c4c5076..fa946ff 100644 --- a/code/font/VEFontCache/VEFontCache.odin +++ b/code/font/VEFontCache/VEFontCache.odin @@ -14,7 +14,7 @@ package VEFontCache import "base:runtime" -Advance_Snap_Smallfont_Size :: 12 +Advance_Snap_Smallfont_Size :: 0 Colour :: [4]f32 Vec2 :: [2]f32 diff --git a/code/font/VEFontCache/shaped_text.odin b/code/font/VEFontCache/shaped_text.odin index cf9e2fe..dc318b2 100644 --- a/code/font/VEFontCache/shaped_text.odin +++ b/code/font/VEFontCache/shaped_text.odin @@ -116,10 +116,11 @@ shape_text_uncached :: proc( ctx : ^Context, font : FontID, text_utf8 : string, append( & output.glyphs, parser_find_glyph_index( & entry.parser_info, codepoint )) advance, to_left_side_glyph = parser_get_codepoint_horizontal_metrics( & entry.parser_info, codepoint ) - append( & output.positions, Vec2 { - cast(f32) i32(position.x + 0.5), - position.y - }) + // append( & output.positions, Vec2 { + // cast(f32) i32(position.x + 0.5), + // position.y + // }) + append( & output.positions, position ) position.x += f32(advance) * entry.size_scale prev_codepoint = codepoint