Back to index

tetex-bin  3.0
Classes | Defines | Functions | Variables
afm2tfm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <strings.h>
#include <math.h>
#include "dvips.h"

Go to the source code of this file.

Classes

struct  encoding
struct  adobeinfo
struct  lig
struct  kern
struct  adobeptr
struct  pcc

Defines

#define ASCII_A   65
#define ASCII_Z   90
#define ASCII_a   97
#define ASCII_z   122
#define ASCII_0   48
#define ASCII_9   57
#define INBUFSIZE   1024
#define FontName   (0)
#define ItalicAngle   (1)
#define IsFixedPitch   (2)
#define XHeight   (3)
#define C   (4)
#define KPX   (5)
#define CC   (6)
#define EncodingScheme   (7)
#define NONE   (-1)
#define FIXFACTOR   (0x100000L) /* 2^{20}, the unit fixnum */
#define vout(s)   fprintf(vplout, s)
#define voutln(str)   {fprintf(vplout,"%s\n",str);vlevout();}
#define voutln2(f, s)   {fprintf(vplout,f,s);vlevnlout();}
#define voutln3(f, a, b)   {fprintf(vplout,f,a,b);vlevnlout();}
#define voutln4(f, a, b, c)   {fprintf(vplout,f,a,b,c);vlevnlout();}
#define CHECKARG3   if (argc < 4) { usage(stderr); exit(1); }

Functions

void error P1C (register char *, s)
int transform P2C (register int, x, register int, y)
int getline P1H (void)
int interest P1C (char *, s)
char *mymalloc P1C (unsigned long, len)
struct adobeinfo *findadobe P1C (char *, p)
struct encoding *readencoding P1H (char *)
struct adobeinfo *revlist P1C (struct adobeinfo *, p)
void write16 P1C (register short, what)
void writearr P2C (register long *, p, register int, n)
void makebcpl P3C (register long *, p, register char *, s, register int, n)
int mincover P2C (long *, what, register long, d)
void remap P3C (long *, what, int, oldn, int, newn)
long scale P1C (long, what)
void writesarr P2C (long *, what, int, len)
int texheight P1C (register struct adobeinfo *, ai)
void vlevout ()
void vlevnlout ()
char *vchar P1C (int, c)
void usage P1C (FILE *, f)
void openfiles P2C (int, argc, char **, argv)
struct kern *rmkernmatch P2C (struct kern *, k, char *, s)
void rmkern P3C (char *, s1, char *, s2, struct adobeinfo *, ai)
void addkern P2C (char *, s1, char *, s2)
char * gettoken ()
void getligkerndefaults ()
struct encoding *readencoding P1C (char *, enc)
void conspsfonts ()

Variables

char * staticligkern []
struct encodingoutencoding = 0
struct encodinginencoding = 0
char * outenname = NULL
char * inenname = NULL
int boundarychar = -1
int ignoreligkern
struct adobeinfoadobechars
struct adobeinfoadobeptrs [256]
struct adobeinfotexptrs [256]
struct adobeinfouppercase [256]
struct adobeinfolowercase [256]
int nexttex [256]
char * vplligops []
char * encligops []
FILEafmin
FILEvplout
FILEtfmout
char inname [200]
char outname [200]
char tmpstr [200]
char buffer [INBUFSIZE+10]
char obuffer [INBUFSIZE+10]
char * param
char * fontname = "Unknown"
char * codingscheme = "Unspecified"
float italicangle = 0.0
char fixedpitch
char makevpl
char pedantic
int xheight = 400
int fontspace
int bc
int ec
long cksum
float efactor = 1.0
float slant = 0.0
float capheight = 0.8
char * efactorparam
char * slantparam
double newslant
char titlebuf [500]
char * interesting []
int lf
int lh
int nw
int nh
int nd
int ni
int nl
int nk
int ne
int np
int source [257]
int unsort [257]
long nextd
long * header
long * charinfo
long * width
long * height
long * depth
long * ligkern
long * kern
long * tparam
long * italic
long * tfmdata
char * accents [] = { "acute", "tilde", "caron", "dieresis", NULL}
int level
int forceoctal = 0
char vcharbuf [6]
char vnamebuf [100]
int sawligkern
char smbuffer [100]

Class Documentation

struct encoding

Definition at line 21 of file encodings.c.

Collaboration diagram for encoding:
Class Members
char * charname
char * enc_name
pdf_obj * encoding_ref
char * glyphs
char * name
struct encoding * next
char * vec
struct adobeinfo

Definition at line 166 of file afm2tfm.c.

Collaboration diagram for adobeinfo:
Class Members
char * adobename
int adobenum
int dptr
int hptr
int iptr
struct adobeptr * kern_equivs
struct kern * kerns
struct lig * ligs
int llx
int lly
struct adobeinfo * next
struct pcc * pccs
int texnum
int urx
int ury
int width
int wptr
struct lig

Definition at line 188 of file afm2tfm.c.

Collaboration diagram for lig:
Class Members
short boundleft
struct lig * next
short op
char * sub
char * succ
struct kern

Definition at line 193 of file afm2tfm.c.

Collaboration diagram for kern:
Class Members
int delta
struct kern * next
char * succ
struct adobeptr

Definition at line 198 of file afm2tfm.c.

Collaboration diagram for adobeptr:
Class Members
struct adobeinfo * ch
struct adobeptr * next
struct pcc

Definition at line 202 of file afm2tfm.c.

Collaboration diagram for pcc:
Class Members
struct pcc * next
char * partname
int xoffset
int yoffset

Define Documentation

#define ASCII_0   48

Definition at line 49 of file afm2tfm.c.

#define ASCII_9   57

Definition at line 50 of file afm2tfm.c.

#define ASCII_A   65

Definition at line 45 of file afm2tfm.c.

#define ASCII_a   97

Definition at line 47 of file afm2tfm.c.

#define ASCII_Z   90

Definition at line 46 of file afm2tfm.c.

#define ASCII_z   122

Definition at line 48 of file afm2tfm.c.

#define C   (4)

Definition at line 297 of file afm2tfm.c.

#define CC   (6)

Definition at line 299 of file afm2tfm.c.

#define CHECKARG3   if (argc < 4) { usage(stderr); exit(1); }

Definition at line 1537 of file afm2tfm.c.

#define EncodingScheme   (7)

Definition at line 300 of file afm2tfm.c.

#define FIXFACTOR   (0x100000L) /* 2^{20}, the unit fixnum */

Definition at line 1004 of file afm2tfm.c.

#define FontName   (0)

Definition at line 293 of file afm2tfm.c.

#define INBUFSIZE   1024

Definition at line 211 of file afm2tfm.c.

#define IsFixedPitch   (2)

Definition at line 295 of file afm2tfm.c.

#define ItalicAngle   (1)

Definition at line 294 of file afm2tfm.c.

#define KPX   (5)

Definition at line 298 of file afm2tfm.c.

#define NONE   (-1)

Definition at line 301 of file afm2tfm.c.

#define vout (   s)    fprintf(vplout, s)

Definition at line 1201 of file afm2tfm.c.

#define voutln (   str)    {fprintf(vplout,"%s\n",str);vlevout();}

Definition at line 1211 of file afm2tfm.c.

#define voutln2 (   f,
  s 
)    {fprintf(vplout,f,s);vlevnlout();}

Definition at line 1212 of file afm2tfm.c.

#define voutln3 (   f,
  a,
  b 
)    {fprintf(vplout,f,a,b);vlevnlout();}

Definition at line 1213 of file afm2tfm.c.

#define voutln4 (   f,
  a,
  b,
  c 
)    {fprintf(vplout,f,a,b,c);vlevnlout();}

Definition at line 1214 of file afm2tfm.c.

#define XHeight   (3)

Definition at line 296 of file afm2tfm.c.


Function Documentation

Definition at line 2000 of file afm2tfm.c.

                   {
   (void)printf("%s %s", outname,
   fontname) ;
#else /* VM/CMS: fontname is ascii, so we use ebfontname */
void conspsfonts() {
   (void)printf("%s %s", outname,
   ebfontname) ;
#endif
   if (slantparam || efactorparam || inenname) {
      (void)printf(" \"") ;
      if (slantparam)
         (void)printf(" %s SlantFont", slantparam) ;
      if (efactorparam)
         (void)printf(" %s ExtendFont", efactorparam) ;
      if (inenname)
         (void)printf(" %s ReEncodeFont", inencoding->name) ;
      (void)printf(" \"") ;
      if (inenname)
         (void)printf(" <%s", inenname) ;
   }
   (void)printf("\n") ;
}

Here is the call graph for this function:

Definition at line 1922 of file afm2tfm.c.

                          {
   int i ;

   for (i=0; staticligkern[i]; i++) {
      strcpy(buffer, staticligkern[i]) ;
      strcpy(obuffer, staticligkern[i]) ;
      param = buffer ;
      checkligkern(buffer) ;
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* gettoken ( )

Definition at line 1880 of file afm2tfm.c.

                 {
   char *p, *q ;

   while (1) {
      while (param == 0 || *param == 0) {
         if (getline() == 0)
            error("! premature end in encoding file") ;
         for (p=buffer; *p; p++)
            if (*p == '%') {
               if (ignoreligkern == 0)
                  checkligkern(p) ;
               *p = 0 ;
               break ;
            }
      }
      while (*param && *param <= ' ')
         param++ ;
      if (*param) {
         if (*param == '[' || *param == ']' ||
             *param == '{' || *param == '}') {
            smbuffer[0] = *param++ ;
            smbuffer[1] = 0 ;
            return smbuffer ;
         } else if (*param == '/' || *param == '-' || *param == '_' ||
                    *param == '.' ||
                    ('0' <= *param && *param <= '9') ||
                    ('a' <= *param && *param <= 'z') ||
                    ('A' <= *param && *param <= 'Z')) {
            smbuffer[0] = *param ;
            for (p=param+1, q=smbuffer+1;
                        *p == '-' || *p == '_' || *p == '.' ||
                        ('0' <= *p && *p <= '9') ||
                        ('a' <= *p && *p <= 'z') ||
                        ('A' <= *p && *p <= 'Z'); p++, q++)
               *q = *p ;
            *q = 0 ;
            param = p ;
            return smbuffer ;
         }
      }
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void error P1C ( register char *  ,
s   
)

Definition at line 236 of file afm2tfm.c.

{
   (void)fprintf(stderr, "%s\n", s) ;
   if (obuffer[0]) {
      (void)fprintf(stderr, "%s\n", obuffer) ;
      while (param > buffer) {
         (void)fprintf(stderr, " ") ;
         param-- ;
      }
      (void)fprintf(stderr, "^\n") ;
   }
   if (*s == '!')
      exit(1) ;
}

Here is the call graph for this function:

void do_graphic P1C ( char *  ,
s   
)

Definition at line 303 of file afm2tfm.c.

{
   register char **p ;
   register int n ;

   for (p=interesting, n=0; *p; p++, n++)
      if (strcmp(s, *p)==0)
         return(n) ;
   return(NONE) ;
}

Here is the call graph for this function:

char* mymalloc P1C ( unsigned  long,
len   
)

Definition at line 315 of file afm2tfm.c.

{
   register char *p ;
   int i ;

#ifdef SMALLMALLOC
   if (len > 65500L)
      error("! can't allocate more than 64K!") ;
#endif
   p = (char *) malloc((unsigned)len) ;
   if (p==NULL)
      error("! out of memory") ;
   for (i=0; i<len; i++)
      p[i] = 0 ;
   return(p) ;
}

Here is the call graph for this function:

integer scanvm P1C ( char *  ,
p   
) [read]

Definition at line 505 of file afm2tfm.c.

{
   register struct adobeinfo *ai ;

   for (ai=adobechars; ai; ai = ai->next)
      if (strcmp(p, ai->adobename)==0)
         return(ai) ;
   return(NULL) ;
}

Here is the call graph for this function:

struct adobeinfo* revlist P1C ( struct adobeinfo ,
p   
) [read]

Definition at line 705 of file afm2tfm.c.

{
   struct adobeinfo *q = 0, *t ;

   while (p) {
      t = p->next ;
      p->next = q ;
      q = p ;
      p = t ;
   }
   return q ;
}
void write16 P1C ( register  short,
what   
)

Definition at line 867 of file afm2tfm.c.

{
   (void)fputc(what >> 8, tfmout) ;
   (void)fputc(what & 255, tfmout) ;
}

Here is the call graph for this function:

long scale P1C ( long  ,
what   
)

Definition at line 1006 of file afm2tfm.c.

{
   return(((what / 1000) << 20) +
          (((what % 1000) << 20) + 500) / 1000) ;
}
int texheight P1C ( register struct adobeinfo ,
ai   
)

Definition at line 1183 of file afm2tfm.c.

{
   register char **p;
   register struct adobeinfo *aci, *acci ;
   if (xheight <= 50 || *(ai->adobename + 1)) return (ai->ury) ;
                                           /* that was the simple case */
   for (p=accents; *p; p++)  /* otherwise we look for accented letters */
      if (0 != (aci=findadobe(*p))) {
         strcpy(buffer,ai->adobename) ;
         strcat(buffer,*p) ;
         if (0 != (acci=findadobe(buffer)))
            return (acci->ury - aci->ury + xheight) ;
      }
   return (ai->ury) ;
}

Here is the call graph for this function:

int mlower P1C ( int  ,
c   
)

Definition at line 1232 of file afm2tfm.c.

{
   if (forceoctal == 0 && ISALNUM (c))
      (void) sprintf(vcharbuf,"C %c",
#ifndef VMCMS
      c) ;
#else
      ascii2ebcdic[c]) ;
#endif
   else (void) sprintf(vcharbuf,"O %o", (unsigned)c) ;
   return (vcharbuf) ;
}

Here is the call graph for this function:

int getc_UTF16LE P1C ( FILE ,
f   
)

Definition at line 1524 of file afm2tfm.c.

{
   (void)fprintf(f,
 "afm2tfm 8.1, Copyright 1990-97 by Radical Eye Software\n") ;
   (void)fprintf(f,
 "Usage: afm2tfm foo[.afm] [-O] [-u] [-v|-V bar[.vpl]]\n") ;
   (void)fprintf(f,
 "                 [-e expansion] [-s slant] [-c capheight]\n") ;
   (void)fprintf(f,
 "                 [-p|-t|-T encodingfile] [foo[.tfm]]\n") ;
}

Here is the call graph for this function:

struct encoding* readencoding P1C ( char *  ,
enc   
) [read]

Definition at line 1936 of file afm2tfm.c.

{
   char *p ;
   int i ;
   struct encoding *e =
      (struct encoding *)mymalloc((unsigned long)sizeof(struct encoding)) ;

   sawligkern = 0 ;
   if (afmin)
      error("! oops; internal afmin error") ;
   if (enc) {
#ifdef KPATHSEA
     afmin = kpse_open_file(enc, kpse_enc_format);
#else
      afmin = fopen(enc, "r") ;
#endif
      SET_BINARY(fileno(afmin)) ;
      param = 0 ;
      if (afmin == 0)
#ifdef KPATHSEA
         FATAL1 ("couldn't open encoding file `%s'", enc) ;
#else
         error("! couldn't open that encoding file") ;
#endif
      p = gettoken() ;
      if (*p != '/' || p[1] == 0)
         error("! first token in encoding must be literal encoding name") ;
      e->name = newstring(p+1) ;
      p = gettoken() ;
      if (strcmp(p, "["))
         error("! second token in encoding must be mark ([) token") ;
      for (i=0; i<256; i++) {
         p = gettoken() ;
         if (*p != '/' || p[1] == 0)
            error("! tokens 3 to 257 in encoding must be literal names") ;
         e->vec[i] = newstring(p+1) ;
      }
      p = gettoken() ;
      if (strcmp(p, "]"))
         error("! token 258 in encoding must be make-array (])") ;
      while (getline()) {
         for (p=buffer; *p; p++)
            if (*p == '%') {
               if (ignoreligkern == 0)
                  checkligkern(p) ;
               *p = 0 ;
               break ;
            }
      }
      fclose(afmin) ;
      afmin = 0 ;
      if (ignoreligkern == 0 && sawligkern == 0)
         getligkerndefaults() ;
   } else {
      e = &staticencoding ;
      getligkerndefaults() ;
   }
   param = 0 ;
   return e ;
}

Here is the call graph for this function:

void mf_trap_updatescreen P1H ( void  ) [read]

Definition at line 260 of file afm2tfm.c.

                  {
   register char *p ;
   register int c ;

   param = buffer ;
   for (p=buffer; (c=getc(afmin)) != EOF;) {
      if (p - buffer >= INBUFSIZE)
         error("! input line too long; perhaps input file is malformed?") ;
      *p++ = c ;
      if (c == '\r') {
         c = getc(afmin) ;
         if (c != EOF) {
            if (c == '\n') {
               *p++ = c ;
            } else {
               ungetc(c, afmin) ;
            }
         }
         break ;
      } else if (c == '\n') {
         break ;
      }
   }
   *p = 0 ;
   (void)strcpy(obuffer, buffer) ;
   if (p == buffer && c == EOF)
      return(0) ;
   else
      return(1) ;
}
void get_return_type P1H ( char *  ) [read]
int transform P2C ( register  int,
x  ,
register  int,
y   
)

Definition at line 252 of file afm2tfm.c.

{
   register double acc ;
   acc = efactor * x + slant *y ;
   return (int)(acc>=0? floor(acc+0.5) : ceil(acc-0.5) ) ;
}

Here is the call graph for this function:

void writearr P2C ( register long *  ,
p  ,
register  int,
n   
)

Definition at line 874 of file afm2tfm.c.

{
   while (n) {
      write16((short)(*p >> 16)) ;
      write16((short)(*p & 65535)) ;
      p++ ;
      n-- ;
   }
}
int mincover P2C ( long *  ,
what  ,
register  long,
d   
)

Definition at line 923 of file afm2tfm.c.

{
   register int m ;
   register long l ;
   register long *p ;

   nextd = 0x7fffffffL ;
   p = what+1 ;
   m = 1 ;
   while (*p<0x7fffffffL) {
      m++ ;
      l = *p ;
      while (*++p <= l+d) ;
      if (*p-l < nextd) nextd = *p-l ;
   }
   return (m) ;
}
void writesarr P2C ( long *  ,
what  ,
int  ,
len   
)

Definition at line 1131 of file afm2tfm.c.

{
   register long *p ;
   int i ;

   p = what ;
   i = len ;
   while (i) {
      *p = scale(*p) ;
      (void)scale(*p) ; /* need this kludge for some compilers */
      p++ ;
      i-- ;
   }
   writearr(what, len) ;
}

Here is the call graph for this function:

int main P2C ( int  ,
argc  ,
char **  ,
argv   
)

Definition at line 1540 of file afm2tfm.c.

{
#ifndef KPATHSEA
   register int lastext ;
#endif
   register int i ;
   char *p ;
   int arginc ;

   tfmout = (FILE *)NULL ;

   if (argc == 1) {
      usage(stdout) ;
      exit(0) ;
   }

#if defined(MSDOS) || defined(OS2) || defined(ATARIST)
   /* Make VPL file identical to that created under Unix */
   (void)sprintf(titlebuf, "afm2tfm %s", argv[1]) ;
#else
#ifdef VMCMS
   /* Make VPL file identical to that created under Unix */
   (void)sprintf(titlebuf, "afm2tfm %s", argv[1]) ;
#else
   (void)sprintf(titlebuf, "%s %s", argv[0], argv[1]) ;
#endif
#endif
   (void)strcpy(inname, argv[1]) ;
#ifdef KPATHSEA
   if (find_suffix(inname) == NULL)
       (void)strcat(inname, ".afm") ;
#else
   lastext = -1 ;
   for (i=0; inname[i]; i++)
      if (inname[i] == '.')
         lastext = i ;
      else if (inname[i] == '/' || inname[i] == ':')
         lastext = -1 ;
   if (lastext == -1) (void)strcat(inname, ".afm") ;
#endif
   while (argc>2 && *argv[2]=='-') {
      arginc = 2 ;
      i = argv[2][1] ;
      if (i == '/')
         i = argv[2][2] - 32 ; /* /a ==> A for VMS */
      switch (i) {
case 'V': makevpl++ ;
case 'v': makevpl++ ;
         CHECKARG3
         (void)strcpy(outname, argv[3]) ;
#ifdef KPATHSEA
        if (find_suffix(outname) == NULL)
           (void)strcat(outname, ".vpl") ;
#else
         lastext = -1 ;
         for (i=0; outname[i]; i++)
            if (outname[i] == '.')
               lastext = i ;
            else if (outname[i] == '/' || outname[i] == ':')
               lastext = -1 ;
         if (lastext == -1) (void)strcat(outname, ".vpl") ;
#endif
#ifndef VMCMS
#ifndef ATARIST
         if ((vplout=fopen(outname, WRITEBIN))==NULL)
#else
         if ((vplout=fopen(outname, "w"))==NULL)
#endif
#else
         if ((vplout=fopen(outname, "w"))==NULL)
#endif
            error("! can't open vpl output file") ;
         break ;
case 'e': CHECKARG3
          if (sscanf(argv[3], "%f", &efactor)==0 || efactor<0.01)
            error("! Bad extension factor") ;
         efactorparam = argv[3] ;
         break ;
case 'c':
         CHECKARG3
         if (sscanf(argv[3], "%f", &capheight)==0 || capheight<0.01)
            error("! Bad small caps height") ;
         break ;
case 's':
         CHECKARG3
         if (sscanf(argv[3], "%f", &slant)==0)
            error("! Bad slant parameter") ;
         slantparam = argv[3] ;
         break ;
case 'P':
case 'p':
         CHECKARG3
         inenname = argv[3] ;
         break ;
case 'T':
         CHECKARG3
         inenname = outenname = argv[3] ;
         break ;
case 't':
         CHECKARG3
         outenname = argv[3] ;
         break ;
case 'O':
         forceoctal = 1 ;
         arginc = 1 ;
         break ;
case 'u':
         pedantic = 1 ;
         arginc = 1 ;
         break ;
default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n",
                         argv[2], argv[3]) ;
      }
      for (i=0; i<arginc; i++) {
         (void)sprintf(titlebuf + strlen(titlebuf), " %s", argv[2]) ;
         argv++ ;
         argc-- ;
      }
   }

#ifdef KPATHSEA
   afmin = kpse_open_file (inname, kpse_afm_format);
#else /* ! KPATHSEA */
   if ((afmin=fopen(inname, "r"))==NULL)
      error("! can't open afm input file") ;
#endif /* KPATHSEA */
   SET_BINARY(fileno(afmin)) ;

   if (argc>3 || (argc==3 && *argv[2]=='-')) {
     error("! need at most two non-option arguments") ;
     usage(stderr) ;
   }

   if (argc == 2) (void)strcpy(outname, inname) ;
   else (void)strcpy(outname, argv[2]) ;

#ifdef KPATHSEA
   if ((p = find_suffix(outname)) != NULL)
      *(p-1) = 0;
   (void)strcat(outname, ".tfm") ;
   if (tfmout == NULL && (tfmout=fopen(outname, WRITEBIN))==NULL)
      error("! can't open tfm output file") ;
/*
 *   Now we strip off any directory information, so we only use the
 *   base name in the vf file.
 */
   if (p == NULL)
     p = find_suffix(outname);
   *(p-1) = 0;

   p = (char *)xbasename(outname) ;
   strcpy(tmpstr, p);        /* be careful, p and outname are overlapping */
   strcpy(outname, tmpstr);
#else
   lastext = -1 ;
   for (i=0; outname[i]; i++)
      if (outname[i] == '.')
         lastext = i ;
      else if (outname[i] == '/' || outname[i] == ':' || outname[i] == '\\')
         lastext = -1 ;
   if (argc == 2) {
      outname[lastext] = 0 ;
      lastext = -1 ;
   }
   if (lastext == -1) {
      lastext = strlen(outname) ;
      (void)strcat(outname, ".tfm") ;
   }
   if (tfmout == NULL && (tfmout=fopen(outname, WRITEBIN))==NULL)
      error("! can't open tfm output file") ;
   outname[lastext] = 0 ;
/*
 *   Now we strip off any directory information, so we only use the
 *   base name in the vf file.  We accept any of /, :, or \ as directory
 *   delimiters, so none of these are available for use inside the
 *   base name; this shouldn't be a problem.
 */
   for (i=0, lastext=0; outname[i]; i++)
      if (outname[i] == '/' || outname[i] == ':' || outname[i] == '\\')
         lastext = i + 1 ;
   if (lastext)
      strcpy(outname, outname + lastext) ;
#endif
}

Here is the call graph for this function:

struct kern* rmkernmatch P2C ( struct kern ,
,
char *  ,
s   
) [read]

Definition at line 1727 of file afm2tfm.c.

{
   struct kern *nkern ;

   while (k && strcmp(k->succ, s)==0)
      k = k->next ;
   if (k) {
      for (nkern = k; nkern; nkern = nkern->next)
         while (nkern->next && strcmp(nkern->next->succ, s)==0)
            nkern->next = nkern->next->next ;
   }
   return k ;
}

Here is the call graph for this function:

void addkern P2C ( char *  ,
s1  ,
char *  ,
s2   
)

Definition at line 1766 of file afm2tfm.c.

{
  struct adobeinfo *ai1 = findadobe (s1);
  struct adobeinfo *ai2 = findadobe (s2);
  if (ai1 && ai2 && !ai1->kerns) {
    /* Put the new one at the head of the list, since order is immaterial.  */
    struct adobeptr *ap 
      = (struct adobeptr *) mymalloc((unsigned long)sizeof(struct adobeptr));
    ap->next = ai2->kern_equivs;
    ap->ch = ai1;
    ai2->kern_equivs = ap;
  }
}
void makebcpl P3C ( register long *  ,
p  ,
register char *  ,
s  ,
register  int,
n   
)

Definition at line 885 of file afm2tfm.c.

{
   register long t ;
   register long sc ;

   if (strlen(s) < n)
      n = strlen(s) ;
   t = ((long)n) << 24 ;
   sc = 16 ;
   while (n > 0) {
      t |= ((long)(*(unsigned char *)s++)) << sc ;
      sc -= 8 ;
      if (sc < 0) {
         *p++ = t ;
         t = 0 ;
         sc = 24 ;
      }
      n-- ;
   }
   *p++ = t ;
}

Here is the call graph for this function:

void remap P3C ( long *  ,
what  ,
int  ,
oldn  ,
int  ,
newn   
)

Definition at line 943 of file afm2tfm.c.

{
   register int i, j ;
   register long d, l ;

   what[oldn] = 0x7fffffffL ;
   for (i=oldn-1; i>0; i--) {
      d = what[i] ;
      for (j=i; what[j+1]<d; j++) {
         what[j] = what[j+1] ;
         source[j] = source[j+1] ;
      }
      what[j] = d ;
      source[j] = i ;
   } /* Tom, don't let me ever catch you using bubblesort again! -- Don */

   i = mincover(what, 0L) ;
   d = nextd ;
   while (mincover(what,d+d)>newn) d += d ;
   while (mincover(what,d)>newn) d = nextd ;

   i = 1 ;
   j = 0 ;
   while (i<oldn) {
      j++ ;
      l = what[i] ;
      unsort[source[i]] = j ;
      while (what[++i] <= l+d) {
         unsort[source[i]] = j ;
         if (i-j == oldn-newn) d = 0 ;
      }
      what[j] = (l+what[i-1])/2 ;
   }
}
void rmkern P3C ( char *  ,
s1  ,
char *  ,
s2  ,
struct adobeinfo ,
ai   
)

Definition at line 1743 of file afm2tfm.c.

{
   if (ai == 0) {
      if (strcmp(s1, "*") == 0) {
         for (ai=adobechars; ai; ai = ai->next)
            rmkern(s1, s2, ai) ;
         return ;
      } else {
         ai = findadobe(s1) ;
         if (ai == 0)
            return ;
      }
   }
   if (strcmp(s2, "*")==0)
      ai->kerns = 0 ; /* drop them on the floor */
   else
      ai->kerns = rmkernmatch(ai->kerns, s2) ;
}

Here is the call graph for this function:

Definition at line 1207 of file afm2tfm.c.

                 {
   vout("\n") ;
   vlevout() ;
}

Here is the call graph for this function:

Definition at line 1203 of file afm2tfm.c.

               {
   register int l = level ;
   while (l--) vout("   ") ;
}

Here is the caller graph for this function:


Variable Documentation

char* accents[] = { "acute", "tilde", "caron", "dieresis", NULL}

Definition at line 1181 of file afm2tfm.c.

struct adobeinfo * adobeptrs[256]

Definition at line 208 of file afm2tfm.c.

Definition at line 227 of file afm2tfm.c.

Definition at line 161 of file afm2tfm.c.

char buffer[INBUFSIZE+10]

Definition at line 212 of file afm2tfm.c.

float capheight = 0.8

Definition at line 230 of file afm2tfm.c.

long * charinfo

Definition at line 1012 of file afm2tfm.c.

long cksum

Definition at line 228 of file afm2tfm.c.

char* codingscheme = "Unspecified"

Definition at line 216 of file afm2tfm.c.

long * depth

Definition at line 1012 of file afm2tfm.c.

Definition at line 227 of file afm2tfm.c.

float efactor = 1.0

Definition at line 229 of file afm2tfm.c.

char* efactorparam

Definition at line 231 of file afm2tfm.c.

char* encligops[]
Initial value:
 {
   "=:", "|=:", "|=:>", "=:|", "=:|>", "|=:|", "|=:|>", "|=:|>>", 0
}

Definition at line 185 of file afm2tfm.c.

char fixedpitch

Definition at line 222 of file afm2tfm.c.

char* fontname = "Unknown"

Definition at line 215 of file afm2tfm.c.

Definition at line 226 of file afm2tfm.c.

Definition at line 1229 of file afm2tfm.c.

long* header

Definition at line 1012 of file afm2tfm.c.

long * height

Definition at line 1012 of file afm2tfm.c.

Definition at line 162 of file afm2tfm.c.

struct encoding* inencoding = 0

Definition at line 158 of file afm2tfm.c.

char * inenname = NULL

Definition at line 160 of file afm2tfm.c.

char inname[200]

Definition at line 209 of file afm2tfm.c.

char* interesting[]
Initial value:
 { "FontName", "ItalicAngle", "IsFixedPitch",
   "XHeight", "C", "KPX", "CC", "EncodingScheme", NULL}

Definition at line 291 of file afm2tfm.c.

long * italic

Definition at line 1012 of file afm2tfm.c.

float italicangle = 0.0

Definition at line 221 of file afm2tfm.c.

long * kern

Definition at line 1012 of file afm2tfm.c.

Definition at line 1202 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

long * ligkern

Definition at line 1012 of file afm2tfm.c.

struct adobeinfo * lowercase[256]
char makevpl

Definition at line 223 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

double newslant

Definition at line 232 of file afm2tfm.c.

long nextd

Definition at line 921 of file afm2tfm.c.

int nexttex[256]

Definition at line 178 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

Definition at line 864 of file afm2tfm.c.

char obuffer[INBUFSIZE+10]

Definition at line 213 of file afm2tfm.c.

struct encoding* outencoding = 0

Definition at line 157 of file afm2tfm.c.

char* outenname = NULL

Definition at line 159 of file afm2tfm.c.

char outname[200]

Definition at line 209 of file afm2tfm.c.

char* param

Definition at line 214 of file afm2tfm.c.

char pedantic

Definition at line 224 of file afm2tfm.c.

Definition at line 1779 of file afm2tfm.c.

float slant = 0.0

Definition at line 229 of file afm2tfm.c.

char * slantparam

Definition at line 231 of file afm2tfm.c.

char smbuffer[100]

Definition at line 1879 of file afm2tfm.c.

int source[257]

Definition at line 907 of file afm2tfm.c.

char* staticligkern[]

Definition at line 102 of file afm2tfm.c.

struct adobeinfo * texptrs[256]
long* tfmdata

Definition at line 1014 of file afm2tfm.c.

Definition at line 208 of file afm2tfm.c.

char titlebuf[500]

Definition at line 233 of file afm2tfm.c.

char tmpstr[200]

Definition at line 210 of file afm2tfm.c.

long * tparam

Definition at line 1012 of file afm2tfm.c.

int unsort[257]

Definition at line 908 of file afm2tfm.c.

struct adobeinfo * uppercase[256]
char vcharbuf[6]

Definition at line 1231 of file afm2tfm.c.

char vnamebuf[100]

Definition at line 1245 of file afm2tfm.c.

char* vplligops[]
Initial value:
 {
   "LIG", "/LIG", "/LIG>", "LIG/", "LIG/>", "/LIG/", "/LIG/>", "/LIG/>>", 0
}

Definition at line 182 of file afm2tfm.c.

Definition at line 208 of file afm2tfm.c.

long * width

Definition at line 1012 of file afm2tfm.c.

int xheight = 400

Definition at line 225 of file afm2tfm.c.