[BACK]Return to term_ps.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/term_ps.c between version 1.50 and 1.53

version 1.50, 2011/05/15 00:58:48 version 1.53, 2011/09/18 14:14:15
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 429  static struct termp *
Line 429  static struct termp *
 pspdf_alloc(char *outopts)  pspdf_alloc(char *outopts)
 {  {
         struct termp    *p;          struct termp    *p;
         size_t           pagex, pagey, marginx, marginy, lineheight;          unsigned int     pagex, pagey;
           size_t           marginx, marginy, lineheight;
         const char      *toks[2];          const char      *toks[2];
         const char      *pp;          const char      *pp;
         char            *v;          char            *v;
   
         p = term_alloc(TERMENC_ASCII);          p = mandoc_calloc(1, sizeof(struct termp));
           p->enc = TERMENC_ASCII;
         p->ps = mandoc_calloc(1, sizeof(struct termp_ps));          p->ps = mandoc_calloc(1, sizeof(struct termp_ps));
   
         p->advance = ps_advance;          p->advance = ps_advance;
Line 484  pspdf_alloc(char *outopts)
Line 486  pspdf_alloc(char *outopts)
                 } else if (0 == strcasecmp(pp, "legal")) {                  } else if (0 == strcasecmp(pp, "legal")) {
                         pagex = 216;                          pagex = 216;
                         pagey = 356;                          pagey = 356;
                 } else if (2 != sscanf(pp, "%zux%zu", &pagex, &pagey))                  } else if (2 != sscanf(pp, "%ux%u", &pagex, &pagey))
                         fprintf(stderr, "%s: Unknown paper\n", pp);                          fprintf(stderr, "%s: Unknown paper\n", pp);
         } else if (NULL == pp)          } else if (NULL == pp)
                 pp = "letter";                  pp = "letter";
Line 512  pspdf_alloc(char *outopts)
Line 514  pspdf_alloc(char *outopts)
   
         lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4));          lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4));
   
         p->ps->width = pagex;          p->ps->width = (size_t)pagex;
         p->ps->height = pagey;          p->ps->height = (size_t)pagey;
         p->ps->header = pagey - (marginy / 2) - (lineheight / 2);          p->ps->header = pagey - (marginy / 2) - (lineheight / 2);
         p->ps->top = pagey - marginy;          p->ps->top = pagey - marginy;
         p->ps->footer = (marginy / 2) - (lineheight / 2);          p->ps->footer = (marginy / 2) - (lineheight / 2);

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.53

CVSweb