// ymageFontGenerator.java // --------------------------- // (C) by Michael Peter Christen; mc@anomic.de // first published on http://www.anomic.de // Frankfurt, Germany, 2005 // created: 31.10.2005 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Using this software in any meaning (reading, learning, copying, compiling, // running) means that you agree that the Author(s) is (are) not responsible // for cost, loss of data or any harm that may be caused directly or indirectly // by usage of this softare or this documentation. The usage of this software // is on your own risk. The installation and usage (starting/running) of this // software may allow other people or application to access your computer and // any attached devices and is highly dependent on the configuration of the // software which must be done by the user of the software; the author(s) is // (are) also not responsible for proper configuration and usage of the // software, even if provoked by documentation provided together with // the software. // // Any changes to this file according to the GPL as documented in the file // gpl.txt aside this file in the shipment you received can be done to the // lines that follows this copyright notice here, but changes must not be // done inside the copyright notive above. A re-distribution must contain // the intact and unchanged copyright notice. // Contributions and changes to the program code must be marked as such. package de.anomic.ymage; public class ymageFontGenerator { /* ?0x20: !"#$%&' 0x28:()*+,-./ 0x30:01234567 0x38:89:;<=>? 0x40:@ABCDEFG 0x48:HIJKLMNO 0x50:PQRSTUVW 0x58:XYZ[\]^_ 0x60:`abcdefg 0x68:hijklmno 0x70:pqrstuvw 0x78:xyz{|}~ */ public static final String[][] font = { {".....", //0x20 ".....", ".....", ".....", "....."}, {"..X..", "..X..", "..X..", ".....", "..X.."}, {".X.X.", ".X.X.", ".....", ".....", "....."}, {".X.X.", "XXXXX", ".X.X.", "XXXXX", ".X.X."}, {".XXXX", "X.X..", ".XXX.", "..X.X", "XXXX."}, {".X..X", "X.XX.", ".XXX.", ".XX.X", "X..X."}, {".XXX.", "X....", ".X.X.", "X.X..", ".X.X."}, {"..X..", "..X..", ".....", ".....", "....."}, {"...X.", //0x28 "..X..", "..X..", "..X..", "...X."}, {".X...", "..X..", "..X..", "..X..", ".x..."}, {".....", ".X.X.", "xxXxx", ".x.X.", "....."}, {".....", "..X..", ".XXX.", "..X..", "....."}, {".....", ".....", "..X..", "..X..", ".X..."}, {".....", ".....", ".XXX.", ".....", "....."}, {".....", ".....", ".....", ".....", "..X.."}, {"....X", "...X.", "..X..", ".X...", "X...."}, {".XXX.", //0x30 "X..XX", "X.X.X", "XX..X", ".XXX."}, {"..X..", ".XX..", "..X..", "..X..", ".XXX."}, {".XXX.", "X...X", "..XX.", ".X...", "XXXXX"}, {".XXX.", "X...X", "...X.", "X...X", ".XXX."}, {"..XX.", ".X.X.", "XXXXX", "...X.", "...X."}, {"XXXXX", "X....", "XXXX.", "....X", "XXXX."}, {".XXX.", "X....", "XXXX.", "X...X", ".XXX."}, {"XXXXX", "...X.", "..X..", "..X..", "..X.."}, {".XXX.", //0x38 "X...X", ".XXX.", "X...X", ".XXX."}, {".XXX.", "X...X", ".XXXX", "....X", ".XXX."}, {".....", "..X..", ".....", "..X..", "....."}, {".....", "..X..", ".....", "..X..", ".X..."}, {"...X.", "..X..", ".X...", "..X..", "...X."}, {".....", "XXXXX", ".....", "XXXXX", "....."}, {".X...", "..X..", "...X.", "..X..", ".X..."}, {".XXX.", "...X.", "..X..", ".....", "..X.."}, {".XXX.", //0x40 "XXX.X", "XXXX.", "X....", ".XXX."}, {"..X..", ".X.X.", "X...X", "XXXXX", "X...X"}, {"XXX..", "X..X.", "XXXX.", "X...X", "XXXX."}, {".XXX.", "X....", "X....", "X....", ".XXX."}, {"XXXX.", "X...X", "X...X", "X...X", "XXXX."}, {"XXXXX", "X....", "XXX..", "X....", "XXXXX"}, {"XXXXX", "X....", "XXX..", "X....", "X...."}, {".XXX.", "X....", "X.XXX", "X...X", ".XXX."}, {"X...X", //0x48 "X...X", "XXXXX", "X...X", "X...X"}, {"XXXXX", "..X..", "..X..", "..X..", "XXXXX"}, {"XXXXX", "....X", "....X", "X...X", ".XXX."}, {"X...X", "X..X.", "XXX..", "X..X..", "X...X"}, {"X....", "X....", "X....", "X....", "XXXXX"}, {"X...X", "XX.XX", "X.X.X", "X...X", "X...X"}, {"X...X", "XX..X", "X.X.X", "X..XX", "X...X"}, {".XXX.", "X...X", "X...X", "X...X", ".XXX."}, {"XXXX.", //0x50 "X...X", "XXXX.", "X....", "X...."}, {".XXX.", "X...X", "X.X.X", "X..X.", ".XX.X"}, {"XXXX.", "X...X", "XXXX.", "X..X.", "X...X"}, {".XXX.", "X....", ".XXX.", "....X", ".XXX."}, {"XXXXX", "..X..", "..X..", "..X..", "..X.."}, {"X...X", "X...X", "X...X", "X...X", ".XXX."}, {"X...X", "X...X", "X...X", ".X.X.", "..X.."}, {"X...X", "X...X", "X...X", "X.X.X", ".X.X."}, {"X...X", //0x58 ".X.X.", "..X..", ".X.X.", "X...X"}, {"X...X", ".X.X.", "..X..", "..X..", "..X.."}, {"XXXXX", "...X.", "..X..", ".X...", "XXXXX"}, {".XXX.", ".X...", ".X...", ".X...", ".XXX."}, {"X....", ".X...", "..X..", "...X.", "....X"}, {".XXX.", "...X.", "...X.", "...X.", ".XXX."}, {"..X..", ".X.X.", "X...X", ".....", "....."}, {".....", ".....", ".....", ".....", "XXXXX"}, {".X...", //0x60 "..X..", ".....", ".....", "....."}, {".....", ".....", ".XXXX", "X...X", ".XXXX"}, {"X....", "X....", "XXXX.", "X...X", "XXXX."}, {".....", ".....", ".XXXX", "X....", ".XXXX"}, {"....X", "....X", ".XXXX", "X...X", ".XXXX"}, {".....", ".XX..", "X..X.", "X.X..", ".XXXX"}, {"..XX.", "..X..", ".XXX.", "..X..", "..X.."}, {".....", "..XX.", ".X..X", "..X.X", "XXXX."}, {"X....", //0x68 "X....", "X.XX.", "XX..X", "X...X"}, {"..X..", ".....", "..X..", "..X..", "..X.."}, {"..X..", ".....", "..X..", "..X..", ".X..."}, {"X....", "X....", "X..XX", "XXX..", "X..XX"}, {"..X..", "..X..", "..X..", "..X..", "..X.."}, {".....", ".....", ".X.X.", "X.X.X", "X.X.X"}, {".....", ".....", ".XXX.", "X...X", "X...X"}, {".....", ".....", ".XXX.", "X...X", ".XXX."}, {".....", //0x70 "XXXX.", "X...X", "XXXX.", "X...."}, {".....", ".XXXX", "X...X", ".XXXX", "....X"}, {".....", "...X.", "..X..", "..X..", "..X.."}, {".....", ".....", "..XX.", ".X..X", "X..X."}, {"..X..", ".XXX.", "..X..", "..X..", "..X.."}, {".....", ".....", "X...X", "X...X", ".XXX."}, {".....", ".....", "X...X", ".X.X.", "..X.."}, {".....", ".....", "X.X.X", "X.X.X", ".X.X."}, {".....", //0x78 ".....", ".X.X.", "..X..", ".X.X."}, {".....", ".....", ".X.X.", "..X..", "..X.."}, {".....", ".....", ".XXXX", "..X..", "XXXX."}, {"..XX.", "..X..", ".X...", "..X..", "..XX."}, {"..X..", "..X..", "..X..", "..X..", "..X.."}, {".XX..", "..X..", "...X.", "..X..", ".XX.."}, {".....", ".X...", "X.X.X", "...X.", "....."}, {"XXXXX", "X...X", "X...X", "X...X", "XXXXX"}, }; public static void main(String[] args) { String[] letter; int b; int v; int c = 0; String s; for (int i = 0; i < font.length; i++) { letter = font[i]; b = 0; for (int j = 0; j < 5; j++) { b = b << 5; v = 16; for (int col = 0; col < 5; col++) { if (letter[j].charAt(col) == 'X') b += v; v = v >> 1; } } s = Long.toHexString(b).toUpperCase(); while (s.length() < 7) s = "0" + s; System.out.print("0x" + s + ","); c++; if (c >= 8) { System.out.println(); c = 0; } } } }