Changeset 38986 for trunk/Ohana/src/libkapa/rotfont/fixfont.c
- Timestamp:
- Oct 27, 2015, 4:49:06 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/libkapa/rotfont (modified) (1 prop)
-
src/libkapa/rotfont/fixfont.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ipp-20150625/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/libkapa/rotfont
- Property svn:ignore
-
old new 1 1 fixfont 2 fontsize.ps 3 courier.12.psx 4 courier.14.psx 5 courier.18.psx 6 courier.24.psx 7 courier.8.psx 8 helvetica.12.psx 9 helvetica.14.psx 10 helvetica.18.psx 11 helvetica.24.psx 12 helvetica.8.psx 13 symbol.12.psx 14 symbol.14.psx 15 symbol.18.psx 16 symbol.24.psx 17 symbol.8.psx 18 times.12.psx 19 times.14.psx 20 times.18.psx 21 times.24.psx 22 times.8.psx 23 courier12.h 24 courier14.h 25 courier18.h 26 courier24.h 27 courier8.h 28 helvetica12.h 29 helvetica14.h 30 helvetica18.h 31 helvetica24.h 32 helvetica8.h 33 symbol12.h 34 symbol14.h 35 symbol18.h 36 symbol24.h 37 symbol8.h 38 times12.h 39 times14.h 40 times18.h 41 times24.h 42 times8.h
-
- Property svn:ignore
-
trunk/Ohana/src/libkapa/rotfont/fixfont.c
r5854 r38986 1 1 # include <stdio.h> 2 2 # include <math.h> 3 # include <stdlib.h> 4 # include <string.h> 3 5 # define TRUE 1 4 6 # define FALSE 0 … … 24 26 25 27 typedef struct { 26 int dx, dy, ascent, Nb; 28 int dx; 29 int dy; 30 float dXps; 31 int ascent; 32 int Nb; 27 33 unsigned char *bits; 28 34 char name[64]; … … 32 38 int scan_line (FILE *f, char *line); 33 39 34 main (int argc, char **argv) {40 int main (int argc, char **argv) { 35 41 36 42 int BitMap, Nvalue, code; … … 43 49 FILE *f; 44 50 45 if (argc != 3) {46 fprintf (stderr, "USAGE: fixfont (file.bdf) ( name)\n");51 if (argc != 4) { 52 fprintf (stderr, "USAGE: fixfont (file.bdf) (file.psx) (name)\n"); 47 53 exit (0); 48 54 } 49 55 50 f = fopen (argv[1], "r"); 56 char *bdfname = argv[1]; 57 char *psxname = argv[2]; 58 char *fontname = argv[3]; 59 60 // read in the PS sizes first 61 f = fopen (psxname, "r"); 51 62 if (f == (FILE *) NULL) { 52 fprintf (stderr, "failed to open file %s\n", argv[1]); 63 fprintf (stderr, "failed to open file %s\n", psxname); 64 exit (0); 65 } 66 67 while (scan_line (f, buffer) != EOF) { 68 int N; 69 float dXps; 70 int Nread = sscanf (buffer, "%d %f", &N, &dXps); 71 if (Nread != 2) continue; 72 if (N < 1) continue; 73 if (N > 255) continue; 74 font[N].dXps = dXps; 75 } 76 fclose (f); 77 78 f = fopen (bdfname, "r"); 79 if (f == (FILE *) NULL) { 80 fprintf (stderr, "failed to open file %s\n", bdfname); 53 81 exit (0); 54 82 } … … 112 140 strcpy (font[i].name, "blank"); 113 141 } 114 fprintf (stdout, "static unsigned char %s_%d_bits[] = {", argv[2], i);142 fprintf (stdout, "static unsigned char %s_%d_bits[] = {", fontname, i); 115 143 for (j = 0; j < font[i].Nb; j++) { 116 144 if (!(j % 12)) fprintf (stdout, "\n"); … … 121 149 } 122 150 123 fprintf (stdout, "static RotFont %sfont[] = {\n", argv[2]);151 fprintf (stdout, "static RotFont %sfont[] = {\n", fontname); 124 152 for (i = 0; i < 255; i++) { 125 fprintf (stdout, "{% d, %d, %d, %s_%d_bits},\n",126 font[i].dx, font[i].dy, font[i]. ascent, argv[2], i);127 } 128 fprintf (stdout, "{% d, %d, %d, %s_%d_bits}};\n",129 font[i].dx, font[i].dy, font[i]. ascent, argv[2], i);153 fprintf (stdout, "{%3d, %3d, %5.2f, %3d, %s_%d_bits},\n", 154 font[i].dx, font[i].dy, font[i].dXps, font[i].ascent, fontname, i); 155 } 156 fprintf (stdout, "{%3d, %3d, %5.2f, %3d, %s_%d_bits}};\n", 157 font[i].dx, font[i].dy, font[i].dXps, font[i].ascent, fontname, i); 130 158 131 159 160 exit (0); 132 161 } 133 162 … … 178 207 179 208 } 180
Note:
See TracChangeset
for help on using the changeset viewer.
