OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [m68k/] [console/] [fonts.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1623 jcastillo
 
2
/*
3
 * arch/m68k/console/fonts.c -- `Soft' font definitions
4
 *
5
 *    Created 1995 by Geert Uytterhoeven
6
 *
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
9
 * for more details.
10
 */
11
 
12
 
13
#include <linux/types.h>
14
#include <linux/string.h>
15
#include <asm/font.h>
16
#include <asm/bootinfo.h>
17
 
18
 
19
   /*
20
    *    External Font Definitions
21
    */
22
 
23
/* VGA8x8 */
24
extern char fontname_8x8[];
25
extern int fontwidth_8x8, fontheight_8x8;
26
extern u_char fontdata_8x8[];
27
 
28
/* VGA8x16 */
29
extern char fontname_8x16[];
30
extern int fontwidth_8x16, fontheight_8x16;
31
extern u_char fontdata_8x16[];
32
 
33
/* PEARL8x8 */
34
extern char fontname_pearl8x8[];
35
extern int fontwidth_pearl8x8, fontheight_pearl8x8;
36
extern u_char fontdata_pearl8x8[];
37
 
38
 
39
   /*
40
    *    Font Descriptor Array
41
    */
42
 
43
struct softfontdesc {
44
   char *name;
45
   int *width;
46
   int *height;
47
   u_char *data;
48
};
49
 
50
#define VGA8x8_IDX      0
51
#define VGA8x16_IDX     1
52
#define PEARL8x8_IDX    2
53
 
54
static struct softfontdesc softfonts[] = {
55
   { fontname_8x8, &fontwidth_8x8, &fontheight_8x8, fontdata_8x8 },
56
   { fontname_8x16, &fontwidth_8x16, &fontheight_8x16, fontdata_8x16 },
57
   { fontname_pearl8x8, &fontwidth_pearl8x8, &fontheight_pearl8x8,
58
     fontdata_pearl8x8 },
59
};
60
 
61
static u_long numsoftfonts = sizeof(softfonts)/sizeof(*softfonts);
62
 
63
 
64
   /*
65
    *    Find a font with a specific name
66
    */
67
 
68
int findsoftfont(char *name, int *width, int *height, u_char *data[])
69
{
70
   int i;
71
 
72
   for (i = 0; i < numsoftfonts; i++)
73
      if (!strcmp(softfonts[i].name, name)) {
74
         if (width)
75
            *width = *softfonts[i].width;
76
         if (height)
77
            *height = *softfonts[i].height;
78
         if (data)
79
            *data = softfonts[i].data;
80
                        return(1);
81
      }
82
        return(0);
83
}
84
 
85
 
86
   /*
87
    *    Get the default font for a specific screen size
88
    */
89
 
90
void getdefaultfont(int xres, int yres, char *name[], int *width, int *height,
91
                    u_char *data[])
92
{
93
    int i;
94
 
95
    if (yres < 400)
96
        i = MACH_IS_AMIGA ? PEARL8x8_IDX : VGA8x8_IDX;
97
    else
98
        i = VGA8x16_IDX;
99
 
100
    if (name)
101
        *name = softfonts[i].name;
102
    if (width)
103
        *width = *softfonts[i].width;
104
    if (height)
105
        *height = *softfonts[i].height;
106
    if (data)
107
        *data = softfonts[i].data;
108
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.