예제 #1
0
void 
CmdEmphasize(int code)
/****************************************************************************
 purpose: LaTeX commands \em, \emph, and \begin{em} ... \end{em}
 
 		  the \emph{string} construction is handled by \textit{string} or \textup{string}
 		  
 		  {\em string} should be properly localized by brace mechanisms
 		  
 		  \begin{em} ... \end{em} will be localized by environment mechanisms

	 F_EMPHASIZE_1        for  \em ... 
	 F_EMPHASIZE_2        for  \emph{...}
	 F_EMPHASIZE_3        for  \begin{em} ... \end{em}
 ******************************************************************************/
{
	int true_code  = code & ~ON;
	
	diagnostics(4,"CmdEmphasize (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
				   FontInfoDepth, RtfFontInfo[FontInfoDepth].family, \
	               RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape,\
	               RtfFontInfo[FontInfoDepth].series);
	               
	if (true_code == F_EMPHASIZE_3 && !(code & ON)) 
	     return;

	if (true_code == F_EMPHASIZE_2) {

		if (CurrentFontShape() == F_SHAPE_UPRIGHT) 
			CmdFontShape(F_SHAPE_ITALIC_2);
		else
			CmdFontShape(F_SHAPE_UPRIGHT_2);
	
	} else {
	
		if (CurrentFontShape() == F_SHAPE_UPRIGHT)
			fprintRTF("\\i ");
		else
			fprintRTF("\\i0 ");

	}

	diagnostics(4,"CmdEmphasize (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
				   FontInfoDepth, RtfFontInfo[FontInfoDepth].family, \
	               RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape,\
	               RtfFontInfo[FontInfoDepth].series);
	               
}
예제 #2
0
파일: fonts.c 프로젝트: primetver/latex2rtf
void CmdTextNormal(int code)

/****************************************************************************
 purpose: handle \textnormal{text}  {\normalfont ...} commands

     F_TEXT_NORMAL        for  \normalfont ... 
     F_TEXT_NORMAL_1
     F_TEXT_NORMAL_2      for  \textnormal{...}
     F_TEXT_NORMAL_3      for  \begin{normalfont} ... \end{normalfont}

 ******************************************************************************/
{
    int true_code = code & ~ON;

    diagnostics(5, "CmdTextNormal (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",
      FontInfoDepth, RtfFontInfo[FontInfoDepth].family,
      RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape, RtfFontInfo[FontInfoDepth].series);

    if (true_code == F_TEXT_NORMAL_3 && !(code & ON))
        return;

    if (getTexMode() == MODE_VERTICAL)
        changeTexMode(MODE_HORIZONTAL);

    if (code == F_TEXT_NORMAL_2)
        fprintRTF("{");

    if (CurrentFontShape() != DefaultFontShape())
        CmdFontShape(DefaultFontShape());

    if (CurrentFontSeries() != DefaultFontSeries())
        CmdFontSeries(DefaultFontSeries());

    if (CurrentFontSize() != DefaultFontSize())
        CmdFontSize(DefaultFontSize());

    if (CurrentFontFamily() != DefaultFontFamily())
        CmdFontFamily(DefaultFontFamily());

    if (code == F_TEXT_NORMAL_2) {
        char *s;

        s = getBraceParam();
        ConvertString(s);
        free(s);
        fprintRTF("}");
    }

    diagnostics(5, "CmdTextNormal (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",
      FontInfoDepth, RtfFontInfo[FontInfoDepth].family,
      RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape, RtfFontInfo[FontInfoDepth].series);
}