Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  font.h -- `Soft' font definitions
0003  *
0004  *  Created 1995 by Geert Uytterhoeven
0005  *
0006  *  This file is subject to the terms and conditions of the GNU General Public
0007  *  License.  See the file COPYING in the main directory of this archive
0008  *  for more details.
0009  */
0010 
0011 #ifndef _VIDEO_FONT_H
0012 #define _VIDEO_FONT_H
0013 
0014 #include <linux/types.h>
0015 
0016 struct font_desc {
0017     int idx;
0018     const char *name;
0019     unsigned int width, height;
0020     unsigned int charcount;
0021     const void *data;
0022     int pref;
0023 };
0024 
0025 #define VGA8x8_IDX  0
0026 #define VGA8x16_IDX 1
0027 #define PEARL8x8_IDX    2
0028 #define VGA6x11_IDX 3
0029 #define FONT7x14_IDX    4
0030 #define FONT10x18_IDX   5
0031 #define SUN8x16_IDX 6
0032 #define SUN12x22_IDX    7
0033 #define ACORN8x8_IDX    8
0034 #define MINI4x6_IDX 9
0035 #define FONT6x10_IDX    10
0036 #define TER16x32_IDX    11
0037 #define FONT6x8_IDX 12
0038 
0039 extern const struct font_desc   font_vga_8x8,
0040             font_vga_8x16,
0041             font_pearl_8x8,
0042             font_vga_6x11,
0043             font_7x14,
0044             font_10x18,
0045             font_sun_8x16,
0046             font_sun_12x22,
0047             font_acorn_8x8,
0048             font_mini_4x6,
0049             font_6x10,
0050             font_ter_16x32,
0051             font_6x8;
0052 
0053 /* Find a font with a specific name */
0054 
0055 extern const struct font_desc *find_font(const char *name);
0056 
0057 /* Get the default font for a specific screen size */
0058 
0059 extern const struct font_desc *get_default_font(int xres, int yres,
0060                         u32 font_w, u32 font_h);
0061 
0062 /* Max. length for the name of a predefined font */
0063 #define MAX_FONT_NAME   32
0064 
0065 /* Extra word getters */
0066 #define REFCOUNT(fd)    (((int *)(fd))[-1])
0067 #define FNTSIZE(fd) (((int *)(fd))[-2])
0068 #define FNTCHARCNT(fd)  (((int *)(fd))[-3])
0069 #define FNTSUM(fd)  (((int *)(fd))[-4])
0070 
0071 #define FONT_EXTRA_WORDS 4
0072 
0073 struct font_data {
0074     unsigned int extra[FONT_EXTRA_WORDS];
0075     const unsigned char data[];
0076 } __packed;
0077 
0078 #endif /* _VIDEO_FONT_H */