Ejemplo n.º 1
0
void lfmxsp(smpar *sp, mxArray *mcell, int d)
{ double *alpha;
  char str[16];

  alpha = mxGetPr(mxGetField(mcell,0,"alpha"));
  nn(sp)  = alpha[0];
  fixh(sp)= alpha[1];
  pen(sp) = alpha[2];

  mxGetString(mxGetField(mcell,0,"adaptive_criterion"),str,16);
  acri(sp) = lfacri(str);

  deg(sp) = mxGetPr(mxGetField(mcell,0,"degree"))[0];
  deg0(sp) = -1;

  mxGetString(mxGetField(mcell,0,"family"),str,16);
  fam(sp) = lffamily(str);
  mxGetString(mxGetField(mcell,0,"link"),str,16);
  link(sp) = lflink(str);
  setfamily(sp);

  mxGetString(mxGetField(mcell,0,"kernel"),str,16);
  ker(sp) = lfkernel(str);
  mxGetString(mxGetField(mcell,0,"kernel_type"),str,16);
  kt(sp) = lfketype(str);
  npar(sp) = calcp(sp,d);

  de_renorm = (int)(mxGetPr(mxGetField(mcell,0,"deren"))[0]);
  mxGetString(mxGetField(mcell,0,"deit"),str,16);
  de_itype = deitype(str);
  de_mint = (int)(mxGetPr(mxGetField(mcell,0,"demint"))[0]);
  lf_debug = (int)(mxGetPr(mxGetField(mcell,0,"debug"))[0]);
}
Ejemplo n.º 2
0
/*
 * String p should be start after the ":" in a font declaration of the form
%*FONT: <tfm-name> <scaled-size> <design-size> <2-hex-digits>:<hex-string>
 * where the sizes are floating-point numbers in units of PostScript points
 * (TeX's "bp").  We update the data structures for the included font,
 * charge fontmem for the VM used, and add to delchar if necessary.
 * Note that the scaled size and the design size are multiplied by mag/1000.
 * This is needed for the design size to undo the similar factor in conv since
 * design sizes are not supposed to be affected by magnification.  Applying
 * the magnification factor to the scaled size selects magnified fonts as is
 * appropriate in the normal case where the included PostScript is scaled by
 * mag/1000.  The definition of `fshow' in finclude.lpro unscales by `DVImag'
 * to account for this.  We cannot change the font scaled size to account for
 * options like `hscale=' because then the definition of `fshow' would have
 * to change.
 */
static void
scan1fontcomment(char *p)
{
   char *q, *name, *area;
   char *scname;      /* location in buffer where we got scsize */
   integer scsize, dssize;
   fontdesctype *fptr;
   real DVIperBP;

   DVIperBP = actualdpi/(72.0*conv) * (mag/1000.0);
   p = strtok(p, " ");
   if (p==NULL) return;
   area = nextstring;   /* tentatively in the string pool */
   name = getname(p);
   q = strtok((char *)0, " ");
   if (p==NULL || (scsize=(integer)(atof(q)*DVIperBP))==0) {
      fprintf(stderr, "%s\n",p);
      error("No scaled size for included font");
      nextstring = area;   /* remove from string pool */
      return;
   }
   scname = q;
   q = strtok((char *)0, " ");
   if (p==NULL || (dssize=(integer)(atof(q)*DVIperBP))==0) {
      fprintf(stderr, "%s\n",p);
      error("No design size for included font");
      nextstring = area;
      return;
   }
   q = strtok((char *)0, " ");
   fptr = matchfont(name, area, scsize, scname);
   if (!fptr) {
      fptr = ifontdef(name, area, scsize, dssize, newstring(scname));
      (void) preselectfont(fptr);
      setfamily(fptr);
   } else {
      nextstring = area;   /* remove from string pool */
      (void) preselectfont(fptr);
      if (fptr->scalename==NULL) {
         fptr->scalename=newstring(scname);
         setfamily(fptr);
      }
   }
   includesfonts = 1;
   fptr->psflag |= THISPAGE;
   includechars(fptr, q);
}