001: // ymageFontGenerator.java
002: // ---------------------------
003: // (C) by Michael Peter Christen; mc@anomic.de
004: // first published on http://www.anomic.de
005: // Frankfurt, Germany, 2005
006: // created: 31.10.2005
007: //
008: // This program is free software; you can redistribute it and/or modify
009: // it under the terms of the GNU General Public License as published by
010: // the Free Software Foundation; either version 2 of the License, or
011: // (at your option) any later version.
012: //
013: // This program is distributed in the hope that it will be useful,
014: // but WITHOUT ANY WARRANTY; without even the implied warranty of
015: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: // GNU General Public License for more details.
017: //
018: // You should have received a copy of the GNU General Public License
019: // along with this program; if not, write to the Free Software
020: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021: //
022: // Using this software in any meaning (reading, learning, copying, compiling,
023: // running) means that you agree that the Author(s) is (are) not responsible
024: // for cost, loss of data or any harm that may be caused directly or indirectly
025: // by usage of this softare or this documentation. The usage of this software
026: // is on your own risk. The installation and usage (starting/running) of this
027: // software may allow other people or application to access your computer and
028: // any attached devices and is highly dependent on the configuration of the
029: // software which must be done by the user of the software; the author(s) is
030: // (are) also not responsible for proper configuration and usage of the
031: // software, even if provoked by documentation provided together with
032: // the software.
033: //
034: // Any changes to this file according to the GPL as documented in the file
035: // gpl.txt aside this file in the shipment you received can be done to the
036: // lines that follows this copyright notice here, but changes must not be
037: // done inside the copyright notive above. A re-distribution must contain
038: // the intact and unchanged copyright notice.
039: // Contributions and changes to the program code must be marked as such.
040:
041: package de.anomic.ymage;
042:
043: public class ymageFontGenerator {
044:
045: /*
046: ?0x20: !"#$%&'
047: 0x28:()*+,-./
048: 0x30:01234567
049: 0x38:89:;<=>?
050: 0x40:@ABCDEFG
051: 0x48:HIJKLMNO
052: 0x50:PQRSTUVW
053: 0x58:XYZ[\]^_
054: 0x60:`abcdefg
055: 0x68:hijklmno
056: 0x70:pqrstuvw
057: 0x78:xyz{|}~
058: */
059:
060: public static final String[][] font = { { ".....", //0x20
061: ".....", ".....", ".....", "....." },
062: { "..X..", "..X..", "..X..", ".....", "..X.." },
063: { ".X.X.", ".X.X.", ".....", ".....", "....." },
064: { ".X.X.", "XXXXX", ".X.X.", "XXXXX", ".X.X." },
065: { "+XXXX", "X.X..", "+XXX+", "..X.X", "XXXX+" },
066: { ".X..X", "X.XX.", ".XXX.", ".XX.X", "X..X." },
067: { "+XXX.", "X+...", "+X+X.", "X.X+.", "+X+X." },
068: { "..X..", "..X..", ".....", ".....", "....." }, { "....X", //0x28
069: "...X+", "...X.", "...X+", "....X" },
070: { "X....", "+X...", ".X...", "+X...", "x...." },
071: { ".....", ".X.X.", "++X++", ".x.X.", "....." },
072: { ".....", "..X..", ".XXX.", "..X..", "....." },
073: { ".....", ".....", "..X..", ".+X..", ".X..." },
074: { ".....", ".....", ".XXX.", ".....", "....." },
075: { ".....", ".....", ".....", ".....", "..X.." },
076: { "....X", "...X+", "..X+.", ".X+..", "X+..." }, { ".XXX.", //0x30
077: "X+.XX", "X.X.X", "XX.+X", ".XXX." },
078: { "..X..", ".XX..", "..X..", "..X..", ".XXX." },
079: { ".XXX.", "X+.+X", ".+XX+", "+X+..", "XXXXX" },
080: { ".XXX.", "X+.+X", "...X+", "X+.+X", ".XXX." },
081: { ".+XX.", "+X+X.", "XXXXX", "...X.", "...X." },
082: { "XXXXX", "X....", "XXXX.", "...+X", "XXXX." },
083: { ".XXX.", "X+...", "XXXX+", "X+.+X", ".XXX." },
084: { "XXXXX", "..+X+", "..X+.", "..X..", "..X.." }, { ".XXX.", //0x38
085: "X+.+X", "+XXX.", "X+.+X", ".XXX." },
086: { ".XXX.", "X+.+X", "+XXXX", "...+X", ".XXX." },
087: { ".....", "..X..", ".....", "..X..", "....." },
088: { ".....", "..X..", ".....", ".+X..", ".X..." },
089: { "...X+", "..X+.", ".X+..", "..X+.", "...X+" },
090: { ".....", "XXXXX", ".....", "XXXXX", "....." },
091: { "+X...", ".+X..", "..+X.", ".+X..", "+X..." },
092: { ".XXX.", "..+X.", "..X..", ".....", "..X.." }, { "+XXX+", //0x40
093: "XXX.X", "X+XX+", "X+...", ".XXX." },
094: { ".+X+.", "+X+X+", "X+.+X", "XXXXX", "X...X" },
095: { "XXX+.", "X.+X.", "XXXX+", "X..+X", "XXXX." },
096: { ".XXX.", "X+...", "X....", "X+...", ".XXX." },
097: { "XXXX.", "X..+X", "X...X", "X..+X", "XXXX." },
098: { "XXXXX", "X....", "XXX..", "X....", "XXXXX" },
099: { "XXXXX", "X....", "XXX..", "X....", "X...." },
100: { ".XXX.", "X+...", "X.XXX", "X..+X", ".XXX." }, { "X...X", //0x48
101: "X...X", "XXXXX", "X...X", "X...X" },
102: { "XXXXX", "..X..", "..X..", "..X..", "XXXXX" },
103: { "XXXXX", "....X", "....X", "X+.+X", ".XXX." },
104: { "X..+X", "X.+X.", "XXX..", "X.+X.", "X..+X" },
105: { "X....", "X....", "X....", "X....", "XXXXX" },
106: { "X...X", "XX.XX", "X+X+X", "X.+.X", "X...X" },
107: { "X+..X", "XX+.X", "X+X+X", "X.+XX", "X..+X" },
108: { ".XXX.", "X+.+X", "X...X", "X+.+X", ".XXX." }, { "XXXX.", //0x50
109: "X..+X", "XXXX.", "X....", "X...." },
110: { ".XXX.", "X+.+X", "X.X+X", "X++X+", ".XX+X" },
111: { "XXXX.", "X..+X", "XXXX.", "X.+X.", "X..+X" },
112: { ".XXX+", "X+...", ".XXX.", "...+X", "+XXX." },
113: { "XXXXX", "..X..", "..X..", "..X..", "..X.." },
114: { "X...X", "X...X", "X...X", "X+.+X", ".XXX." },
115: { "X...X", "X...X", "X+.+X", ".X+X.", "..X.." },
116: { "X...X", "X...X", "X.+.X", "X+X+X", ".X.X." }, { "X+.+X", //0x58
117: "+X+X+", ".+X+.", "+X+X+", "X+.+X" },
118: { "X...X", "+X.X+", ".+X+.", "..X..", "..X.." },
119: { "XXXXX", "..+X+", ".+X+.", "+X+..", "XXXXX" },
120: { "..XXX", "..X..", "..X..", "..X..", "..XXX" },
121: { "X+...", "+X+..", ".+X+.", "..+X+", "...+X" },
122: { "XXX..", "..X..", "..X..", "..X..", "XXX.." },
123: { ".+X+.", "+X+X+", "X+.+X", ".....", "....." },
124: { ".....", ".....", ".....", ".....", "XXXXX" }, { ".X+..", //0x60
125: ".+X..", ".....", ".....", "....." },
126: { ".....", ".....", "+XXXX", "X+..X", ".XXXX" },
127: { "X....", "X....", "XXXX.", "X..+X", "XXXX." },
128: { ".....", ".....", ".XXXX", "X+...", ".XXXX" },
129: { "....X", "....X", ".XXXX", "X+..X", ".XXXX" },
130: { ".....", "+XX+.", "X.+X.", "X+X+.", ".XXXX" },
131: { "..XX.", "..X+.", ".XXX.", "..X..", "..X.." },
132: { ".....", ".+XX+", ".X+.X", ".+X+X", "XXXX." }, { "X....", //0x68
133: "X....", "X+XX+", "XX++X", "X+..X" },
134: { "..X..", ".....", "..X..", "..X..", "..X.." },
135: { "..X..", ".....", "..X..", ".+X..", ".X+.." },
136: { "X....", "X....", "X.+XX", "XXX+.", "X.+XX" },
137: { "..X..", "..X..", "..X..", "..X..", "..X.." },
138: { ".....", ".....", ".X+X.", "X+X+X", "X.X.X" },
139: { ".....", ".....", ".XXX.", "X+.+X", "X...X" },
140: { ".....", ".....", ".XXX.", "X+.+X", ".XXX." }, { ".....", //0x70
141: "XXXX.", "X..+X", "XXXX.", "X...." },
142: { ".....", ".XXXX", "X+..X", ".XXXX", "....X" },
143: { ".....", "..+X.", "..X+.", "..X..", "..X.." },
144: { ".....", ".....", ".+XX.", "+X++X", "X++X." },
145: { "..X..", ".XXX.", "..X..", "..X..", "..X.." },
146: { ".....", ".....", "X...X", "X+.+X", ".XXX." },
147: { ".....", ".....", "X+.+X", "+X+X+", ".+X+." },
148: { ".....", ".....", "X.X.X", "X+X+X", ".X+X." }, { ".....", //0x78
149: ".....", ".X+X.", ".+X+.", ".X+X." },
150: { ".....", ".....", ".X+X.", ".+X+.", "..X.." },
151: { ".....", ".....", ".XXXX", ".+X+.", "XXXX." },
152: { "...XX", "..+X+", ".+X+.", "..+X+", "...XX" },
153: { "..X..", "..X..", "..X..", "..X..", "..X.." },
154: { "XX...", "+X+..", ".+X+.", "+X+..", "XX..." },
155: { ".....", "+X+..", "X+X+X", "..+X+", "....." },
156: { "XXXXX", "X...X", "X...X", "X...X", "XXXXX" }, };
157:
158: public static void main(String[] args) {
159: String[] letter;
160: long b;
161: long v;
162: int c = 0;
163: String s;
164: for (int i = 0; i < font.length; i++) {
165: letter = font[i];
166: b = 0;
167: for (int j = 0; j < 5; j++) {
168: b = b << 10;
169: v = 1 << 9;
170: for (int col = 0; col < 5; col++) {
171: if (letter[j].charAt(col) == '+')
172: b += v;
173: if (letter[j].charAt(col) == 'X')
174: b += v + (v / 2);
175: v = v >> 2;
176: }
177: }
178: s = Long.toHexString(b).toUpperCase();
179: while (s.length() < 14)
180: s = "0" + s;
181: System.out.print("0x" + s + "L,");
182: c++;
183: if (c >= 8) {
184: System.out.println();
185: c = 0;
186: }
187: }
188: }
189:
190: }
|