1 /**
2 ** BCC2GRX - Interfacing Borland based graphics programs to LIBGRX
3 ** Copyright (C) 1993-97 by Hartmut Schirmer
4 **
5 **
6 ** Contact : Hartmut Schirmer
7 ** Feldstrasse 118
8 ** D-24105 Kiel
9 ** Germany
10 **
11 ** e-mail : hsc@techfak.uni-kiel.de
12 **
13 ** This file is part of the GRX graphics library.
14 **
15 ** The GRX graphics library is free software; you can redistribute it
16 ** and/or modify it under some conditions; see the "copying.grx" file
17 ** for details.
18 **
19 ** This library is distributed in the hope that it will be useful,
20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 **
23 **/
24
25 #include "text.h"
26
27 CharInfo *fntptr = NULL;
28 char *StdFonts[BOLD_FONT+1] = {
29 "", "TRIP.CHR", "LITT.CHR", "SANS.CHR", "GOTH.CHR", "SCRI.CHR",
30 "SIMP.CHR", "TSCR.CHR", "LCOM.CHR", "EURO.CHR", "BOLD.CHR" };
31
32 int __gr_text_height;
33 int __gr_text_multx, __gr_text_divx,
34 __gr_text_multy, __gr_text_divy;
35 int __gr_text_usr_multx=1, __gr_text_usr_divx=1,
36 __gr_text_usr_multy=1, __gr_text_usr_divy=1;
37
38 void *Fonts[NrFonts];
39 struct textsettingstype __gr_text_setting;
40 GrTextOption Style;
41
42 #ifdef GRX_VERSION
43 GrFont *DefaultFonts[11];
44 #endif
45
46
__gr_text_init(void)47 void __gr_text_init(void)
48 {
49 static int Init = FALSE;
50 int i;
51
52 if (Init) return;
53 for (i=0; i < NrFonts; ++i)
54 Fonts[i] = NULL;
55
56 #ifdef GRX_VERSION
57 for (i=2; i < sizeof(DefaultFonts)/sizeof(GrFont *); ++i)
58 DefaultFonts[i] = NULL;
59 Fonts[DEFAULT_FONT] =
60 DefaultFonts[0] =
61 DefaultFonts[1] =
62 #ifdef LOAD_8x8_FONT
63 Fonts[DEFAULT_FONT] = (void *) GrLoadFont("pc8x8.fnt");
64 #else
65 &GrFont_PC8x8;
66 #endif
67 #else
68 Fonts[DEFAULT_FONT] = (void *) GrLoadFont("@:pc8x8.fnt");
69 #endif
70 Style.txo_font = (GrFont *)Fonts[DEFAULT_FONT];
71 Style.txo_chrtype = GR_BYTE_TEXT;
72
73 TXT.font = DEFAULT_FONT;
74 TXT.direction = HORIZ_DIR;
75 TXT.charsize = 1;
76 TXT.horiz = LEFT_TEXT;
77 TXT.vert = TOP_TEXT;
78 __gr_text_usr_multx = __gr_text_usr_divx =
79 __gr_text_usr_multy = __gr_text_usr_divy =
80 __gr_text_multx = __gr_text_divx =
81 __gr_text_multy = __gr_text_divy = 1;
82
83 Init = TRUE;
84 }
85