X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=font.h;fp=font.h;h=20f6454558ca9535e908fc23d39eefae8f01b497;hb=53597f45307d8a2120e3a0bbe71797b216e8750b;hp=4361e934795fc881bc71e886d86139bb013a66a7;hpb=f252ecb6f870260e0e944579ef732b94d1ed0ebe;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/font.h b/font.h index 4361e93..20f6454 100644 --- a/font.h +++ b/font.h @@ -280,8 +280,10 @@ float font3d_string_width( font3d *font, u32 variant_id, const char *text ) { if( !text ) return 0.0f; float width = 0.0f; + + const u8 *buf = (const u8 *)text; for( int i=0;; i++ ){ - u32 c = text[i]; + u32 c = buf[i]; if(!c) break; ent_glyph *glyph = font3d_glyph( font, variant_id, c );