Exemplo n.º 1
0
void label(void)
{
	unsigned x=0;
	static char txt[DATA_WIDTH/TEXT_WIDTH];
	unsigned char *ptr;
	unsigned txtlen;

	snprintf(txt, sizeof txt, "  0-%u-%u-%u-%u-%u-%u-%u %u/%u %s"
		, XCROSSES, YCROSSES, CPITCH, CHALF
		, FEC_ORDER, BORDER, TEXT_HEIGHT
		,file_number,n_pages
		, (char *)(void *)file_label);
	txtlen=strlen((char *)(void *)txt);

	assert(font_height==TEXT_HEIGHT);
	x=font_width-TEXT_WIDTH*(127-' ');
	text_block(0,TEXT_WIDTH*(127-' '), x);
	for (ptr=(unsigned char *)(void *)txt
			;ptr<(unsigned char *)(void *)txt+txtlen;ptr++){
		if (*ptr>=' '&&*ptr<=127){
			text_block(x,TEXT_WIDTH*(*ptr-' '), TEXT_WIDTH);
			x+=TEXT_WIDTH;
		}
	}

}
Exemplo n.º 2
0
void begin_tab(int *pln, int *pcode, int *cp) {
	vector<int> delta;
	int cjust, save_fnt;
 	double zzz, save_hei, base_owidth;
	(*pln)++;
	string line;
	stringstream tab_buf;
	g_get_font(&save_fnt);
	g_get_hei(&save_hei);
	g_get_just(&cjust);
	g_textfindend("o",&base_owidth,&zzz);
	int save_pln = *pln;
	while (begin_line_norep(pln, line)) {
		tab_line_delta(line, tab_buf, delta);
	}
	*pln = save_pln;
	while (begin_line_norep(pln, line)) {
		tab_line(line, tab_buf, base_owidth, delta);
	}
	// cout << "tab buf '" << tab_buf.str() << "'" << endl;
	g_set_font(save_fnt);
	g_set_hei(save_hei);
	text_block(tab_buf.str(),0.0,cjust);
}