5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 1998-1999 by Sun Microsystems, Inc.
25 # All rights reserved.
39 pats
["a"]=
"X X "; pats
["A"] = pats
["a"];
40 pats
["b"]=
"X XX"; pats
["B"] = pats
["b"];
41 pats
["c"]=
"XX "; pats
["C"] = pats
["c"];
42 pats
["d"]=
"XX X"; pats
["D"] = pats
["d"];
43 pats
["e"]=
"XXX "; pats
["E"] = pats
["e"];
44 pats
["f"]=
"XXXX"; pats
["F"] = pats
["f"];
55 for (c =
0; c
< byteswide
; c
++)
56 printf "0x%s, ", substr($
0,c
*2+1,2);
58 for (c =
0; c
< byteswide
*2; c
++)
59 s = s pats
[substr($
0,c
+1,1)];
60 s =
substr(s
, 1, bitswide
);
61 printf "/* %s */\n", s
;
63 offset
+=
length($
0)/2;
69 printf "Unknown BDF version number %s!\n", $
2;
77 for (i =
0; i
< 256; i
++)
86 for (i =
2; i
< NF; i
++)
96 printf "#include <sys/types.h>\n"
97 printf "#include <sys/font.h>\n\n"
98 printf "/* %s */\n", $
0;
106 $
1==
"FONTBOUNDINGBOX" {
108 byteswide = int
(($
2 + 7)/8);
113 $
1==
"STARTPROPERTIES" {
117 $
1==
"FONTNAME_REGISTRY" {
137 $
1==
"SETWIDTH_NAME" {
141 $
1==
"ADD_STYLE_NAME" {
163 if ($
2 != "\"C\"") printf "Unsupported format %s!\n",$
2;
167 $
1==
"AVERAGE_WIDTH" {
171 $
1==
"CHARSET_REGISTRY" {
175 $
1==
"CHARSET_ENCODING" {
195 printf "/* Copyright notice from .bdf file: */\n";
196 printf "/* %s */\n", $
0;
200 $
1==
"ENDPROPERTIES" {
211 printf "static unsigned char FONTDATA_%s[] = {\n", font
;
220 encoding
[$
2] = offset
;
224 if ($
2 >=
32 && $
2 < 127) printf "/* '%c' */\n", $
2;
225 else printf "/* 0x%2.2x */\n", $
2;
249 printf "static unsigned char *ENCODINGS_%s[256] = {\n", font
;
251 for (i =
0; i
< 256; i
++) {
252 if (encoding
[i
] ==
-1) encoding
[i
] = encoding
[default_char
];
253 printf "\tFONTDATA_%s+%d,\n", font
, encoding
[i
];
256 printf "bitmap_data_t font_data_%s = {\n", font
;
257 printf "\t%s, %s,\n", bitswide
, rows
;
258 printf "\tFONTDATA_%s,\n", font
;
259 printf "\tENCODINGS_%s\n", font
;
265 printf "?!? %s\n", $
0;