faxmail/MsgFmt.c++
void
MsgFmt::showItalic(TextFormat& fmt, const char* cp)
{
    const TextFont* italic = fmt.getFont("Italic");
    if (!italic)
	italic = fmt.addFont("Italic", italicFont);
    while (isspace(*cp))			// trim leading whitespace
	cp++;
    TextCoord x = fmt.getXOff();		// current x position on line
    FILE* tf = fmt.getOutputFile();		// output stream
    const char* tp = cp;
    for (; *tp != '\0'; tp++) {
	if (*tp == '\r' && *(tp+1) == '\n') tp++;
	TextCoord hm = italic->charwidth(*tp);
	if (*tp == '\n' || x+hm > fmt.getRHS()) {// text would overflow line
	    italic->show(tf, cp, tp-cp), cp = tp;// flush pending text
	    if (!fmt.getLineWrapping())		// truncate line, don't wrap
		return;
	    fmt.endLine();			// terminate line
	    fmt.beginLine();			// begin another line
	    fmt.hrMove(headerStop);		// reposition to header stop
	    x = fmt.getXOff();
	    if (*tp == '\n') {			// remove leading white space
		for (tp++; isspace(*tp); tp++)
		    ;
		cp = --tp;
	    }
	}
	x += hm;
    }
    if (tp > cp)
	italic->show(tf, cp, tp-cp);		// flush remainder
}
/*
 * Display the string in italic, wrapping to the
 * field header tab stop on any line overflows.
 */
Display the string in italic, wrapping to the
field header tab stop on any line overflows.
Display the string in italic wrapping to the field header tab stop on any line overflows .
void
MsgFmt::showItalic(TextFormat& fmt, const char* cp)
{
    const TextFont* italic = fmt.getFont("Italic");
    if (!italic)
	italic = fmt.addFont("Italic", italicFont);
    while (isspace(*cp))			
	cp++;
    TextCoord x = fmt.getXOff();		
    FILE* tf = fmt.getOutputFile();		
    const char* tp = cp;
    for (; *tp != '\0'; tp++) {
	if (*tp == '\r' && *(tp+1) == '\n') tp++;
	TextCoord hm = italic->charwidth(*tp);
	if (*tp == '\n' || x+hm > fmt.getRHS()) {
	    italic->show(tf, cp, tp-cp), cp = tp;
	    if (!fmt.getLineWrapping())		
		return;
	    fmt.endLine();			
	    fmt.beginLine();			
	    fmt.hrMove(headerStop);		
	    x = fmt.getXOff();
	    if (*tp == '\n') {			
		for (tp++; isspace(*tp); tp++)
		    ;
		cp = --tp;
	    }
	}
	x += hm;
    }
    if (tp > cp)
	italic->show(tf, cp, tp-cp);		
}
void MsgFmt :: showItalic ( TextFormat & fmt , const char * cp ) { const TextFont * italic = fmt . getFont ( " " ) ; if ( ! italic ) italic = fmt . addFont ( " " , italicFont ) ; while ( isspace ( * cp ) ) cp ++ ; TextCoord x = fmt . getXOff ( ) ; FILE * tf = fmt . getOutputFile ( ) ; const char * tp = cp ; for ( ; * tp != ' \0 ' ; tp ++ ) { if ( * tp == ' \r ' && * ( tp + 1 ) == ' \n ' ) tp ++ ; TextCoord hm = italic -> charwidth ( * tp ) ; if ( * tp == ' \n ' || x + hm > fmt . getRHS ( ) ) { italic -> show ( tf , cp , tp - cp ) , cp = tp ; if ( ! fmt . getLineWrapping ( ) ) return ; fmt . endLine ( ) ; fmt . beginLine ( ) ; fmt . hrMove ( headerStop ) ; x = fmt . getXOff ( ) ; if ( * tp == ' \n ' ) { for ( tp ++ ; isspace ( * tp ) ; tp ++ ) ; cp = -- tp ; } } x += hm ; } if ( tp > cp ) italic -> show ( tf , cp , tp - cp ) ; }
Display the string in italic, wrapping to the
 field header tab stop on any line overflows.
Display the string in italic wrapping to the field header tab stop on any line overflows .
// trim leading whitespace // current x position on line // output stream // text would overflow line // flush pending text // truncate line, don't wrap // terminate line // begin another line // reposition to header stop // remove leading white space // flush remainder