ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
fontx.c
Go to the documentation of this file.
1 #include <draw.h>
2 #include <draw3d.h>
3 
4 #include <gif_tags.h>
5 #include <gs_gp.h>
6 
7 #include <stdio.h>
8 #include <malloc.h>
9 #include <sys/fcntl.h>
10 #include <string.h>
11 
12 #include <fcntl.h>
13 #include <unistd.h>
14 
15 #include <font.h>
16 
17 // Single byte fonts have only a single table whose offset starts after type.
18 typedef struct {
20  char id[7];
22  char name[9];
24  unsigned char width;
26  unsigned char height;
28  unsigned char type;
29  // Single-byte font headers end here
31  unsigned char table_num;
32  struct {
34  unsigned short start;
36  unsigned short end;
37  } block[];
38 } fontx_hdr;
39 
40 static prim_t charprim =
41 {
45 };
46 
47 // These are the SJIS table ranges for character lookup
48 unsigned short sjis_table[] = {
49 0x8140,0x817e,
50 0x8180,0x81ac,
51 0x81b8,0x81bf,
52 0x81c8,0x81ce,
53 0x81da,0x81e8,
54 0x81f0,0x81f7,
55 0x81fc,0x81fc,
56 0x824f,0x8258,
57 0x8260,0x8279,
58 0x8281,0x829a,
59 0x829f,0x82f1,
60 0x8340,0x837e,
61 0x8380,0x8396,
62 0x839f,0x83b6,
63 0x83bf,0x83d6,
64 0x8440,0x8460,
65 0x8470,0x847e,
66 0x8480,0x8491,
67 0x849f,0x84be,
68 0x889f,0x88fc,
69 0x8940,0x897e,
70 0x8980,0x89fc,
71 0x8a40,0x8a7e,
72 0x8a80,0x8afc,
73 0x8b40,0x8b7e,
74 0x8b80,0x8bfc,
75 0x8c40,0x8c7e,
76 0x8c80,0x8cfc,
77 0x8d40,0x8d7e,
78 0x8d80,0x8dfc,
79 0x8e40,0x8e7e,
80 0x8e80,0x8efc,
81 0x8f40,0x8f7e,
82 0x8f80,0x8ffc,
83 0x9040,0x907e,
84 0x9080,0x90fc,
85 0x9140,0x917e,
86 0x9180,0x91fc,
87 0x9240,0x927e,
88 0x9280,0x92fc,
89 0x9340,0x937e,
90 0x9380,0x93fc,
91 0x9440,0x947e,
92 0x9480,0x94fc,
93 0x9540,0x957e,
94 0x9580,0x95fc,
95 0x9640,0x967e,
96 0x9680,0x96fc,
97 0x9740,0x977e,
98 0x9780,0x97fc,
99 0x9840,0x9872
100 };
101 
103 {
104 
105  fontx_hdr *fontx_header;
106 
107  int header_size = 17;
108  int char_size = 15;
109 
110  int fd = 0;
111  int size;
112 
113  fd = open("rom0:KROM", O_RDONLY);
114 
115  if (fd < 0)
116  {
117 
118  printf("Error opening KROM font.\n");
119  return -1;
120 
121  }
122 
123  // header without table pointer + size of a character * 256 characters
124  size = header_size + char_size * 256;
125 
126  fontx->font = (char*)malloc(size);
127 
128  if (fontx->font == NULL)
129  {
130 
131  printf("Error allocating %d bytes of memory.\n", size);
132  close(fd);
133 
134  return -1;
135  }
136 
137  // Clear the memory
138  memset(fontx->font,0,size);
139 
140  // The offset for the ASCII characters
141  lseek(fd, 0x198DE, SEEK_SET);
142 
143  // 17 bytes of header and 15 bytes per 33 characters
144  // Read in 95 characters
145  if (read(fd,fontx->font + header_size+char_size*33, char_size*95) < 0)
146  {
147 
148  printf("Error reading rom0:KROM.\n");
149 
150  free(fontx->font);
151  close(fd);
152 
153  return -1;
154 
155  }
156 
157  close(fd);
158 
159  fontx_header = (fontx_hdr*)fontx->font;
160 
161  // define header as single-byte font
162  strncpy(fontx_header->id, "FONTX2", 6);
163  fontx_header->id[6] = '\0';
164  strncpy(fontx_header->name, "KROM", 8);
165  fontx_header->name[8] = '\0';
166 
167  fontx_header->width = 8;
168  fontx_header->height = 15;
169  fontx_header->type = SINGLE_BYTE;
170 
171  // Save it as a font
172  //fd=open("host:KROM_ascii.fnt",O_WRONLY | O_TRUNC | O_CREAT);
173  //write(fd, fontx->font, size);
174  //close(fd);
175 
176  return 0;
177 
178 }
179 
181 {
182 
183  fontx_hdr *fontx_header;
184 
185  int size;
186  int fd = 0;
187 
188  // Font characteristics for double-byte font
189  int header_size = 18;
190  int table_num = 51;
191  int table_size = 4;
192  int char_size = 30;
193  int char_num = 3489;
194 
195  fd = open("rom0:KROM", O_RDONLY);
196 
197  if (fd < 0)
198  {
199 
200  printf("Error opening KROM font.\n");
201 
202  }
203 
204  size = header_size + table_num*table_size + char_num*char_size;
205 
206  fontx->font = (char*)malloc(size);
207 
208  if (fontx->font == NULL)
209  {
210 
211  printf("Error allocating memory.\n");
212  close(fd);
213 
214  return -1;
215  }
216 
217  // Clear memory
218  memset(fontx->font,0,size);
219 
220  // Make sure we're at the beginning
221  lseek(fd, 0, SEEK_SET);
222 
223  // Read in 95 characters
224  if (read(fd, fontx->font+header_size+table_num*table_size, char_size*char_num) < 0)
225  {
226 
227  printf("Error reading font.\n");
228  free(fontx->font);
229  close(fd);
230 
231  return -1;
232 
233  }
234 
235  close(fd);
236 
237  fontx_header = (fontx_hdr*)fontx->font;
238 
239  // define the header as double-byte font
240  strncpy(fontx_header->id, "FONTX2", 6);
241  fontx_header->id[6] = '\0';
242  strncpy(fontx_header->name, "KROM", 8);
243  fontx_header->name[8] = '\0';
244 
245  fontx_header->width = 16;
246  fontx_header->height = 15;
247  fontx_header->type = DOUBLE_BYTE;
248  fontx_header->table_num = table_num;
249 
250  // Add the SJIS tables to the font
251  memcpy(fontx->font+header_size,sjis_table,table_num*table_size);
252 
253  // Save it as a font
254  //fd=open("host:KROM_kanji.fnt",O_WRONLY | O_TRUNC | O_CREAT);
255  //write(fd, fontx->font, size);
256  //close(fd);
257 
258  return 0;
259 
260 }
261 
262 int fontx_load(const char *path, fontx_t* fontx, int type, int wmargin, int hmargin, int bold)
263 {
264 
265  FILE *file = NULL;
266 
267  int ret = -1;
268  long size = 0;
269 
270  fontx_hdr *fontx_header = NULL;
271 
272  if (!strcmp("rom0:KROM",path) || !strcmp("rom0:/KROM",path))
273  {
274 
275  if (type == SINGLE_BYTE)
276  {
277 
278  ret = fontx_load_single_krom(fontx);
279 
280  }
281  else
282  {
283 
284  ret = fontx_load_double_krom(fontx);
285 
286  }
287 
288  if (ret < 0)
289  {
290 
291  printf("Error opening %s\n", path);
292  return -1;
293 
294  }
295 
296  }
297 
298  else
299  {
300 
301  file = fopen(path, "r");
302 
303  if (file == NULL)
304  {
305 
306  printf("Error opening %s\n", path);
307  return -1;
308 
309  }
310 
311  // get size of file
312  fseek(file, 0, SEEK_END);
313  size = ftell(file);
314  fseek(file, 0, SEEK_SET);
315 
316  fontx->font = (char *)malloc(size);
317 
318  if (fontx->font == NULL)
319  {
320 
321  printf("Error allocating %ld bytes of memory.\n", size);
322  fclose(file);
323  return -1;
324 
325  }
326 
327  fread(fontx->font, size, 1, file);
328 
329  fclose(file);
330 
331  }
332 
333  fontx_header = (fontx_hdr*)fontx->font;
334 
335  if (strncmp(fontx_header->id, "FONTX2", 6) != 0)
336  {
337 
338  printf("Not FONTX2 type font!\n");
339  free(fontx->font);
340 
341  return -1;
342 
343  }
344 
345  if (fontx_header->type != type)
346  {
347 
348  printf("Type mismatch\n");
349  free(fontx->font);
350 
351  return -1;
352 
353  }
354 
355  // Fill in some information about the font
356  strcpy(fontx->name,fontx_header->name);
357 
358  fontx->rowsize = ((fontx_header->width+7)>>3);
359  fontx->charsize = fontx->rowsize * fontx_header->height;
360  fontx->w_margin = wmargin;
361  fontx->h_margin = hmargin;
362  fontx->bold = bold;
363 
364  // This is the offset that character data starts
365  if (fontx_header->type == SINGLE_BYTE)
366  {
367 
368  fontx->offset = 17;
369 
370  }
371  else
372  {
373 
374  // 17 + 1 + (number of tables * 4) bytes
375  fontx->offset = 18 + (fontx_header->table_num * 4);
376 
377  }
378 
379  return 0;
380 
381 }
382 
383 void fontx_unload(fontx_t *fontx)
384 {
385 
386  if (fontx->font != NULL)
387  {
388 
389  free(fontx->font);
390 
391  }
392 
393 }
394 
395 char *fontx_get_char(fontx_t* fontx, unsigned short c)
396 {
397 
398  unsigned int i;
399 
400  int table = -1;
401  int table_offset = 0;
402 
403  fontx_hdr *fontx_header;
404 
405  if (fontx->font == NULL)
406  {
407 
408  printf("Font data not loaded.\n");
409  return NULL;
410 
411  }
412 
413  fontx_header = (fontx_hdr*)fontx->font;
414 
415  if ((fontx_header->type == SINGLE_BYTE) && (c <= 0xFF))
416  {
417 
418  return (fontx->font + (fontx->offset + c * fontx->charsize));
419 
420  }
421 
422  for (i = 0; i < fontx_header->table_num; i++)
423  {
424 
425  if ((fontx_header->block[i].start <= c) && (fontx_header->block[i].end >= c))
426  {
427 
428  table = i;
429  break;
430 
431  }
432  }
433 
434  // If table not found
435  if (table < 0)
436  {
437 
438  return NULL;
439 
440  }
441 
442  for (i = 0; i < table; i++)
443  {
444 
445  table_offset += fontx_header->block[i].end - fontx_header->block[i].start;
446 
447  }
448 
449  table_offset = table_offset + table + ( c - fontx_header->block[table].start);
450 
451  return (fontx->font + (fontx->offset + table_offset*fontx->charsize));
452 
453 }
454 
455 // draws a single byte
456 u64 *draw_fontx_row(u64 *dw, unsigned char byte, int x, int y, int z, int bold)
457 {
458 
459  unsigned char mask = 0x80;
460 
461  int i;
462  int px = 0;
463 
464  // for each bit in a row
465  for (i=0;i<8;i++)
466  {
467 
468  // if there's a bit
469  if (byte & mask)
470  {
471 
472  *dw++ = GS_SET_XYZ((x+(i<<4)) + 32768,y+32768,z);
473  px = 1;
474 
475  }
476  else
477  {
478 
479  if (bold && px)
480  *dw++ = GS_SET_XYZ((x+(i<<4)) + 32768,y+32768,z);
481 
482  px = 0;
483 
484  }
485 
486  mask >>= 1;
487 
488  }
489 
490  // Add some boldness to the last pixel in a row
491  if (bold && px)
492  {
493 
494  *dw++ = GS_SET_XYZ((x+(i<<4)) + 32768,y+32768,z);
495 
496  }
497 
498  return dw;
499 
500 }
501 
502 qword_t *draw_fontx_char(qword_t *q, unsigned short c, vertex_t *v0, fontx_t *fontx)
503 {
504 
505  u64 pdw;
506  u64 *dw = (u64 *)q;
507 
508  char *char_offset;
509  int i, j;
510  int x,y,z;
511  int xi,yi;
512 
513  x = ftoi4(v0->x);
514  y = ftoi4(v0->y);
515  z = v0->z;
516 
517  fontx_hdr* fontx_header = (fontx_hdr*)fontx->font;
518 
519  char_offset = fontx_get_char(fontx,c);
520 
521  if (!char_offset)
522  {
523 
524  return q;
525 
526  }
527 
528  for (i=0;i<fontx_header->height;i++)
529  {
530 
531  // Increment one row down
532  yi = y + (i << 4);
533 
534  for (j=0;j < fontx->rowsize;j++)
535  {
536 
537  // Increment one row right
538  xi = x + (j << 7);
539  dw = draw_fontx_row(dw,char_offset[(i*fontx->rowsize) + j],xi,yi,z,fontx->bold);
540 
541  }
542 
543  }
544 
545  if ((u32)dw % 16)
546  {
547 
548  pdw = *(dw-1);
549  *dw++ = pdw;
550 
551  }
552 
553  q = (qword_t*)dw;
554 
555  return q;
556 
557 }
558 
559 qword_t *fontx_print_ascii(qword_t *q, int context, const unsigned char *str, int alignment, vertex_t *v0, color_t *c0, fontx_t *fontx)
560 {
561 
562  int i,j;
563 
564  fontx_hdr *fontx_header = (fontx_hdr*)fontx->font;
565 
566  vertex_t v_pos = *v0;
567 
568  int length = strlen((const char *)str);
569  short line_num[100];
570  int line = 0;
571 
572  float x_orig[100];
573  x_orig[0] = 0;
574 
575  float w = fontx_header->width;
576  float h = fontx_header->height;
577 
578  float wm = fontx->w_margin;
579  float hm = fontx->h_margin;
580 
581  // line_num is used to keep track of number of characters per line
582  line_num[0] = 0;
583 
584  switch (alignment)
585  {
586  default:
587  case LEFT_ALIGN:
588  {
589  for (i = 0; i < length; i++)
590  {
591 
592  while (str[i] == '\t' || str[i] == '\n')
593  {
594 
595  if(str[i] == '\n')
596  {
597  x_orig[line] = v_pos.x;
598  line++;
599  line_num[line] = 0;
600  }
601 
602  i++;
603 
604  }
605 
606 
607  if (i == length-1)
608  {
609  x_orig[line] = v_pos.x;
610  line++;
611  }
612 
613  }
614  break;
615 
616  }
617  case RIGHT_ALIGN:
618  {
619  for (i = 0; i < length; i++)
620  {
621 
622  while (str[i] == '\t' || str[i] == '\n')
623  {
624 
625  if (str[i] == '\t')
626  {
627  line_num[line] += 4;
628  }
629 
630  if (str[i] == '\n')
631  {
632  x_orig[line] = v_pos.x - (line_num[line] * (w + wm));
633  line++;
634  line_num[line] = 0;
635  }
636 
637  i++;
638 
639  }
640 
641 
642  line_num[line]++;
643 
644  if (i == length-1)
645  {
646  x_orig[line] = v_pos.x - (line_num[line] * (w + wm));
647  line++;
648  }
649 
650  }
651  break;
652 
653  }
654  case CENTER_ALIGN:
655  {
656  for (i = 0; i < length; i++)
657  {
658 
659  while (str[i] == '\t' || str[i] == '\n')
660  {
661 
662  if (str[i] == '\t')
663  {
664  line_num[line] += 4;
665  }
666 
667  if (str[i] == '\n')
668  {
669  x_orig[line] = v_pos.x - (line_num[line] * (w + wm))/2.0f;
670  line++;
671  line_num[line] = 0;
672  }
673 
674  i++;
675 
676  }
677 
678  line_num[line]++;
679 
680  if (i == length-1)
681  {
682  x_orig[line] = v_pos.x - (line_num[line] * (w + wm))/2.0f;
683  line++;
684  }
685 
686  }
687  break;
688 
689  }
690 
691  };
692 
693  line = 0;
694  v_pos.x = x_orig[0];
695 
696  q = draw_prim_start(q,context,&charprim,c0);
697 
698  for (j = 0; j < length; j++)
699  {
700 
701  while(str[j] == '\n' || str[j] == '\t')
702  {
703  if (str[j] == '\n')
704  {
705  line++;
706  v_pos.y += h + hm;
707  v_pos.x = x_orig[line];
708  }
709  if (str[j] == '\t')
710  {
711  v_pos.x += w * 5.0f;
712  }
713  j++;
714  }
715 
716  if (str[j] < 0x80)
717  {
718  q = draw_fontx_char(q,str[j],&v_pos,fontx);
719  }
720  else if (str[j] >= 0xA1 && str[j] <= 0xDF)
721  {
722  q = draw_fontx_char(q,str[j],&v_pos,fontx);
723  }
724 
725  v_pos.x += w + wm;
726 
727  }
728 
730 
731  return q;
732 
733 }
734 
735 qword_t *fontx_print_sjis(qword_t *q, int context, const unsigned char *str, int alignment, vertex_t *v0, color_t *c0, fontx_t *ascii, fontx_t *kanji)
736 {
737 
738  int i,j;
739 
740  fontx_hdr *ascii_header = (fontx_hdr*)ascii->font;
741  fontx_hdr *kanji_header = (fontx_hdr*)kanji->font;
742 
743  vertex_t v_pos = *v0;
744 
745  int length = strlen((const char *)str);
746 
747  int line = 0;
748  short halfwidth[100];
749  short fullwidth[100];
750  float x_orig[100];
751  x_orig[0] = 0;
752 
753  unsigned short wide;
754 
755  float hw = ascii_header->width;
756 
757  float fw = kanji_header->width;
758  float h = kanji_header->height;
759 
760  float wm = kanji->w_margin;
761  float hm = kanji->h_margin;
762 
763  // line_num is used to keep track of number of characters per line
764  halfwidth[0] = 0;
765  fullwidth[0] = 0;
766 
767  switch (alignment)
768  {
769  default:
770  case LEFT_ALIGN:
771  {
772  for (i = 0; i < length; i++)
773  {
774 
775  while (str[i] == '\t'|| str[i] == '\n')
776  {
777  if (str[i] == '\t')
778  {
779  halfwidth[line] += 4;
780  }
781  if (str[i] == '\n')
782  {
783  x_orig[line] = v_pos.x;
784  line++;
785  halfwidth[line] = 0;
786  fullwidth[line] = 0;
787  }
788  i++;
789  }
790 
791 
792  if (i == length-1)
793  {
794  x_orig[line] = v_pos.x;
795  line++;
796  }
797 
798  }
799  break;
800 
801  }
802  case RIGHT_ALIGN:
803  {
804  for (i = 0; i < length; i++)
805  {
806 
807  while (str[i] == '\t'|| str[i] == '\n')
808  {
809  if (str[i] == '\t')
810  {
811  halfwidth[line] += 4;
812  }
813  if (str[i] == '\n')
814  {
815  x_orig[line] = v_pos.x - ((halfwidth[line] * (hw+wm)) + (fullwidth[line] * (fw + wm)));;
816  line++;
817  halfwidth[line] = 0;
818  fullwidth[line] = 0;
819  }
820  i++;
821  }
822 
823  if (str[i] < 0x80)
824  {
825  halfwidth[line]++;
826  }
827  else if (str[i] >= 0xA1 && str[i] <= 0xDF)
828  {
829  halfwidth[line]++;
830  }
831  else if (str[i] >= 0x81 && str[i] <= 0x9F)
832  {
833  fullwidth[line]++;
834  }
835  else if (str[i] >= 0xE0 && str[i] <= 0xEF)
836  {
837  fullwidth[line]++;
838  }
839 
840  if (i == length-1)
841  {
842  x_orig[line] = v_pos.x - ((halfwidth[line] * (hw+wm)) + (fullwidth[line] * (fw + wm)));
843  line++;
844  }
845 
846  }
847  break;
848 
849  }
850  case CENTER_ALIGN:
851  {
852  for (i = 0; i < length; i++)
853  {
854 
855  while (str[i] == '\t'|| str[i] == '\n')
856  {
857  if (str[i] == '\t')
858  {
859  halfwidth[line] += 4;
860  }
861  if (str[i] == '\n')
862  {
863  x_orig[line] = v_pos.x - ((halfwidth[line] * (hw+wm)) + (fullwidth[line] * (fw + wm)))/2.0f;
864  line++;
865  halfwidth[line] = 0;
866  fullwidth[line] = 0;
867  }
868  i++;
869  }
870 
871  if (str[i] < 0x80)
872  {
873  halfwidth[line]++;
874  }
875  else if (str[i] >= 0xA1 && str[i] <= 0xDF)
876  {
877  halfwidth[line]++;
878  }
879  else if (str[i] >= 0x81 && str[i] <= 0x9F)
880  {
881  fullwidth[line]++;
882  }
883  else if (str[i] >= 0xE0 && str[i] <= 0xEF)
884  {
885  fullwidth[line]++;
886  }
887 
888  if (i == length-1)
889  {
890  x_orig[line] = v_pos.x - ((halfwidth[line] * (hw+wm)) + (fullwidth[line] * (fw + wm)))/2.0f;
891  line++;
892  }
893 
894  }
895  break;
896 
897  }
898 
899  };
900 
901  line = 0;
902  v_pos.x = x_orig[0];
903 
904  q = draw_prim_start(q,context,&charprim,c0);
905 
906  for (j = 0; j < length; j++)
907  {
908 
909  wide = 0;
910 
911  while(str[j] == '\n' || str[j] == '\t')
912  {
913  if (str[j] == '\n')
914  {
915  line++;
916  v_pos.y += h + hm;
917  v_pos.x = x_orig[line];
918  }
919  if (str[j] == '\t')
920  {
921  v_pos.x += hw * 5.0f;
922  }
923  j++;
924  }
925 
926  if (str[j] < 0x80)
927  {
928  q = draw_fontx_char(q,str[j],&v_pos,ascii);
929  v_pos.x += hw + wm;
930  }
931  else if (str[j] >= 0xA1 && str[j] <= 0xDF)
932  {
933  q = draw_fontx_char(q,str[j],&v_pos,ascii);
934  v_pos.x += hw + wm;
935  }
936  else if (str[j] >= 0x81 && str[j] <= 0x9F)
937  {
938  wide = str[j++]<<8;
939  wide += str[j];
940  q = draw_fontx_char(q,wide,&v_pos,kanji);
941  v_pos.x += fw + wm;
942  }
943  else if (str[j] >= 0xE0 && str[j] <= 0xEF)
944  {
945  wide = str[j++]<<8;
946  wide += str[j];
947  q = draw_fontx_char(q,wide,&v_pos,kanji);
948  v_pos.x += fw + wm;
949  }
950  else
951  {
952  v_pos.x += fw + wm;
953  }
954 
955  }
956 
958 
959  return q;
960 
961 }
#define v0
Definition: as_reg_compat.h:35
#define DRAW_XYZ_REGLIST
Definition: draw3d.h:16
qword_t * draw_prim_start(qword_t *q, int context, prim_t *prim, color_t *color)
Definition: draw3d.c:11
qword_t * draw_prim_end(qword_t *q, int nreg, u64 reglist)
Definition: draw3d.c:33
u8 context
Definition: main.c:71
#define DRAW_ENABLE
Definition: draw.h:25
#define DRAW_DISABLE
Definition: draw.h:24
#define PRIM_UNFIXED
#define PRIM_POINT
#define PRIM_MAP_ST
#define PRIM_SHADE_FLAT
#define ftoi4(F)
Definition: draw_types.h:15
#define RIGHT_ALIGN
Definition: font.h:62
#define LEFT_ALIGN
Definition: font.h:60
#define CENTER_ALIGN
Definition: font.h:61
#define DOUBLE_BYTE
Definition: font.h:14
#define SINGLE_BYTE
Definition: font.h:13
void fontx_unload(fontx_t *fontx)
Definition: fontx.c:383
int fontx_load(const char *path, fontx_t *fontx, int type, int wmargin, int hmargin, int bold)
Definition: fontx.c:262
int fontx_load_single_krom(fontx_t *fontx)
Definition: fontx.c:102
unsigned short sjis_table[]
Definition: fontx.c:48
qword_t * fontx_print_ascii(qword_t *q, int context, const unsigned char *str, int alignment, vertex_t *v0, color_t *c0, fontx_t *fontx)
Definition: fontx.c:559
static prim_t charprim
Definition: fontx.c:40
char * fontx_get_char(fontx_t *fontx, unsigned short c)
Definition: fontx.c:395
u64 * draw_fontx_row(u64 *dw, unsigned char byte, int x, int y, int z, int bold)
Definition: fontx.c:456
qword_t * draw_fontx_char(qword_t *q, unsigned short c, vertex_t *v0, fontx_t *fontx)
Definition: fontx.c:502
qword_t * fontx_print_sjis(qword_t *q, int context, const unsigned char *str, int alignment, vertex_t *v0, color_t *c0, fontx_t *ascii, fontx_t *kanji)
Definition: fontx.c:735
int fontx_load_double_krom(fontx_t *fontx)
Definition: fontx.c:180
#define GS_SET_XYZ(X, Y, Z)
Definition: gs_gp.h:326
s32 x
Definition: libmouse.c:34
s32 y
Definition: libmouse.c:34
unsigned char width
Definition: fontx.c:24
unsigned char height
Definition: fontx.c:26
unsigned char table_num
Definition: fontx.c:31
unsigned short end
Definition: fontx.c:36
unsigned short start
Definition: fontx.c:34
char id[7]
Definition: fontx.c:20
char name[9]
Definition: fontx.c:22
struct fontx_hdr::@15 block[]
unsigned char type
Definition: fontx.c:28
Definition: font.h:16
int offset
Definition: font.h:30
int charsize
Definition: font.h:28
char * font
Definition: font.h:32
char bold
Definition: font.h:20
char name[9]
Definition: font.h:18
int rowsize
Definition: font.h:26
char w_margin
Definition: font.h:22
char h_margin
Definition: font.h:24
float y
Definition: draw_types.h:53
float x
Definition: draw_types.h:52
#define NULL
Definition: tamtypes.h:91
unsigned int u32
Definition: tamtypes.h:30
unsigned long u64
Definition: tamtypes.h:34