Back to index

tetex-bin  3.0
Typedefs | Functions
pdfdev.h File Reference
#include "numbers.h"
#include "pdfobj.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef signed long spt_t

Functions

void dev_init (double scale, double x_offset, double y_offset)
void dev_set_verbose (void)
double pdf_dev_scale (void)
void dev_close (void)
void dev_read_mapfile (char *filename)
int dev_locate_font (const char *name, spt_t ptsize)
int dev_font_tfm (int dev_font_id)
spt_t dev_font_sptsize (int dev_font_id)
void dev_close_all_fonts (void)
void dev_bop (void)
void dev_eop (void)
void dev_reselect_font (void)
void dev_set_string (spt_t xpos, spt_t ypos, unsigned char *ch, int len, spt_t width, int font_id)
void dev_set_page_size (double width, double height)
void dev_rule (spt_t xpos, spt_t ypos, spt_t width, spt_t height)
double dev_phys_x (void)
double dev_phys_y (void)
void dev_begin_rgb_color (double r, double g, double b)
void dev_set_def_rgb_color (double r, double g, double b)
void dev_begin_cmyk_color (double c, double m, double y, double k)
void dev_set_def_cmyk_color (double c, double m, double y, double k)
void dev_begin_gray (double value)
void dev_set_def_gray (double value)
void dev_begin_named_color (char *s)
void dev_set_def_named_color (char *s)
void dev_end_color (void)
void dev_do_color (void)
void dev_bg_rgb_color (double r, double g, double b)
void dev_bg_cmyk_color (double c, double m, double y, double k)
void dev_bg_gray (double value)
void dev_bg_named_color (char *s)
void dev_begin_xform (double xscale, double yscale, double rotate, double x_user, double y_user)
void dev_end_xform (void)
int dev_xform_depth (void)
void dev_close_all_xforms (int depth)
void dev_add_comment (char *comment)
void dev_do_special (void *buffer, UNSIGNED_QUAD size, spt_t x_user, spt_t y_user)
double dev_page_height (void)
double dev_page_width (void)
void graphics_mode (void)
void dev_stack_depth (unsigned int depth)
void dev_tag_depth (void)
void dev_set_box (void)
void dev_untag_depth (void)
void dev_expand_box (spt_t width, spt_t height, spt_t depth)
void dev_link_annot (unsigned char flag)

Typedef Documentation

typedef signed long spt_t

Definition at line 32 of file pdfdev.h.


Function Documentation

void dev_add_comment ( char *  comment)

Definition at line 599 of file pdfdev.c.

{
  pdf_doc_creator (comment);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_begin_cmyk_color ( double  c,
double  m,
double  y,
double  k 
)

Definition at line 844 of file pdfdev.c.

{
  if (num_colors >= MAX_COLORS) {
    fprintf (stderr, "\ndev_set_color:  Exceeded depth of color stack\n");
    return;
  }
  colorstack[num_colors].c1 = c;
  colorstack[num_colors].c2 = m;
  colorstack[num_colors].c3 = y;
  colorstack[num_colors].c4 = k;
  colorstack[num_colors].colortype = CMYK;
  num_colors+= 1;
  dev_do_color();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_begin_gray ( double  value)

Definition at line 859 of file pdfdev.c.

{
  if (num_colors >= MAX_COLORS) {
    fprintf (stderr, "\ndev_begin_gray:  Exceeded depth of color stack\n");
    return;
  }
  colorstack[num_colors].c1 = value;
  colorstack[num_colors].colortype = GRAY;
  num_colors+= 1;
  dev_do_color();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_begin_named_color ( char *  s)

Definition at line 813 of file pdfdev.c.

{
  struct color color = color_by_name (s);
  switch (color.colortype) {
  case GRAY:
    dev_begin_gray (color.c1);
    break;
  case RGB:
    dev_begin_rgb_color (color.c1, color.c2, color.c3);
    break;
  case CMYK:
    dev_begin_cmyk_color (color.c1, color.c2, color.c3, color.c4);
    break;
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_begin_rgb_color ( double  r,
double  g,
double  b 
)

Definition at line 830 of file pdfdev.c.

{
  if (num_colors >= MAX_COLORS) {
    fprintf (stderr, "\ndev_set_color:  Exceeded depth of color stack\n");
    return;
  }
  colorstack[num_colors].c1 = r;
  colorstack[num_colors].c2 = g;
  colorstack[num_colors].c3 = b;
  colorstack[num_colors].colortype = RGB;
  num_colors+= 1;
  dev_do_color();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_begin_xform ( double  xscale,
double  yscale,
double  rotate,
double  x_user,
double  y_user 
)

Definition at line 889 of file pdfdev.c.

{
  double c, s;
  if (num_transforms >= MAX_TRANSFORMS) {
    fprintf (stderr, "\ndev_begin_xform:  Exceeded depth of transformation stack\n");
    return;
  }
  c = ROUND (cos(rotate),1e-5);
  s = ROUND (sin(rotate),1e-5);
  sprintf (work_buffer, " q %g %g %g %g %.2f %.2f cm",
          xscale*c, xscale*s, -yscale*s, yscale*c,
          (1.0-xscale*c)*x_user+yscale*s*y_user,
          -xscale*s*x_user+(1.0-yscale*c)*y_user);
  pdf_doc_add_to_page (work_buffer, strlen(work_buffer));
  num_transforms += 1;
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_bg_cmyk_color ( double  c,
double  m,
double  y,
double  k 
)

Definition at line 677 of file pdfdev.c.

{
  background.colortype = CMYK;
  background.c1 = c;
  background.c2 = m;
  background.c3 = y;
  background.c4 = k;
  return;
}

Here is the caller graph for this function:

void dev_bg_gray ( double  value)

Definition at line 687 of file pdfdev.c.

{
  background.colortype = GRAY;
  background.c1 = value;
  return;
}

Here is the caller graph for this function:

void dev_bg_named_color ( char *  s)

Definition at line 694 of file pdfdev.c.

{
  struct color color = color_by_name (s);
  switch (color.colortype) {
  case GRAY:
    dev_bg_gray (color.c1);
    break;
  case RGB:
    dev_bg_rgb_color (color.c1, color.c2, color.c3);
    break;
  case CMYK:
    dev_bg_cmyk_color (color.c1, color.c2, color.c3, color.c4);
    break;
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_bg_rgb_color ( double  r,
double  g,
double  b 
)

Definition at line 668 of file pdfdev.c.

{
  background.colortype = RGB;
  background.c1 = r;
  background.c2 = g;
  background.c3 = b;
  return;
}

Here is the caller graph for this function:

void dev_bop ( void  )

Definition at line 966 of file pdfdev.c.

{
#ifdef MEM_DEBUG
MEM_START
#endif
  if (debug) {
    fprintf (stderr, "dev_bop:\n");
  }
  pdf_doc_new_page ();
  graphics_mode();
  {
    text_slant = 0.0;
    text_extend = 1.0;
  }
  bop_font_reset();
  /* This shouldn't be necessary because line widths are now
     explicitly set for each rule */
  /*  pdf_doc_add_to_page ("0 w", 3); */
  dev_do_color(); /* Set text color since new page loses color state */
#ifdef MEM_DEBUG
MEM_END
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 591 of file pdfdev.c.

{
  /* Set page origin now that user has had plenty of time
     to set page size */
  pdf_doc_set_origin((double) hoffset, (double)
                   dev_page_height()-voffset);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1161 of file pdfdev.c.

{
  int i;
  for (i=0; i<num_dev_fonts; i++) {
    pdf_release_obj (dev_font[i].font_resource);
    RELEASE (dev_font[i].tex_name);
  }
  if (dev_font)
    RELEASE (dev_font);

  /* Release all map entries */
  for (i=0; i<num_font_map; i++) {
    release_map_record (font_map+i);
  }

  if (font_map)
    RELEASE (font_map);
  /* Close the various font handlers */
  type1_close_all();
  pk_close_all();
#ifdef HAVE_TTF_FORMATS   
  ttf_close_all();
#endif   

  /* Now do encodings. */
  encoding_flush_all();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 930 of file pdfdev.c.

{
  if (num_transforms > depth) {
    fprintf (stderr, "\nspecial: Closing pending transformations at end of page/XObject\n");
    while (num_transforms > depth) {
      num_transforms -= 1;
      pdf_doc_add_to_page (" Q", 2);
    }
    dev_reselect_font();
    dev_do_color();
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 757 of file pdfdev.c.

{
  if (num_colors == 0) {
    dev_set_color (default_color);
  } else {
    dev_set_color (colorstack[num_colors-1]);
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_do_special ( void buffer,
UNSIGNED_QUAD  size,
spt_t  x_user,
spt_t  y_user 
)

Definition at line 1259 of file pdfdev.c.

{
  double dev_xuser, dev_yuser;
  dev_xuser = ((double) x_user) / ((double) PDF_U);
  dev_yuser = ((double) -y_user) / ((double) PDF_U);
  graphics_mode();
  if (!pdf_parse_special (buffer, size, dev_xuser, dev_yuser) &&
      !tpic_parse_special (buffer, size, dev_xuser, dev_yuser) &&
      !htex_parse_special (buffer, size) &&
      !color_special (buffer, size) &&
      !ps_parse_special (buffer, size, dev_xuser, dev_yuser) &&
      !src_special (buffer, size)) {
    fprintf (stderr, "\nUnrecognized special ignored");
    dump (buffer, ((char *)buffer)+size);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 871 of file pdfdev.c.

{
  if (num_colors <= 0) {
    fprintf (stderr, "\ndev_set_color:  End color with no corresponding begin color\n");
    return;
  }
  num_colors -= 1;
  dev_do_color();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 908 of file pdfdev.c.

{
  if (num_transforms <= 0) {
    fprintf (stderr, "\ndev_end_xform:  End transform with no corresponding begin\n");
    return;
  }
  pdf_doc_add_to_page (" Q", 2);
  num_transforms -= 1;
  /* Unfortunately, the following two lines are necessary in case of a font or color
     change inside of the save/restore pair.  Anything that was done
     there must be redone, so in effect, we make no assumptions about
     what fonts. We act like we are starting a new page */
  dev_reselect_font();
  dev_do_color();
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_eop ( void  )

Definition at line 990 of file pdfdev.c.

{
#ifdef MEM_DEBUG
MEM_START
#endif
  if (debug) {
    fprintf (stderr, "dev_eop:\n");
  }
  graphics_mode();
  dev_close_all_xforms(0);
  fill_page();
  pdf_doc_finish_page ();
  /* Finish any pending PS specials */
  mp_eop_cleanup();
#ifdef MEM_DEBUG
MEM_END
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_expand_box ( spt_t  width,
spt_t  height,
spt_t  depth 
)

Definition at line 1318 of file pdfdev.c.

{
  double phys_width, phys_height, phys_depth, scale;
  if (link_annot && dvi_stack_depth >= dvi_tagged_depth) {
    scale = dvi2pts*dvi_tell_mag();
    phys_width = scale*width;
    phys_height = scale*height;
    phys_depth = scale*depth;
    pdf_doc_expand_box (dev_phys_x(), dev_phys_y()-phys_depth,
                     dev_phys_x()+phys_width,
                     dev_phys_y()+phys_height);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

spt_t dev_font_sptsize ( int  dev_font_id)
int dev_font_tfm ( int  dev_font_id)
void dev_init ( double  scale,
double  x_offset,
double  y_offset 
)

Definition at line 580 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_link_annot ( unsigned char  flag)

Definition at line 1281 of file pdfdev.c.

Here is the caller graph for this function:

int dev_locate_font ( const char *  name,
spt_t  ptsize 
)

Definition at line 1009 of file pdfdev.c.

{
  int i;
  int this_font;

  if (ptsize == 0) {
    ERROR ("locate_dev_font() called with ptsize = 0");
  }
  /* Make sure we have room for a new one, even though we
     may not actually create one */
  dev_fonts_need (num_dev_fonts+1);
  this_font = num_dev_fonts;
  
  for (i=0; i<this_font; i++) {
    /* PK must match in name and size to resolve to the same device
       font */
    if (dev_font[i].tex_name &&
       strcmp (tex_name, dev_font[i].tex_name) == 0 &&
       dev_font[i].sptsize == ptsize &&
       dev_font[i].format == PK)
      break;
    /* Scaleable fonts must match in name; however, this routine
       must return a different id if the ptsize is different */
    if (dev_font[i].tex_name &&
       strcmp (tex_name, dev_font[i].tex_name) == 0 &&
       dev_font[i].format != PK)
      break;
  }
  if (i == this_font) { /* There is no physical font we can use */
    struct map_record *map_record;
    int font_id = -1, font_format = -1, tfm_id = -1, encoding_id = -1;
    int remap = 0;
    double extend= 1.0, slant = 0.0;
    const char *font_name;
    char short_name[7];
    /* Get appropriate info from map file (yes, PK fonts at two
       different point sizes would be looked up twice unecessarily) */
    if ((map_record = get_map_record (tex_name))) {
      remap = map_record -> remap;
      slant = map_record -> slant;
      extend = map_record -> extend;
      font_name = map_record -> font_name;
    } else {
      font_name = tex_name;
    }
    if (verbose>1){
      if (map_record) {
       fprintf (stderr, "\nfontmap: %s -> %s", tex_name,
               map_record->font_name);
       if (map_record->enc_name)
         fprintf (stderr, "(%s)", map_record->enc_name);
       if (map_record->slant)
         fprintf (stderr, "[slant=%g]", map_record->slant);
       if (map_record->extend != 1.0)
         fprintf (stderr, "[extend=%g]", map_record->extend);
       if (map_record->remap)
         fprintf (stderr, "[remap]");
       fprintf (stderr, "\n");
      } else {
       fprintf (stderr, "\nfontmap: %s (no map)\n", tex_name);
      }
    }
    /* If this font has an encoding specified on the record, get its id */
    if (map_record && map_record -> enc_name != NULL) {
      encoding_id = get_encoding (map_record -> enc_name);
    } else { /* Otherwise set the encoding_id to -1 */
      encoding_id = -1;
    }
    tfm_id = tfm_open (tex_name);
    /* We assume, for now that we will find this as a physical font,
       as opposed to a vf, so we need a device name to tell the
       lower-level routines what we want this to be called.  We'll
       blast this name away later if we don't need it. */
    short_name[0] = 'F';
    inttoa (short_name+1, num_phys_fonts+1);
    if ((font_id = type1_font (font_name, tfm_id,
                            short_name, encoding_id, remap))>=0) {
      font_format = TYPE1;
#ifdef HAVE_TTF_FORMATS
    } else if ((font_id = ttf_font (font_name, tfm_id,
                                short_name, encoding_id, remap))>=0) {
      font_format = TRUETYPE;
#endif /* HAVE_TTF_FORMATS */
    } else if ((font_id = pk_font (font_name, ptsize*dvi2pts,
                               tfm_id,
                               short_name))>=0) {
      font_format = PK;
    }
    if (font_format >= 0) { /* This is a new physical font and we found a physical
                            font we can use */
      strcpy (dev_font[this_font].short_name, short_name);
      dev_font[this_font].tex_name = NEW (strlen (tex_name)+1, char);
      strcpy (dev_font[this_font].tex_name, tex_name);
      dev_font[this_font].sptsize = ptsize;
      dev_font[this_font].format = font_format;
      dev_font[this_font].slant = slant;
      dev_font[this_font].extend = extend;
      dev_font[this_font].remap = remap;
      dev_font[this_font].used_on_this_page = 0;
      switch (font_format) {
      case TYPE1:
       dev_font[this_font].font_resource =
         type1_font_resource(font_id);
       dev_font[this_font].used_chars = type1_font_used(font_id);
       break;
#ifdef HAVE_TTF_FORMATS
      case TRUETYPE:
       dev_font[this_font].font_resource =
         ttf_font_resource(font_id);
       dev_font[this_font].used_chars = ttf_font_used(font_id);
       break;
#endif /* HAVE_TTF_FORMATS */
      case PK:
       dev_font[this_font].font_resource = pk_font_resource (font_id);
       dev_font[this_font].used_chars = pk_font_used(font_id);
       break;
      default:
       ERROR ("Impossible font format in dev_locate_font()");
      }
      num_phys_fonts += 1;
    } else { /* No appropriate physical font exists */
      this_font = -1; /* A flag indicating no physical font */
    }
  } else { /* A previously existing physical font can be used;
             however, this routine must return a distinct ID if the
             ptsizes are different.  Copy the information from the
             previous record to the new record */
    strcpy (dev_font[this_font].short_name, dev_font[i].short_name);
    dev_font[this_font].tex_name = NEW (strlen (tex_name)+1, char);
    strcpy (dev_font[this_font].tex_name, tex_name);
    dev_font[this_font].sptsize = ptsize;
    dev_font[this_font].format = dev_font[i].format;
    dev_font[this_font].used_chars = dev_font[i].used_chars;
    dev_font[this_font].slant = dev_font[i].slant;
    dev_font[this_font].extend = dev_font[i].extend;
    dev_font[this_font].remap = dev_font[i].remap;
    /* The value in useD_on_this_page will be incorrect if the font
       has already been used on a page in a different point size.
       It's too hard to do right.  The only negative consequence is
       that there will be an attempt to add the resource to the page
       resource dict.  However, the second attempt will do nothing */
    dev_font[this_font].used_on_this_page = 0;
    dev_font[this_font].font_resource = pdf_link_obj(dev_font[i].font_resource);
    /* These two fonts are treated as having the same physical
       "used_chars" */
    dev_font[this_font].used_chars = dev_font[i].used_chars;
  }
  if (this_font >= 0)
    num_dev_fonts += 1;
  return this_font;
}

Here is the call graph for this function:

Here is the caller graph for this function:

double dev_page_height ( void  )

Definition at line 87 of file pdfdev.c.

Here is the caller graph for this function:

double dev_page_width ( void  )

Definition at line 81 of file pdfdev.c.

{
  page_size_readonly = 1;
  return page_width;
}

Here is the caller graph for this function:

double dev_phys_x ( void  )

Definition at line 1238 of file pdfdev.c.

{
  return dvi_dev_xpos()*dvi_tell_mag() + hoffset;
}

Here is the call graph for this function:

Here is the caller graph for this function:

double dev_phys_y ( void  )

Definition at line 1243 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_read_mapfile ( char *  filename)

Definition at line 254 of file pdfdev.c.

{
  FILE *mapfile;
  char *full_map_filename, *start = NULL, *end, *tex_name;
  if (verbose > 0)
    fprintf (stderr, "<%s", filename);
  full_map_filename = kpse_find_file (filename, kpse_fontmap_format,
                                  0);
  if (full_map_filename == NULL || 
      (mapfile = MFOPEN (full_map_filename, FOPEN_R_MODE)) == NULL) {
    fprintf (stderr, "Warning:  Couldn't open font map file %s\n", filename);
    mapfile = NULL;
  }
  if (mapfile) {
    while ((start = mfgets (work_buffer, WORK_BUFFER_SIZE, mapfile)) !=
          NULL) {
      end = work_buffer + strlen(work_buffer);
      skip_white (&start, end);
      if (start >= end)
       continue;
      if (*start == '%')
       continue;
      if ((tex_name = parse_ident (&start, end)) == NULL)
       continue;
      /* Parse record line in map file.  First two fields (after TeX font
        name) are position specific.  Arguments start at the first token
        beginning with a  '-' */
      font_maps_need (num_font_map+1);
      init_map_record(font_map+num_font_map);
      font_map[num_font_map].tex_name = tex_name;
      skip_white (&start, end);
      if (*start != '-') {
       font_map[num_font_map].enc_name = parse_ident (&start, end); /* May be null */  
       skip_white (&start, end);
      }
      if (*start != '-') {
       font_map[num_font_map].font_name = parse_ident (&start, end); /* May be null */
       skip_white (&start, end);
      }
      /* Parse any remaining arguments */ 
      while (start+1 < end && *start == '-') {
       char *number;
       switch (*(start+1)) {
       case 's': /* Slant option */
         start += 2;
         skip_white (&start, end);
         if (start < end && 
             (number = parse_number(&start, end))) {
           font_map[num_font_map].slant = atof (number);
           RELEASE (number);
         } else {
           fprintf (stderr, "\n\nMissing slant value in map file for %s\n\n",
                   tex_name);
         }
         break;
       case 'e': /* Extend option */
         start += 2;
         skip_white (&start, end);
         if (start < end && 
             (number = parse_number(&start, end))) {
           font_map[num_font_map].extend = atof (number);
           RELEASE (number);
         } else {
           fprintf (stderr, "\n\nMissing extend value in map file for %s\n\n",
                   tex_name);
         }
         break;
       case 'r': /* Remap option */
         start += 2;
         skip_white (&start, end);
         font_map[num_font_map].remap = 1;
         break;
       default: 
         fprintf (stderr, "\n\nWarning: Unrecognized option in map file %s: -->%s<--\n\n",
                 tex_name, start);
         start = end;
       }
       skip_white (&start, end);
      }
      fill_in_defaults (font_map+num_font_map);
      num_font_map += 1;
    }
    MFCLOSE (mapfile);
    if (verbose > 0)
      fprintf (stderr, ">");
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 950 of file pdfdev.c.

{
  int i;
  current_font = -1;
  for (i=0; i<num_dev_fonts; i++) {
    dev_font[i].used_on_this_page = 0;
  }
  text_slant = 0.0;
  text_extend = 1.0;
}

Here is the caller graph for this function:

void dev_rule ( spt_t  xpos,
spt_t  ypos,
spt_t  width,
spt_t  height 
)

Definition at line 1189 of file pdfdev.c.

{
  int len = 0;
  long w, p1, p2, p3, p4;
  graphics_mode();
   /* Is using a real stroke the right thing to do?  It seems to preserve
      the logical meaning of a "rule" as opposed to a filled rectangle.
      I am assume the reader can more intelligently render a rule than a filled rectangle */
  if (width> height) {  /* Horizontal stroke? */
    w = IDIVRND(height, CENTI_PDF_U);
    p1 = IDIVRND(xpos, CENTI_PDF_U);
    p2 = IDIVRND (2*ypos+height, 2*CENTI_PDF_U);
    p3 = IDIVRND(xpos+width,CENTI_PDF_U);
    p4 = IDIVRND (2*ypos+height, 2*CENTI_PDF_U);
  } else { /* Vertical stroke */
    w = IDIVRND(width,CENTI_PDF_U);
    p1 = IDIVRND (2*xpos+width, 2*CENTI_PDF_U);
    p2 = IDIVRND(ypos, CENTI_PDF_U);
    p3 = IDIVRND (2*xpos+width, 2*CENTI_PDF_U);
    p4 = IDIVRND(ypos+height,CENTI_PDF_U);
  }
  /* This needs to be quick */
  {
    format_buffer[len++] = ' ';
    len += centi_u_to_a (format_buffer+len, w);
    format_buffer[len++] = ' ';
    format_buffer[len++] = 'w';
    format_buffer[len++] = ' ';
    len += centi_u_to_a (format_buffer+len, p1);
    format_buffer[len++] = ' ';
    len += centi_u_to_a (format_buffer+len, p2);
    format_buffer[len++] = ' ';
    format_buffer[len++] = 'm';
    format_buffer[len++] = ' ';
    len += centi_u_to_a (format_buffer+len, p3);
    format_buffer[len++] = ' ';
    len += centi_u_to_a (format_buffer+len, p4);
    format_buffer[len++] = ' ';
    format_buffer[len++] = 'l';
    format_buffer[len++] = ' ';
    format_buffer[len++] = 'S';
  }
  pdf_doc_add_to_page (format_buffer, len);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_set_def_cmyk_color ( double  c,
double  m,
double  y,
double  k 
)

Definition at line 802 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_set_def_gray ( double  value)

Definition at line 777 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 785 of file pdfdev.c.

{
  struct color color = color_by_name (s);
  switch (color.colortype) {
  case GRAY:
    dev_set_def_gray (color.c1);
    break;
  case RGB:
    dev_set_def_rgb_color (color.c1, color.c2, color.c3);
    break;
  case CMYK:
    dev_set_def_cmyk_color (color.c1, color.c2, color.c3, color.c4);
    break;
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_set_def_rgb_color ( double  r,
double  g,
double  b 
)

Definition at line 767 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_set_page_size ( double  width,
double  height 
)

Definition at line 71 of file pdfdev.c.

{
  if (page_size_readonly) {
    fprintf (stderr, "\nSorry.  Too late to change page size\n");
  } else {
    page_width = width;
    page_height = height;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dev_set_string ( spt_t  xpos,
spt_t  ypos,
unsigned char *  ch,
int  len,
spt_t  width,
int  font_id 
)

Definition at line 521 of file pdfdev.c.

{
  int len = 0;
  long kern;
  
  if (font_id != current_font)
    dev_set_font(font_id); /* Force a Tf since we are actually trying
                            to write a character */
  /* Kern is in units of character units, i.e., 1000 = 1 em. */
  /* The following formula is of the form a*x/b where a, x, and b are
     long integers.  Since in integer arithmetic (a*x) could overflow
     and a*(x/b) would not be accurate, we use floating point
     arithmetic rather than trying to do this all with integer
     arithmetic. */
  kern =
    (1000.0/dev_font[font_id].extend*(text_xorigin+text_offset-xpos))/dev_font[font_id].sptsize;
  
  if (labs(ypos-text_yorigin) > CENTI_PDF_U || /* CENTI_PDF_U is smallest resolvable dimension */
      abs(kern) > 32000) { /* Some PDF Readers fail on large kerns */
    text_mode();
    kern = 0;
  }
  if (motion_state != STRING_MODE)
    string_mode(xpos, ypos, dev_font[font_id].slant, dev_font[font_id].extend);
  else if (kern != 0) {
    text_offset -=
      kern*dev_font[font_id].extend*(dev_font[font_id].sptsize/1000.0);
    /* Same issues as earlier.  Use floating point for simplicity */
    /* This routine needs to be fast, so we don't call sprintf() or
       strcpy() */
    format_buffer[len++] = ')';
    len += inttoa (format_buffer+len, kern);
    format_buffer[len++] = '(';
    pdf_doc_add_to_page (format_buffer, len);
    len = 0;
  }
  len += pdfobj_escape_str (format_buffer+len, FORMAT_BUF_SIZE-len, s,
                         length,
                         dev_font[font_id].remap);
  pdf_doc_add_to_page (format_buffer, len);

  /* Record characters used for partial font embedding */
  /* Fonts without pfbs don't get counted and have used_chars set to
     null */
  if (dev_font[font_id].used_chars != NULL) {
    int i;
    if (dev_font[font_id].remap)
      for (i=0; i<length; i++){
       (dev_font[font_id].used_chars)[twiddle(s[i])] = 1;
      }
    else 
      for (i=0; i<length; i++){
       (dev_font[font_id].used_chars)[s[i]] = 1;
      }
  }
  text_offset += width;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file pdfdev.c.

{
  verbose += 1;
}

Here is the caller graph for this function:

void dev_stack_depth ( unsigned int  depth)

Definition at line 1286 of file pdfdev.c.

{
  /* If decreasing below tagged_depth */
  if (link_annot && 
      dvi_stack_depth == dvi_tagged_depth &&
      depth == dvi_tagged_depth - 1) {
  /* See if this appears to be the end of a "logical unit"
     that's been broken.  If so, flush the logical unit */
    pdf_doc_flush_annot();
  }
  dvi_stack_depth = depth;
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1304 of file pdfdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1311 of file pdfdev.c.

{
  dvi_tagged_depth = -1;
  dvi_compute_boxes (0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 925 of file pdfdev.c.

{
  return num_transforms;
}

Here is the caller graph for this function:

Definition at line 413 of file pdfdev.c.

{
  switch (motion_state) {
  case GRAPHICS_MODE:
    break;
  case STRING_MODE:
    pdf_doc_add_to_page (")]TJ", 4);
  case TEXT_MODE:
    pdf_doc_add_to_page (" ET", 3);
    break;
  }
  motion_state = GRAPHICS_MODE;
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

double pdf_dev_scale ( void  )

Definition at line 141 of file pdfdev.c.

{
  return 65800.0*dvi2pts;
}

Here is the caller graph for this function: