annotate TOOLS/mpfc/mpfc-kr.c @ 13834:c22e2b883891

Typo, found by Nico Sabbi
author rtognimp
date Sun, 31 Oct 2004 22:12:45 +0000
parents be5942e385e5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1155
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
1 /*
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
2
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
3 mplayer font creator for korean(euc-kr) charset
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
4
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
5 This program uses gd & freetype2 library to draw each characters then
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
6 write the image to stdout.
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
7
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
8 Written by Sunjin Yang <lethean@realtime.ssu.ac.kr> May 03, 2001.
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
9
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
10 */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
11
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
12 #include <gd.h>
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
13 #include <stdio.h>
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
14 #include <string.h>
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
15 #include <errno.h>
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
16
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
17 #define DEF_FONT_SIZE 16.0
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
18
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
19 #define DEF_CHAR_GAP 6
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
20 #define CHAR_SKIP(gap) (gap / 4)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
21
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
22 #define AUTHOR "Sunjin Yang <lethean@realtime.ssu.ac.kr>"
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
23 #define VERSION "0.1"
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
24
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
25 struct code_range {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
26 int start, end;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
27 };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
28
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
29 /* basic alphabet character range */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
30 static struct code_range ascii_range = { 0x21, 0x7E };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
31
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
32 #ifdef USE_UNIFIED_KOREAN
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
33
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
34 /* Unified Hangul Code Encoding */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
35 static struct code_range first_byte_range[] = {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
36 { 0x81, 0xFE }, { 0, 0 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
37 };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
38 static struct code_range second_byte_range[] = {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
39 { 0x41, 0x5A }, { 0x61, 0x7A }, { 0x81, 0x9F }, { 0xA0, 0xBF },
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
40 { 0xC0, 0xDF }, { 0xE0, 0xFE }, { 0, 0 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
41 };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
42
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
43 #else
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
44
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
45 /* KSX 1001:1992 */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
46 static struct code_range first_byte_range[] = {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
47 { 0xA1, 0xAC }, { 0xB0, 0xFD }, { 0, 0 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
48 };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
49 static struct code_range second_byte_range[] = {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
50 { 0xA1, 0xAF }, { 0xB0, 0xBF }, { 0xC0, 0xCF }, { 0xD0, 0xDF },
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
51 { 0xE0, 0xEF }, { 0xF0, 0xFE }, { 0, 0 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
52 };
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
53
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
54 #endif
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
55
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
56 #define _output(msg...) fprintf(stdout, ##msg)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
57
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
58 /* debugging macros */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
59 #define _print(msg...) fprintf(stderr, ##msg)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
60 #define _info(msg...) { _print("mpfc: "); _print(##msg); _print("\n"); }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
61 #define _abort(msg...) { _info(##msg); exit(1); }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
62
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
63 static double size;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
64 static int gap;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
65 static char *name, *font, *eng_font, *kor_font;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
66 static int file_index;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
67 static char filename[20], str[10];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
68
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
69 static int base_x, char_count;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
70 static gdImagePtr char_image[65536];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
71
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
72 static gdImagePtr concat_char_images(void)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
73 {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
74 gdImagePtr ret;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
75 int width, height, i, black, white;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
76
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
77 /* get image's width & height */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
78 height = size + (gap * 2);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
79 for (width = 0, i = 0; i < char_count; i++)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
80 width += char_image[i]->sx;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
81
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
82 ret = gdImageCreate(width, height);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
83
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
84 /* background color (first allocated) */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
85 black = gdImageColorResolve(ret, 0, 0, 0);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
86 white = gdImageColorResolve(ret, 255, 255, 255);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
87
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
88 width = 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
89 for (i = 0; i < char_count; i++) {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
90 gdImageCopy(ret, char_image[i], /* dst, src */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
91 width + 0, 0, /* dstX, dstY */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
92 0, 0, /* srcX, srcY */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
93 char_image[i]->sx, char_image[i]->sy); /* size */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
94 width += char_image[i]->sx;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
95 gdImageDestroy(char_image[i]);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
96 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
97 char_count = 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
98
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
99 return ret;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
100 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
101
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
102 static gdImagePtr create_char_image(char *s)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
103 {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
104 gdImagePtr im;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
105 int rect[8], black, white, width, height, x, y;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
106 char *err;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
107
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
108 /* obtain border rectangle so that we can size the image. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
109 err = gdImageStringTTF(NULL, &rect[0], 0, font, size, .0, 0, 0, s);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
110 if (err)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
111 _abort("%s\n", err);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
112
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
113 /* create an image big enough for a string plus a little whitespace. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
114 width = rect[2] - rect[6] + gap;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
115 height = size + (gap * 2);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
116 im = gdImageCreate(width, height);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
117
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
118 /* background color (first allocated) */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
119 black = gdImageColorResolve(im, 0, 0, 0);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
120 white = gdImageColorResolve(im, 255, 255, 255);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
121
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
122 /* render the string, offset origin to center string.
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
123 note that we use top-left coordinate for adjustment
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
124 since gd origin is in top-left with y increasing downwards. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
125 x = (gap / 2) - rect[6];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
126 y = (gap / 2) - rect[7] + (size + rect[7]);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
127 err = gdImageStringTTF(im, &rect[0], white, font, size, .0, x, y, s);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
128 if (err)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
129 _abort("%s\n", err);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
130
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
131 if (*s == '"') _output("'%s' ", s); else _output("\"%s\" ", s);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
132 _output("%d %d\n",
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
133 base_x + CHAR_SKIP(gap), base_x + width - CHAR_SKIP(gap) - 1);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
134 base_x += width;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
135
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
136 return im;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
137 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
138
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
139 void make_charset_font(struct code_range *first, struct code_range *second)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
140 {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
141 gdImagePtr im;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
142 FILE *fd;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
143 int i, j;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
144
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
145 base_x = 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
146 char_count = 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
147
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
148 _output("[files]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
149 //_output("alpha %s%d_a.raw\n", name, file_index);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
150 _output("alpha %s%02d_b.raw\n", name, file_index);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
151 _output("bitmap %s%02d_b.raw\n\n", name, file_index);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
152 _output("[characters]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
153
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
154 for (i = first->start; i <= first->end; i++) {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
155 str[0] = (char)i;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
156 if (!second) {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
157 str[1] = '\0';
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
158 char_image[char_count++] = create_char_image(str);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
159 } else
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
160 for (j = second->start; j <= second->end; j++) {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
161 str[1] = (char)j; str[2] = '\0';
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
162 char_image[char_count++]= create_char_image(str);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
163 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
164 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
165
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
166 _output("\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
167
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
168 /* concatenate each character images into one image. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
169 im = concat_char_images();
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
170
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
171 /* get filename and create one with it. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
172 sprintf(filename, "%s%02d_b.png", name, file_index++);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
173 fd = fopen(filename, "w+");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
174 if (!fd)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
175 _abort(strerror(errno));
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
176
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
177 /* write image to the PNG file. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
178 gdImagePng(im, fd);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
179
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
180 fclose(fd);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
181
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
182 /* destroy it */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
183 gdImageDestroy(im);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
184 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
185
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
186 int main(int argc, char **argv)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
187 {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
188 int i, j;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
189
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
190 if (argc < 4)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
191 _abort("usage:%s name eng-ttf kor-ttf [size gap]",argv[0]);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
192
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
193 /* get program parameter like font names, size... */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
194 name = argv[1];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
195 eng_font = argv[2];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
196 kor_font = argv[3];
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
197 size = DEF_FONT_SIZE;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
198 gap = DEF_CHAR_GAP;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
199 if (argc > 4) {
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
200 float __s; sscanf(argv[4], "%f", &__s);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
201 size = (double)__s;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
202 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
203 if (argc > 5)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
204 sscanf(argv[5], "%d", &gap);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
205
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
206 /* write basic font information. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
207 _output("[info]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
208 _output("name \"%s version %s - created by %s\"\n",
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
209 name, VERSION, AUTHOR);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
210 _output("descversion 1\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
211 _output("spacewidth %d\n", (int)(size / 2));
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
212 _output("charspace -%d\n", CHAR_SKIP(gap) + 1);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
213 _output("height %d\n\n", (int)size + DEF_CHAR_GAP);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
214
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
215 /* write general OSD fonts information. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
216 _output("[files]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
217 _output("alpha arpi_osd_a.raw\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
218 _output("bitmap arpi_osd_b.raw\n\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
219 _output("[characters]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
220 _output("0x01 0 36\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
221 _output("0x02 35 71\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
222 _output("0x03 70 106\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
223 _output("0x04 116 152\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
224 _output("0x05 164 200\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
225 _output("0x06 209 245\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
226 _output("0x07 256 292\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
227 _output("0x08 305 342\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
228 _output("0x09 354 400\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
229 _output("0x0A 407 442\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
230 _output("0x0B 457 494\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
231 _output("[files]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
232 _output("alpha arpi_progress_a.raw\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
233 _output("bitmap arpi_progress_b.raw\n\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
234 _output("[characters]\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
235 _output("0x10 4 21\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
236 _output("0x11 30 41\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
237 _output("0x12 50 66\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
238 _output("0x13 74 85\n\n");
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
239
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
240
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
241 file_index = 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
242
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
243 /* create basic alphabet character set. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
244 font = eng_font;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
245 make_charset_font(&ascii_range, NULL);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
246
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
247 /* create korean character set. */
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
248 font = kor_font;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
249 for (i = 0; first_byte_range[i].start != 0; i++)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
250 for (j = 0; second_byte_range[j].start != 0; j++)
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
251 make_charset_font(&first_byte_range[i], &second_byte_range[j]);
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
252
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
253 return 0;
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
254 }
be5942e385e5 original and CE version of mpfc
arpi_esp
parents:
diff changeset
255