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 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive
13 #include <linux/config.h>
14 #include <linux/types.h>
15 #include <linux/string.h>
16 #if defined(__mc68000__) || defined(CONFIG_APUS)
17 #include <asm/setup.h>
19 #include <video/font.h>
23 static struct fbcon_font_desc
*fbcon_fonts
[] = {
24 #ifdef CONFIG_FONT_8x8
28 #ifdef CONFIG_FONT_8x16
32 #ifdef CONFIG_FONT_6x11
33 #if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FB_SBUS)
38 #ifdef CONFIG_FONT_SUN8x16
42 #ifdef CONFIG_FONT_SUN12x22
43 #if defined(CONFIG_FB_SBUS) || defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB32)
48 #ifdef CONFIG_FONT_ACORN_8x8
52 #ifdef CONFIG_FONT_PEARL_8x8
58 #define num_fonts (sizeof(fbcon_fonts)/sizeof(*fbcon_fonts))
61 #error No fonts configured.
65 * Find a font with a specific name
68 struct fbcon_font_desc
*fbcon_find_font(char *name
)
72 for (i
= 0; i
< num_fonts
; i
++)
73 if (!strcmp(fbcon_fonts
[i
]->name
, name
))
74 return fbcon_fonts
[i
];
80 * Get the default font for a specific screen size
83 struct fbcon_font_desc
*fbcon_get_default_font(int xres
, int yres
)
86 struct fbcon_font_desc
*f
, *g
;
90 for(i
=0; i
<num_fonts
; i
++) {
93 #if defined(__mc68000__) || defined(CONFIG_APUS)
94 #ifdef CONFIG_FONT_PEARL_8x8
95 if (MACH_IS_AMIGA
&& f
->idx
== PEARL8x8_IDX
)
98 #ifdef CONFIG_FONT_6x11
99 if (MACH_IS_MAC
&& xres
< 640 && f
->idx
== VGA6x11_IDX
)
103 if ((yres
< 400) == (f
->height
<= 8))