2 * linux/drivers/video/fonts.c -- `Soft' font definitions
4 * Created 1995 by Geert Uytterhoeven
5 * Rewritten 1998 by Martin Mares <mj@ucw.cz>
7 * 2001 - Documented with DocBook
8 * - Brad Douglas <brad@neruo.com>
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive
15 #include <linux/config.h>
16 #include <linux/module.h>
17 #include <linux/types.h>
18 #include <linux/string.h>
19 #if defined(__mc68000__) || defined(CONFIG_APUS)
20 #include <asm/setup.h>
22 #include <linux/font.h>
26 static const struct font_desc *fonts[] = {
27 #ifdef CONFIG_FONT_8x8
31 #ifdef CONFIG_FONT_8x16
35 #ifdef CONFIG_FONT_6x11
39 #ifdef CONFIG_FONT_7x14
43 #ifdef CONFIG_FONT_SUN8x16
47 #ifdef CONFIG_FONT_SUN12x22
51 #ifdef CONFIG_FONT_10x18
55 #ifdef CONFIG_FONT_ACORN_8x8
59 #ifdef CONFIG_FONT_PEARL_8x8
63 #ifdef CONFIG_FONT_MINI_4x6
73 #define num_fonts (sizeof(fonts)/sizeof(*fonts))
76 #error No fonts configured.
81 * find_font - find a font
82 * @name: string name of a font
84 * Find a specified font with string name @name.
86 * Returns %NULL if no font found, or a pointer to the
91 const struct font_desc *find_font(const char *name)
95 for (i = 0; i < num_fonts; i++)
96 if (!strcmp(fonts[i]->name, name))
103 * get_default_font - get default font
104 * @xres: screen size of X
105 * @yres: screen size of Y
107 * Get the default font for a specified screen size.
108 * Dimensions are in pixels.
110 * Returns %NULL if no font is found, or a pointer to the
115 const struct font_desc *get_default_font(int xres, int yres)
118 const struct font_desc *f, *g;
122 for(i=0; i<num_fonts; i++) {
125 #if defined(__mc68000__) || defined(CONFIG_APUS)
126 #ifdef CONFIG_FONT_PEARL_8x8
127 if (MACH_IS_AMIGA && f->idx == PEARL8x8_IDX)
130 #ifdef CONFIG_FONT_6x11
131 if (MACH_IS_MAC && xres < 640 && f->idx == VGA6x11_IDX)
135 if ((yres < 400) == (f->height <= 8))
145 EXPORT_SYMBOL(find_font);
146 EXPORT_SYMBOL(get_default_font);
148 MODULE_AUTHOR("James Simmons <jsimmons@users.sf.net>");
149 MODULE_DESCRIPTION("Console Fonts");
150 MODULE_LICENSE("GPL");