Back to index

tetex-bin  3.0
Functions | Variables
dpicheck.c File Reference
#include "dvips.h"

Go to the source code of this file.

Functions

void addsiz P1C (int, rhsize)
void adddpi P1C (int, hsize)
halfword dpicheck P1C (halfword, dpi)

Variables

int actualdpi
static integer existsizes [30] = { 0 , 99999999 }
static int checkdpi

Function Documentation

void addsiz P1C ( int  ,
rhsize   
)

Definition at line 16 of file dpicheck.c.

{
   register integer *p ;
   long t, hsize ;

   hsize = rhsize ;
   for (p=existsizes; *p < hsize; p++) ;
   if (*p == hsize)
      return ;
   do {
      t = *p ;
      *p++ = hsize ;
      hsize = t ;
   } while (hsize) ;
}
void adddpi P1C ( int  ,
hsize   
)

Definition at line 31 of file dpicheck.c.

{
   long a, b, c ;
   int i ;

   addsiz(hsize) ;
   addsiz((int)((hsize * 116161L + 53020L) / 106040L)) ;
   a = hsize ;
   b = 0 ;
   c = 1 ;
   for (i=0; i<9; i++) {
      b = 6 * b + (a % 5) * c ;
      a = a + a / 5 ;
      c = c * 5 ;
      if (b > c) {
         b -= c ;
         a++ ;
      }
      if (b + b >= c)
         addsiz((int)(a+1)) ;
      else
         addsiz((int)a) ;
   }
}
halfword dpicheck P1C ( halfword  ,
dpi   
)

Definition at line 59 of file dpicheck.c.

{
   integer i ;
   integer margin = 1 + dpi / 500 ;

   if (! checkdpi) {
      adddpi(DPI) ;
      checkdpi = 1 ;
   }
   for (i=0; existsizes[i] < dpi; i++) ;
   if (existsizes[i]-dpi <= margin)
      return(existsizes[i]) ;
   else if (dpi-existsizes[i-1] <= margin)
      return(existsizes[i-1]) ;
   else
      return(dpi) ;
}

Variable Documentation

Definition at line 103 of file dvips.c.

int checkdpi [static]

Definition at line 12 of file dpicheck.c.

integer existsizes[30] = { 0 , 99999999 } [static]

Definition at line 11 of file dpicheck.c.