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
16 #include <linux/config.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 <video/font.h>
26 static struct fbcon_font_desc *fbcon_fonts[] = {
27 #ifdef CONFIG_FONT_8x8
31 #ifdef CONFIG_FONT_8x16
35 #ifdef CONFIG_FONT_6x11
36 #if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FB_SBUS)
41 #ifdef CONFIG_FONT_SUN8x16
45 #ifdef CONFIG_FONT_SUN12x22
46 #if defined(CONFIG_FB_SBUS) || defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB32)
51 #ifdef CONFIG_FONT_ACORN_8x8
55 #ifdef CONFIG_FONT_PEARL_8x8
61 #define num_fonts (sizeof(fbcon_fonts)/sizeof(*fbcon_fonts))
64 #error No fonts configured.
69 * fbcon_find_font - find a font
70 * @name: string name of a font
72 * Find a specified font with string name @name.
74 * Returns %NULL if no font found, or a pointer to the
79 struct fbcon_font_desc *fbcon_find_font(char *name)
83 for (i = 0; i < num_fonts; i++)
84 if (!strcmp(fbcon_fonts[i]->name, name))
85 return fbcon_fonts[i];
91 * fbcon_get_default_font - get default font
92 * @xres: screen size of X
93 * @yres: screen size of Y
95 * Get the default font for a specified screen size.
96 * Dimensions are in pixels.
98 * Returns %NULL if no font is found, or a pointer to the
103 struct fbcon_font_desc *fbcon_get_default_font(int xres, int yres)
106 struct fbcon_font_desc *f, *g;
110 for(i=0; i<num_fonts; i++) {
113 #if defined(__mc68000__) || defined(CONFIG_APUS)
114 #ifdef CONFIG_FONT_PEARL_8x8
115 if (MACH_IS_AMIGA && f->idx == PEARL8x8_IDX)
118 #ifdef CONFIG_FONT_6x11
119 if (MACH_IS_MAC && xres < 640 && f->idx == VGA6x11_IDX)
123 if ((yres < 400) == (f->height <= 8))