예제 #1
0
int 
CurrentCyrillicFontFamily(void)
/******************************************************************************
  purpose: returns the cyrillic font that should be used ... 
           if the current font is cyrillic font then -1 is returned
 ******************************************************************************/
{
	int            num,i;
	char          *font_type;
	ConfigEntryT **font_handle;

	num = CurrentFontFamily();

/* obtain name and type of current active font */
	font_handle = CfgStartIterate(FONT_A);
	for (i=0; i<=num-3; i++)
		font_handle = CfgNext(FONT_A, font_handle);
		
	font_type = (char *) (*font_handle)->TexCommand;
	diagnostics(6,"CurrentCyrillicFontFamily current active font type =<%s>", font_type);
	
	if (strncmp(font_type, "Cyrillic", 8)==0)
		return -1;
		
	if (strcmp(font_type, "Slanted")==0) 
		return TexFontNumber("Cyrillic Slanted");
		
	if (strcmp(font_type, "Sans Serif")==0) 
		return TexFontNumber("Cyrillic Sans Serif");

	if (strcmp(font_type, "Typewriter")==0) 
		return TexFontNumber("Cyrillic Typewriter");

	return TexFontNumber("Cyrillic Roman");
}
예제 #2
0
int 
RtfFontNumber(char *Fname)
/****************************************************************************
 *   purpose: returns the RTF font number from an RTF font name
     example: RtfFontNumber("Times")
 ****************************************************************************/
{
	int          num = 0;
	ConfigEntryT **config_handle = CfgStartIterate(FONT_A);

	while ((config_handle = CfgNext(FONT_A, config_handle)) != NULL) {
		diagnostics(4,"font name =%s", (*config_handle)->RtfCommand);
		if (strcmp((*config_handle)->RtfCommand, Fname) == 0) {
			return num+3;
		}
		num++;
	}
	return TexFontNumber("Roman");	/* default font */
}
예제 #3
0
파일: fonts.c 프로젝트: primetver/latex2rtf
/****************************************************************************
 *   purpose: returns the RTF font number from an RTF font name
     example: RtfFontNumber("Times")
 ****************************************************************************/
int RtfFontNumber(const char *Fname)
{
    ConfigEntryT **config_handle;
    char *font_type, *font_name;
    int font_id;

    diagnostics(6, "seeking=%s", Fname);

    config_handle = CfgStartIterate();

    while ((config_handle = CfgNext(FONT_A, config_handle)) != NULL) {
        font_type = (char *) (*config_handle)->TexCommand;
        font_name = (char *) (*config_handle)->RtfCommand;
        font_id   = (int   ) (*config_handle)->original_id;
        
        diagnostics(6, "RTF font %d has name='%s' of type='%s'", font_id, font_name, font_type);

        if (strcmp(font_name, Fname) == 0) 
            return font_id;
    }
    return TexFontNumber("Roman");  /* default font */
}