Subversion Repositories wimsdev

Rev

Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 8103
Line 14... Line 14...
14
 *  along with this program; if not, write to the Free Software
14
 *  along with this program; if not, write to the Free Software
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
 */
16
 */
17
 
17
 
18
/* tex 2 gif translator, font loader */
18
/* tex 2 gif translator, font loader */
-
 
19
#include "texgif.h"
19
 
20
 
20
void mf2font(char *fontname, int density)
21
void mf2font(char *fontname, int density)
21
{
22
{
22
    loadtfm(fontname);
23
    loadtfm(fontname);
23
    makegf(fontname,density);
24
    makegf(fontname,density);
Line 30... Line 31...
30
    char namebuf[2048];
31
    char namebuf[2048];
31
    char *fcache, *cc;
32
    char *fcache, *cc;
32
    long int l,l2;
33
    long int l,l2;
33
    FILE *f;
34
    FILE *f;
34
    int newfont;
35
    int newfont;
35
   
36
 
36
    newfont=0;
37
    newfont=0;
37
    for(cc=fname; isalnum(*cc); cc++);
38
    for(cc=fname; isalnum(*cc); cc++);
38
    if(*cc!=0) error("Bad font name.");
39
    if(*cc!=0) error("Bad font name.");
39
    snprintf(namebuf,sizeof(namebuf),"%s/%d/%s.font",fontdir,density,fname);
40
    snprintf(namebuf,sizeof(namebuf),"%s/%d/%s.font",fontdir,density,fname);
40
    f=fopen(namebuf,"r"); if(f==NULL) {
41
    f=fopen(namebuf,"r"); if(f==NULL) {
41
        renewfont: mf2font(fname,density);
42
        renewfont: mf2font(fname,density);
42
        f=fopen(namebuf,"r"); newfont=1;
43
        f=fopen(namebuf,"r"); newfont=1;