gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Smaller fonts for simple console

#168226 - zigg - Thu Apr 16, 2009 1:51 am

This is not a deal-breaker by any stretch for my application, but I was wondering if it was possible in a simple manner to use consoleDemoInit/iprintf with a smaller font, and if such a smaller font might already be available somewhere.

#168227 - elhobbs - Thu Apr 16, 2009 1:58 am

no, it is not possible to do this simply. the existing implementation uses the 2d hardware to draw the text using 8x8 tiles for each character. 8x8 tiles are the smallest supported.

it is possible to draw the text in frame buffer mode instead though. but that would require a lot of custom code. and it would use more vram.

#168228 - zigg - Thu Apr 16, 2009 2:17 am

Ah, OK. Not worth pursuing for what I'm doing. Thanks!

#168231 - elwing - Thu Apr 16, 2009 7:52 am

cearn implemented evolved console method allowing this in its tonc lib... you should check it out if you want this... its geared toward gba, but i think it would work nicely on the nds (well you will prolly need to hack it a little bit...)

http://www.coranac.com/tonc/text/

#168236 - sverx - Thu Apr 16, 2009 11:30 am

elhobbs wrote:
the existing implementation uses the 2d hardware to draw the text using 8x8 tiles for each character. 8x8 tiles are the smallest supported.


... which gives 32 chars per line. That's why (well, one of the reasons) I had to write my own functions to write 6 pixel wide chars, thus obtaining 42 chars per line. Btw it's 2D tiled (hardware) mode, using all 4 BGs... shifting "the next BG" 6 pixels right from the previous...

I believe it shouldn't be so hard to write a port of that 42x24 text mode into console, but I'm not the one who's going to do that ;)





?
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary

#168278 - SteveH - Sat Apr 18, 2009 5:48 pm

I'm working on a graphical console interface at the moment that uses the normal iprintf to output the information to the screen, it's far from complete, but here's a link to a screen shot of the current test application:

http://sharriso.gotadsl.co.uk/ds/gfxc/gfxconsole4.png

It's currently using 2 fonts and switching at run time between them...

Example code from the test:

Code:

   for( j = 0; j < 8; j ++ )
   {
      iprintf( " " );
      for( i = 0; i < 8; i ++ )
      {
         iprintf( "\x1b[3%d;4%dm%c", j, i, 177 );
      }
      iprintf( " \x1b)" );
      for( i = 0; i < 8; i ++ )
      {
         iprintf( "\x1b[3%d;4%d;1mA", j, i );
      }
      iprintf( " " );
      for( i = 0; i < 8; i ++ )
      {
         iprintf( "\x1b[3%d;4%d;7;1;7mA", j, i );
      }
      iprintf( "\n\x1b(" );
   }


As you can see it's nothing special, and I'm using the same ANSI positioning commands that's available to the normal console, but with a few minor changes...

I'm using fonts from the BMF library - http://bmf.wz.cz - there's a 3x3 font in their library ....