]> git.proxmox.com Git - grub2.git/blob - include/grub/font.h
2006-03-14 Vesa Jaaskelainen <chaac@nic.fi>
[grub2.git] / include / grub / font.h
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003 Free Software Foundation, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef GRUB_FONT_HEADER
21 #define GRUB_FONT_HEADER 1
22
23 #include <grub/types.h>
24
25 #define GRUB_FONT_MAGIC "PPF\x7f"
26
27 struct grub_font_glyph
28 {
29 /* Glyph width in pixels. */
30 grub_uint8_t width;
31
32 /* Glyph height in pixels. */
33 grub_uint8_t height;
34
35 /* Glyph width in characters. */
36 grub_uint8_t char_width;
37
38 /* Glyph baseline position in pixels (from up). */
39 grub_uint8_t baseline;
40
41 /* Glyph bitmap data array of bytes in ((width + 7) / 8) * height.
42 Bitmap is formulated by height scanlines, each scanline having
43 width number of pixels. Pixels are coded as bits, value 1 meaning
44 of opaque pixel and 0 is transparent. If width does not fit byte
45 boundary, it will be padded with 0 to make it fit. */
46 grub_uint8_t bitmap[32];
47 };
48
49 typedef struct grub_font_glyph *grub_font_glyph_t;
50
51 int grub_font_get_glyph (grub_uint32_t code,
52 grub_font_glyph_t glyph);
53
54 #endif /* ! GRUB_FONT_HEADER */