1 /*
2 * BB: The portable demo
3 *
4 * (C) 1997 by AA-group (e-mail: aa@horac.ta.jcu.cz)
5 *
6 * 3rd August 1997
7 * version: 1.2 [final3]
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public Licences as by published
11 * by the Free Software Foundation; either version 2; or (at your option)
12 * any later version
13 *
14 * This program is distributed in the hope that it will entertaining,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILTY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Publis License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.
21 * 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #include <stdlib.h>
25 #include <aalib.h>
26 #include "bb.h"
27
uncompressfont(const aa_font * font)28 struct font *uncompressfont(const aa_font * font)
29 {
30 struct font *ufont = malloc(sizeof(struct font));
31 int i, y;
32 ufont->width = 8;
33 ufont->height = font->height;
34 ufont->data = calloc(1, 256 * 8 * font->height);
35 for (i = 0, y = 0; i < 256 * font->height; i++, y += 8) {
36 char c = font->data[i];
37 ufont->data[y] = c & (1 << 7);
38 ufont->data[y + 1] = c & (1 << 6);
39 ufont->data[y + 2] = c & (1 << 5);
40 ufont->data[y + 3] = c & (1 << 4);
41 ufont->data[y + 4] = c & (1 << 3);
42 ufont->data[y + 5] = c & (1 << 2);
43 ufont->data[y + 6] = c & (1 << 1);
44 ufont->data[y + 7] = c & (1 << 0);
45 }
46 return (ufont);
47
48 }
49