2 /****************************************************************************
3 * Copyright (C) 2002 by Leo Khramov
4 * email: leo@xnc.dubna.su
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 ****************************************************************************/
16 // $Id: wellimagefont.cxx,v 1.1.1.1 2003/01/04 11:37:22 leo Exp $
18 #include "wellimagefont.h"
20 //===========================================================================
21 /// global WellImageFont(Images id, unsigned int ifl, unsigned int ifh, int idx, int idy)
22 /// Constructor of base draw text class
23 /// tags WellImageFont
24 WellImageFont::WellImageFont(Images id
, unsigned int ifl
, unsigned int ifh
,
35 //===========================================================================
36 /// global set_font(...)
37 /// setting font params
38 /// tags WellImageFont
39 void WellImageFont::set_font(unsigned int ifl
, unsigned int ifh
,
48 //===========================================================================
49 /// global set_text(char*)
50 /// setting text for output
51 /// tags WellImageFont
52 void WellImageFont::set_text(char* itext
)
59 //===========================================================================
60 /// global set_screen_region(int ix, int iy, int il, int ih)
61 /// setting text for output
62 /// tags WellImageFont
63 void WellImageFont::set_screen_region(int ix
, int iy
, int il
, int ih
)
72 //===========================================================================
73 /// global draw_text(Justify just)
74 /// draw text with given justification
75 /// tags WellImageFont
76 void WellImageFont::draw_text(Justify just
)
78 draw_text(text
,text_l
,just
);
81 //===========================================================================
82 /// global draw_text(char *text, int text_l, Justify just)
83 /// draw text with given justification
84 /// tags WellImageFont
85 void WellImageFont::draw_text(char* txt
, int txt_l
, Justify just
)
100 draw_x
=screen_x
+screen_l
-txt_l
*font_l
;
103 draw_x
=screen_x
+(screen_l
-txt_l
*font_l
)/2;
106 draw_h
=(screen_h
<font_h
? screen_h
: font_h
);
108 draw_symbol(draw_x
+font_l
*i
,screen_y
,font_l
,draw_h
,txt
[i
]);
111 //===========================================================================
112 /// global draw_text(char *text, int text_l, Justify just)
113 /// draw text with given justification
114 /// tags WellImageFont
115 void WellImageFont::draw_text(char* txt
, int txt_l
, Colors idx
, Justify just
)
130 draw_x
=screen_x
+screen_l
-txt_l
*font_l
;
133 draw_x
=screen_x
+(screen_l
-txt_l
*font_l
)/2;
136 draw_h
=(screen_h
<font_h
? screen_h
: font_h
);
138 draw_symbol(draw_x
+font_l
*i
,screen_y
,font_l
,draw_h
,txt
[i
]);