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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [m68knommu/] [console/] [fonts.c] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
 
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
 
17
 
18
   /*
19
    *    External Font Definitions
20
    */
21
 
22
/* VGA8x8 */
23
extern char fontname_8x8[];
24
extern int fontwidth_8x8, fontheight_8x8;
25
extern u_char fontdata_8x8[];
26
 
27
/* VGA8x16 */
28
extern char fontname_8x16[];
29
extern int fontwidth_8x16, fontheight_8x16;
30
extern u_char fontdata_8x16[];
31
 
32
/* PEARL8x8 */
33
extern char fontname_pearl8x8[];
34
extern int fontwidth_pearl8x8, fontheight_pearl8x8;
35
extern u_char fontdata_pearl8x8[];
36
 
37
/* MINI4x6 */
38
extern char fontname_mini4x6[];
39
extern int fontwidth_mini4x6, fontheight_mini4x6;
40
extern u_char fontdata_mini4x6[];
41
 
42
 
43
   /*
44
    *    Font Descriptor Array
45
    */
46
 
47
struct softfontdesc {
48
   char *name;
49
   int *width;
50
   int *height;
51
   u_char *data;
52
};
53
 
54
#define VGA8x8_IDX      0
55
#define VGA8x16_IDX     1
56
#define PEARL8x8_IDX    2
57
#define MINI4x6_IDX     3
58
 
59
static struct softfontdesc softfonts[] = {
60
   { fontname_8x8, &fontwidth_8x8, &fontheight_8x8, fontdata_8x8 },
61
   { fontname_8x16, &fontwidth_8x16, &fontheight_8x16, fontdata_8x16 },
62
   { fontname_pearl8x8, &fontwidth_pearl8x8, &fontheight_pearl8x8,
63
     fontdata_pearl8x8 },
64
   { fontname_mini4x6, &fontwidth_mini4x6, &fontheight_mini4x6,
65
     fontdata_mini4x6 },
66
};
67
 
68
static u_long numsoftfonts = sizeof(softfonts)/sizeof(*softfonts);
69
 
70
 
71
   /*
72
    *    Find a font with a specific name
73
    */
74
 
75
int findsoftfont(char *name, int *width, int *height, u_char *data[])
76
{
77
   int i;
78
 
79
   for (i = 0; i < numsoftfonts; i++)
80
      if (!strcmp(softfonts[i].name, name)) {
81
         if (width)
82
            *width = *softfonts[i].width;
83
         if (height)
84
            *height = *softfonts[i].height;
85
         if (data)
86
            *data = softfonts[i].data;
87
                        return(1);
88
      }
89
        return(0);
90
}
91
 
92
 
93
   /*
94
    *    Get the default font for a specific screen size
95
    */
96
 
97
void getdefaultfont(int xres, int yres, char *name[], int *width, int *height,
98
                    u_char *data[])
99
{
100
    int i;
101
 
102
    i = MINI4x6_IDX;
103
 
104
    if (name)
105
        *name = softfonts[i].name;
106
    if (width)
107
        *width = *softfonts[i].width;
108
    if (height)
109
        *height = *softfonts[i].height;
110
    if (data)
111
        *data = softfonts[i].data;
112
}

powered by: WebSVN 2.1.0

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