예제 #1
0
static void
ShowSign(char *string)
{
    char *base = string;
    int ch, first, last;

    if (moveit != 0) {
	tputs(tgoto(moveit, 0, height - 1), 1, outc);
	tputs(wipeit, 1, outc);
    }

    while (*string != 0) {
	ch = *string;
	if (ch != ' ') {
	    if (moveit != 0) {
		for (first = length - 2; first >= (string - base); first--) {
		    if (first < length - 1) {
			tputs(tgoto(moveit, first + 1, height - 1), 1, outc);
			PutChar(' ');
		    }
		    tputs(tgoto(moveit, first, height - 1), 1, outc);
		    PutChar(ch);
		}
	    } else {
		last = ch;
		if (isalpha(ch)) {
		    first = isupper(ch) ? 'A' : 'a';
		} else if (isdigit(ch)) {
		    first = '0';
		} else {
		    first = ch;
		}
		if (first < last) {
		    Underline(1);
		    while (first < last) {
			PutChar(first);
			Backup();
			first++;
		    }
		    Underline(0);
		}
	    }
	    if (moveit != 0)
		Backup();
	}
	StandOut(1);
	PutChar(ch);
	StandOut(0);
	fflush(stdout);
	string++;
    }
    if (moveit != 0)
	tputs(wipeit, 1, outc);
    putchar('\n');
}
예제 #2
0
static void
cleanup(void)
{
    Underline(0);
    StandOut(0);
    ShowCursor(1);
}
예제 #3
0
//
// Initializing text display values.
//
void CTextDisplay::SetAll(CString * show_text, char *font_name, LONG font_size,
			  TextAlignment alignment, BOOL bold, BOOL italic, BOOL underline, COLORREF color)
{
	// Update all settings for the displayed text, but do not update the
	// window until everything has been updated.
	SetText(show_text, FALSE);
	SetFontType(font_name, FALSE);
	SetFontSize(font_size, FALSE);
	SetTextAlignment(alignment, FALSE);
	Bold(bold, FALSE);
	Italic(italic, FALSE);
	Underline(underline, FALSE);
	SetTextColor(color, FALSE);

	// Update the display.
	RedrawWindow();
}
예제 #4
0
void CTextStyle::FromOldStyle(const TextStyle& style)
{
	// Set some defaults.
	SetDefault();

	// Copy the style information over.
	Font(style.get_face());
	Size(MakeFixed(style.get_size(), style.get_size_fraction()));
	BaseSize(MakeFixed(style.get_base_size(), style.get_base_size_fraction()));
	Expansion(DivFixed(MakeFixed(style.get_base_size(), style.get_base_size_fraction()),
							 MakeFixed(FONT_EXPANSION_UNIT)));
	Fill(style.get_pattern(), style.get_color());
	Outline(style.get_outline(), style.get_color());
	Shadow(style.get_shadow(), style.get_color());
	m_Character.m_nEffectsVersion = 1;
	XFlipped(style.get_xflipped());
	YFlipped(style.get_yflipped());
//	Color(style.get_color());

	Alignment(style.get_line_alignment());
	VerticalAlignment(style.get_vertical_alignment());
	// Left and right margin should be zero (default) unless set by user.
	// This fixes a problem converting old warp text boxes - they should
	// always have zero margins!
	LeftMargin(0);
	RightMargin(0);
//	LeftMargin(PageToInches(style.get_left_margin()));
//	RightMargin(PageToInches(style.get_right_margin()));
	LeadingType(LEADING_lines);
	Leading(MakeFixed(0.875));

	Underline(style.UnderlineStyle());

	// Update our metrics.
	UpdateFontMetrics();
}