new font
[fishladder.git] / vg / vg_console.h
index 76d38007241ef256112d1440159b7dcccc38331c..a1ce4063c0b63b5617b606e3c28695824fe413e8 100644 (file)
@@ -102,17 +102,19 @@ static void vg_console_draw( void )
                return;
 
        int ptr = vg_console.current-1;
+
+   int const fh = 14;
        
        ui_global_ctx.cursor[0] = 0;
        ui_global_ctx.cursor[1] = 0;
-       ui_global_ctx.cursor[3] = vg_list_size( vg_console.lines )*8*vg_console.scale;
+       ui_global_ctx.cursor[3] = vg_list_size( vg_console.lines )*fh*vg_console.scale;
        ui_fill_x( &ui_global_ctx );
        
        ui_new_node( &ui_global_ctx );
        {
                ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0x77333333 );
        
-               ui_global_ctx.cursor[3] = 8*vg_console.scale;
+               ui_global_ctx.cursor[3] = fh*vg_console.scale;
                ui_align_bottom( &ui_global_ctx ); 
                
                for( int i = 0; i < vg_console.len; i ++ )
@@ -121,7 +123,7 @@ static void vg_console_draw( void )
                                ptr = vg_list_size( vg_console.lines )-1;
          
                        ui_text( &ui_global_ctx, vg_console.lines[ptr], vg_console.scale );
-                       ui_global_ctx.cursor[1] -= 8*vg_console.scale;
+                       ui_global_ctx.cursor[1] -= fh*vg_console.scale;
                
                        ptr --;
                }
@@ -129,7 +131,7 @@ static void vg_console_draw( void )
        ui_end_down( &ui_global_ctx );
        
        ui_global_ctx.cursor[1] += 2;
-       ui_global_ctx.cursor[3] = 8*vg_console.scale;
+       ui_global_ctx.cursor[3] = fh*vg_console.scale;
        
        ui_new_node( &ui_global_ctx );
        {
@@ -140,8 +142,8 @@ static void vg_console_draw( void )
                int start = VG_MIN( vg_console.cursor_pos, vg_console.cursor_user ),
                         end   = VG_MAX( vg_console.cursor_pos, vg_console.cursor_user );
                
-               ui_global_ctx.cursor[0] = (start * ui_glyph_spacing_x * vg_console.scale) + 2;
-               ui_global_ctx.cursor[2] = (start == end? 0.2f: (float)(end-start)) * (float)ui_glyph_spacing_x * (float)vg_console.scale * 0.5f;
+               ui_global_ctx.cursor[0] = (start * ui_glyph_spacing_x * vg_console.scale);
+               ui_global_ctx.cursor[2] = (start == end? 0.5f: (float)(end-start)) * (float)ui_glyph_spacing_x * (float)vg_console.scale;
                
                ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0x66ffffff );
        }
@@ -178,6 +180,14 @@ static int vg_console_list( int argc, char const *argv[] )
        return 0;
 }
 
+static int vg_console_chartest( int argc, char const *argv[] )
+{
+   vg_info( "\"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG\"\n" );
+   vg_info( "'the quick brown fox jumps over the lazy dog'\n" );
+   vg_info( ":;!@#$%^& 0123456789 +-*/=~ ()[]{}<>\n" );
+   return 0;
+}
+
 static void vg_console_init(void)
 {
        vg_log_callback = vg_console_println;
@@ -191,6 +201,11 @@ static void vg_console_init(void)
                .function = vg_console_list
        });
 
+   vg_function_push( (struct vg_cmd){
+      .name = "chartest",
+      .function = vg_console_chartest
+   });
+
        // Read and exec persistent commands
        FILE *fp = fopen( "cfg/auto.conf", "r" );
        if( fp )