menu upgrades
[carveJwlIkooP6JGAAIwe30JlM.git] / font.h
diff --git a/font.h b/font.h
index 4361e934795fc881bc71e886d86139bb013a66a7..20f6454558ca9535e908fc23d39eefae8f01b497 100644 (file)
--- 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 );