diff --git a/code/font/VEFontCache/VEFontCache.odin b/code/font/VEFontCache/VEFontCache.odin index 0c28827..e941a6c 100644 --- a/code/font/VEFontCache/VEFontCache.odin +++ b/code/font/VEFontCache/VEFontCache.odin @@ -123,7 +123,7 @@ font_key_from_label :: #force_inline proc( label : string ) -> u64 { eval_point_on_bezier3 :: proc( p0, p1, p2 : Vec2, alpha : f32 ) -> Vec2 { starting_point := p0 * (1 - alpha) * (1 - alpha) - control_point := p1 * 2.0 * (1 - alpha) + control_point := p1 * 2.0 * (1 - alpha) * alpha end_point := p2 * alpha * alpha point := starting_point + control_point + end_point @@ -237,6 +237,9 @@ init :: proc( ctx : ^Context, parser_kind : ParserKind, ctx.backing = allocator context.allocator = ctx.backing + if curve_quality == 0 { + curve_quality = 6 + } ctx.curve_quality = curve_quality error : AllocatorError @@ -469,7 +472,7 @@ cache_glyph :: proc( ctx : ^Context, font : FontID, glyph_index : Glyph, scale, f32(bounds_0.x) - 21, f32(bounds_0.y) - 33, } - + // Note(Original Author): Figure out scaling so it fits within our box. draw := DrawCall_Default draw.pass = FrameBufferPass.Glyph diff --git a/code/font/VEFontCache/draw.odin b/code/font/VEFontCache/draw.odin index b9d4d57..1e900b8 100644 --- a/code/font/VEFontCache/draw.odin +++ b/code/font/VEFontCache/draw.odin @@ -235,7 +235,8 @@ draw_filled_path :: proc( draw_list : ^DrawList, outside_point : Vec2, path : [] { log("outline_path:") for point in path { - logf(" point: %v", point * scale + translate ) + vec := point * scale + translate + logf(" %0.2f %0.2f", vec.x, vec.y ) } } diff --git a/code/sectr/font/provider_VEFontCache.odin b/code/sectr/font/provider_VEFontCache.odin index 6edfa3d..6ea5a2a 100644 --- a/code/sectr/font/provider_VEFontCache.odin +++ b/code/sectr/font/provider_VEFontCache.odin @@ -457,7 +457,7 @@ font_load :: proc(path_file : string, logf("Loading font: %v", path_file) provider_data := & get_state().font_provider_data; using provider_data - font_data, read_succeded : = os.read_entire_file( path_file ) + font_data, read_succeded : = os.read_entire_file( path_file, persistent_allocator() ) verify( b32(read_succeded), str_fmt("Failed to read font file for: %v", path_file) ) font_data_size := cast(i32) len(font_data)