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 
GRX_textheight(int len,char * txt)27 static int GRX_textheight(int len, char *txt) {
28   Style.txo_font = (GrFont *)Fonts[TXT.font];
29   Style.txo_direct = GR_TEXT_RIGHT;
30   return GrStringHeight(txt, len, &Style);
31 }
32 
33 /* ----------------------------------------------------------------- */
34 
textheight(const char * textstring)35 int textheight(const char *textstring)
36 {
37   _DO_INIT_CHECK_RV(0);
38   __gr_text_init();
39   if (TXT.font == DEFAULT_FONT)
40     return 8*ZERO2ONE(TXT.charsize);
41   if (TXT.font >= FirstGrxFont && TXT.font <= LastGrxFont)
42     return GRX_textheight(strlen(textstring), (char *) textstring);
43   return __gr_text_height * __gr_text_multy / __gr_text_divy;
44 }
45 
46 /* ----------------------------------------------------------------- */
47 
__gr_text_Height(int len,const char * txt)48 int __gr_text_Height(int len, const char *txt) {
49   _DO_INIT_CHECK_RV(0);
50   __gr_text_init();
51   if (TXT.font == DEFAULT_FONT)
52     return 8*ZERO2ONE(TXT.charsize);
53   if (TXT.font >= FirstGrxFont && TXT.font <= LastGrxFont)
54     return GRX_textheight(len, (char *) txt);
55   return __gr_text_height * __gr_text_multy / __gr_text_divy;
56 }
57