Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

fontdesign.c

Go to the documentation of this file.
00001 
00006 /*
00007  *  The contents of this file are subject to the Mozilla Public License
00008  *  Version 1.0 (the "License"); you may not use this file except in
00009  *  compliance with the License. You may obtain a copy of the License at
00010  *  http://www.mozilla.org/MPL/
00011  *
00012  *  Software distributed under the License is distributed on an "AS IS"
00013  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
00014  *  License for the specific language governing rights and limitations
00015  *  under the License.
00016  *
00017  *  The Original Code is legOS code, released October 17, 1999.
00018  *
00019  *  The Initial Developer of the Original Code is Markus L. Noga.
00020  *  Portions created by Markus L. Noga are Copyright (C) 1999
00021  *  Markus L. Noga. All Rights Reserved.
00022  *
00023  *  Contributor(s): Markus L. Noga <markus@noga.de>
00024  */
00025  
00026 #include <stdio.h>
00027 
00028 
00029 void show_it(unsigned value) {
00030         printf("\n0x%-2x:  %c\n",value,(value&4?'_':'.'));
00031         printf("      %c%c%c\n",(value&8?'|':'.'),
00032                           (value&1?'_':'.'),
00033                           (value&2?'|':'.'));
00034         printf("      %c%c%c\n",(value&16?'|':'.'),
00035                           (value&32?'_':'.'),
00036                           (value&64?'|':'.'));
00037 }
00038           
00039 
00040 int main() {
00041         int value=0;
00042         int norefresh=0;
00043         while(1) {
00044                 norefresh=0;
00045                 switch(getchar()) {
00046                 case '2':
00047                 case '3':
00048                         value^=4;
00049                         break;
00050                 case 'q':
00051                         value^=8;
00052                         break;
00053                 case 'e':
00054                         value^=2;
00055                         break;
00056                 case 'w':
00057                 case 's':
00058                         value^=1;
00059                         break;
00060                 case 'a':
00061                         value^=16;
00062                         break;
00063                 case 'y':
00064                 case 'x':
00065                 case 'c':
00066                         value^=32;
00067                         break;
00068                 case 'd':
00069                         value^=64;
00070                         break;
00071                 case ' ':
00072                         if(value)
00073                                 value=0;
00074                         else
00075                                 value=0x7f;
00076                         break;
00077                 case 27:
00078                         return 0;
00079                 default:
00080                         norefresh=1;
00081                 }
00082                 if(!norefresh)
00083                         show_it(value);
00084         }
00085 }               

Generated on Fri Feb 25 08:02:40 2005 for brickos by  doxygen 1.3.9.1