Пример #1
0
void draw_main_labels (int app_handle, char * title, char * x_label, char * y_label,
	int x, int y, int w, int h, int y_value_width) {

	int offset;
	int char_w, char_h, cell_w, cell_h;

	vsf_color (app_handle, BLACK);
	vst_point (app_handle, TITLE_FONT, &char_w, &char_h, &cell_w, &cell_h);

	offset = cell_w * (w/cell_w - strlen(title))/2;
	if (offset < 0) offset = 0;
	v_gtext (app_handle, x + offset, y-h-cell_h, title);

	vst_point (app_handle, AXES_TITLE_FONT, &char_w, &char_h, &cell_w, &cell_h);

	offset = cell_w * (w/cell_w - strlen(x_label))/2;
	if (offset < 0) offset = 0;
	v_gtext (app_handle, x + offset, y+2*cell_h, x_label);

	offset = cell_h * (h/cell_h - strlen(y_label))/2;
	if (offset < 0) offset = 0;
	vst_rotation (app_handle, 900);
	v_gtext (app_handle, x-(y_value_width+1)*cell_w, y-offset, y_label);
	vst_rotation (app_handle, 0);
}
Пример #2
0
void set_txt_default(int font, int height)
{
	int dummy;

	vswr_mode(vdi_handle, MD_REPLACE);

	vst_font(vdi_handle, font);
	vst_color(vdi_handle, 1);
	vst_rotation(vdi_handle, 0);
	vst_alignment(vdi_handle, 0, 5, &dummy, &dummy);
	vst_point(vdi_handle, height, &dummy, &dummy, &dummy, &dummy);
	vst_effects(vdi_handle, 0);
}