char * chercheEqTeX(char * );
/**************************************************************************************************
** Function name : nouvfonte
**
** Description : Cree un nouveau maillon avec la description d'une fonte
** Input : Declarations sur les fontes
** Output : Pointeur sur le maillon cree.
**************************************************************************************************/
p_LFonte nouvfonte(int NLF_Fontnum, int NLF_Fontfamily, int NLF_Fcharset,
int NLF_Fprq, char * NLF_Fontname)
{
p_LFonte LFtemp=DebLisFontes;
char * pcalutemp;
if (LFtemp!=NULL)
{
while(LFtemp->suiv!=NULL)
LFtemp=LFtemp->suiv;
LFtemp->suiv=(p_LFonte) malloc (sizeof(t_LFonte));
LFtemp=LFtemp->suiv;
}
else
{
LFtemp=(p_LFonte) malloc (sizeof(t_LFonte));
DebLisFontes=LFtemp;
};
LFtemp->LF_Fontnum=NLF_Fontnum;
LFtemp->LF_Fontfamily=NLF_Fontfamily;
LFtemp->LF_Fcharset=NLF_Fcharset;
LFtemp->LF_Fprq=NLF_Fprq;
LFtemp->LF_Fontname=(char *) malloc (strlen(NLF_Fontname)+1);
strcpy(LFtemp->LF_Fontname,NLF_Fontname);
pcalutemp=chercheEqTeX(NLF_Fontname);
LFtemp->LF_TexEquiv=(char *) malloc (strlen(pcalutemp)+1);
strcpy(LFtemp->LF_TexEquiv,pcalutemp);
LFtemp->suiv=NULL;
}
/**************************************************************************************************
** Function name : cherchefonte
**
** Description : A partir du numero de fonte, cherche une fonte donnee.
** Input : Numero de fonte.
** Output : Pointeur sur le maillon contenant les caracteristiques.
**************************************************************************************************/
p_LFonte cherchefonte(int CLFnum)
{
p_LFonte LFtemp=DebLisFontes;
while (LFtemp!=NULL && LFtemp->LF_Fontnum!=CLFnum)
LFtemp=LFtemp->suiv;
return LFtemp;
}
/**************************************************************************************************
** Function name : chercheEqTeX
**
** Description : Cherche un equivalent TeX pour un nom de fonte RTF
** Input : Nom de la fonte RTF
** Output : Equivalent TeX (ou police par defaut sinon.
**************************************************************************************************/
char * chercheEqTeX(char * FontNameRTF)
{
int i;
for (i=0;i<MaxFontsTex;i++)
{
if (strcmp(FontNameRTF,EqFontsRTF_TeX[i].FontRTF)==0)
return EqFontsRTF_TeX[i].FontTeX;
}
/* Si on est toujours la, c'est qu'on n'a pas trouve de fonte correspondante: On prends la valeur par
defaut: Times New Roman ou cmr10 */
return "\\pzrm ";
}
/**************************************************************************************************
** Function name : EqTeXTaille
**
** Description : Determine la taille de police a utiliser, a partir de la donnee RTF,
et retourne la chaine de caracteres equivalente TeX.
** Input : Taille de la police en demi-points.
** Output : Equivalent TeX
**************************************************************************************************/
char * EqTeXTaille(int TailleRTF)
{
TailleRTF/=2;
if (TailleRTF<1)
return EqTailles_TeX[0].tailleTeX;
if (TailleRTF>MaxTaillesTex)
return EqTailles_TeX[MaxTaillesTex-1].tailleTeX;
return EqTailles_TeX[TailleRTF-1].tailleTeX;
}
/**************************************************************************************************
** Function name : printSymbol
**
** Description :
** Input : char * chaineIN
** Output : void
**************************************************************************************************/
void printSymbol(char * chaineIN)
{
int i=0;
for (i=0;i<strlen(chaineIN);i++)
fprintf(SORT,"%s",FontSymboles[chaineIN[i]]);
}
/**************************************************************************************************
** Function name : printText
**
** Description :
** Input : char * chaineIN
** Output : void
**************************************************************************************************/
void printText(char * chaineIN)
{
int i=0;
for (i=0;i<strlen(chaineIN);i++)
{
if ((chaineIN[i]=='|' || chaineIN[i]=='<' || chaineIN[i]=='>') && FLAG_Equation==0)
{
fprintf(SORT,"$%c$",chaineIN[i]);
}
else fprintf(SORT,"%c",chaineIN[i]);
}
}
/**************************************************************************************************
** Function name : printApostrophe
**
** Description :
** Input : int ulluIN
** Output : void
**************************************************************************************************/
void printApostrophe(int ulluIN)
{
if (FLAG_Equation==0)
{
if (ulluIN<238)
fprintf(SORT,"$%s$",FontSymboles[ulluIN]);
else
fprintf(SORT,"%s",FontSymboles[ulluIN]);
}
else
{
if (ulluIN<238)
fprintf(SORT,"%s",FontSymboles[ulluIN]);
else
fprintf(SORT,"$%s$",FontSymboles[ulluIN]);
}
}