/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/text_renderer.cc

  • Committer: Tim Marston
  • Date: 2012-04-29 15:27:19 UTC
  • Revision ID: tim@ed.am-20120429152719-4cu2t9lx7bxpbml1
added adjustable text scaling factor

Show diffs side-by-side

added added

removed removed

47
47
// cache a glyph
48
48
void cache_glyph( char c )
49
49
{
50
 
        static char fonts[][ 67 * 8 ] PROGMEM = {
 
50
        static char fonts[][ 66 * 8 ] PROGMEM = {
51
51
                { // INVD-A
52
52
                        0x00, 0x7c, 0x7e, 0x12, 0x12, 0x12, 0x7e, 0x7c, // A
53
53
                        0x00, 0x7e, 0x7e, 0x4a, 0x4a, 0x4a, 0x7e, 0x34, // B
115
115
                        0x00, 0x00, 0x00, 0x6c, 0x6c, 0x00, 0x00, 0x00, // :
116
116
                        0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // .
117
117
                        0x00, 0x00, 0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, // ,
118
 
                        0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, // /
119
118
                }, { // INVD-D
120
119
                        0x00, 0x7f, 0x7f, 0x09, 0x09, 0x09, 0x7f, 0x7f, // A
121
120
                        0x00, 0x7f, 0x7f, 0x49, 0x49, 0x49, 0x7f, 0x77, // B
183
182
                        0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, // :
184
183
                        0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // .
185
184
                        0x00, 0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00, // ,
186
 
                        0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x00, // /
187
185
                }, { // INVD-G
188
186
                        0x7c, 0x7e, 0x22, 0x7e, 0x7e, 0x7e, 0x7c, 0x00, // A
189
187
                        0x7c, 0x7e, 0x7e, 0x7e, 0x4a, 0x7e, 0x34, 0x00, // B
251
249
                        0x00, 0x00, 0x28, 0x7c, 0x7c, 0x28, 0x00, 0x00, // :
252
250
                        0x00, 0x00, 0x30, 0x78, 0x78, 0x30, 0x00, 0x00, // .
253
251
                        0x00, 0x00, 0x10, 0xb8, 0xf8, 0x70, 0x00, 0x00, // ,
254
 
                        0x60, 0x70, 0x38, 0x1c, 0x0e, 0x07, 0x03, 0x00, // /
255
252
                }, { // INVD-B
256
253
                        0x00, 0x78, 0x7f, 0x09, 0x09, 0x0f, 0x78, 0x00, // A
257
254
                        0x00, 0x7f, 0x79, 0x49, 0x49, 0x4f, 0x78, 0x00, // B
319
316
                        0x00, 0x00, 0x00, 0x6c, 0x6c, 0x00, 0x00, 0x00, // :
320
317
                        0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // .
321
318
                        0x00, 0x00, 0x00, 0x60, 0xe0, 0x00, 0x00, 0x00, // ,
322
 
                        0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, // /
323
319
                }
324
320
        };
325
321
 
344
340
                pos = 64;
345
341
        else if( c == ',' )
346
342
                pos = 65;
347
 
        else if( c == '/' )
348
 
                pos = 66;
349
343
        else
350
344
                pos = -1;
351
345
 
423
417
{
424
418
        if( !_need_render ) return;
425
419
 
426
 
        // outer led on
427
 
        led( 9, true );
428
 
 
429
 
        // output buffer
430
420
        for( int a = 8; a >= 0; a-- ) {
431
421
                led( a, ( _output_buffer & 1 )? true : false );
432
422
                _output_buffer >>= 1;