Category

Fonts 5 x 6

Created by

Andrew Challen

Name

Font 2

Uploaded

16.06.2016

 

Download

Content of ZIP file

  5x6_002.ric            

1

1

1

  FontExample.NXC                  

 

Description

Another example of a very small font of only 5 x 6 pixels for each letter. The font was build by Andrew Challen and contain the patterns for the letters from Space until ~.

 

 

Andrew also wrote a small program which shows the function and usage of his nice tiny font:

 

  // Special font and demo program from Andrew Challen 16.06.2016

#define FONT_WIDTH                5
#define FONT_HEIGHT               6
#define SCREEN_HEIGHT            64
#define SCREEN_WIDTH            100
#define FONT          "5x6_002.ric"


void ConsoleOut(int x, int y, string text)
{
   int px, py, i, v[1];

   px = x * FONT_WIDTH;
   py = SCREEN_HEIGHT - y * FONT_HEIGHT - FONT_HEIGHT;

   for (i = 0; i < StrLen( text ); i++)
   {
       v[0] = text[i];
       GraphicOutEx(px, py, FONT, v);
       px += FONT_WIDTH;
   }
}

task main()
{
   ConsoleOut( 0, 0, "+------------------+"  );
   ConsoleOut( 0, 1, "| A smaller font   |"  );
   ConsoleOut( 0, 2, "| for NXT 2.0 by   |"  );
   ConsoleOut( 0, 3, "| Andrew Challen   |"  );
   ConsoleOut( 0, 4, "+------------------+"  );
   ConsoleOut( 0, 5, " !\"#$%&'()*+,-./0123" );
   ConsoleOut( 0, 6, "456789:;<=>?@ABCDEFG"  );
   ConsoleOut( 0, 7, "HIJKLMNOPQRSTUVWXYZ["  );
   ConsoleOut( 0, 8, "\\]^_`abcdefghijklmno" );
   ConsoleOut( 0, 9, "pqrstuvwxyz{|}~"       );

   while( true )
   {
      Wait( MS_500 );
   }
}
 

 

 

Please send me your own made RIC file which contains fonts and I will publish it on this web site!