77main (
int argc,
char **argv)
85 char combining[0x110000];
86 char x_offset [0x110000];
105 memset (combining, 0, 0x110000 *
sizeof (
char));
106 memset (x_offset , 0, 0x110000 *
sizeof (
char));
108 if ((infilefp = fopen (argv[1],
"r")) == NULL) {
109 fprintf (stderr,
"ERROR - combining characters file %s not found.\n\n",
115 while (fscanf (infilefp,
"%X:%d", &loc, &offset) != EOF) {
122 if (loc != 0x01107F && loc != 0x01D1A0) {
124 x_offset [loc] = offset;
130 if ((infilefp = fopen (argv[2],
"r")) == NULL) {
131 fprintf (stderr,
"ERROR - nonprinting characters file %s not found.\n\n",
137 while (fscanf (infilefp,
"%X:%*s", &loc) != EOF) combining[loc] = 0;
145 while (fgets (teststring,
MAXSTRING-1, stdin) != NULL) {
146 sscanf (teststring,
"%X", &loc);
147 gstart = strchr (teststring,
':') + 1;
148 if (combining[loc]) {
149 if (strlen (gstart) < 35)
154 printf (
"%s", teststring);
172 char circle[32]={0x0,0x0,
194 for (i = 0; i < 32; i++) {
195 glyphstring[i] = toupper (glyphstring[i]);
198 digit1 = (glyphstring[i] <=
'9') ?
199 (glyphstring[i] -
'0') : (glyphstring[i] -
'A' + 0xA);
202 digit2 = digit1 | circle[i];
205 newstring[i] = (digit2 <= 9) ?
206 (
'0' + digit2) : (
'A' + digit2 - 0xA);
210 newstring[i++] =
'\n';
211 newstring[i++] =
'\0';
213 memcpy (glyphstring, newstring, i);
233 char circle08[64]={0x0,0x0,0x0,0x0,
252 char circle16[64]={0x0,0x0,0x0,0x0,
280 circle = (offset >= -8) ? circle08 : circle16;
283 for (i = 0; i < 64; i++) {
284 glyphstring[i] = toupper (glyphstring[i]);
287 digit1 = (glyphstring[i] <=
'9') ?
288 (glyphstring[i] -
'0') : (glyphstring[i] -
'A' + 0xA);
291 digit2 = digit1 | circle[i];
294 newstring[i] = (digit2 <= 9) ?
295 (
'0' + digit2) : (
'A' + digit2 - 0xA);
299 newstring[i++] =
'\n';
300 newstring[i++] =
'\0';
302 memcpy (glyphstring, newstring, i);
int main(void)
The main function.
void add_double_circle(char *glyphstring, int offset)
Superimpose a double-width dashed combining circle on a glyph bitmap.
#define MAXSTRING
Maximum input line length - 1.
void add_single_circle(char *glyphstring)
Superimpose a single-width dashed combining circle on a glyph bitmap.