Advance_Snap_Smallfont_Size to 0 by default, removed position rounding in shape_text_uncached

Need to eventually make the rounding an option
This commit is contained in:
Edward R. Gonzalez 2024-06-26 15:23:02 -04:00
parent 8e8f25ba50
commit 470197cb6c
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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