Back to index

tetex-bin  3.0
t1global.h
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------------
00002   ----- File:        t1global.h
00003   ----- Author:      Rainer Menzner (Rainer.Menzner@web.de)
00004   ----- Date:        2001-04-01
00005   ----- Description: This file is part of the t1-library. It contains
00006                      global declarations used by the t1-library.
00007   ----- Copyright:   t1lib is copyrighted (c) Rainer Menzner, 1996-2001. 
00008                      As of version 0.5, t1lib is distributed under the
00009                    GNU General Public Library Lincense. The
00010                    conditions can be found in the files LICENSE and
00011                    LGPL, which should reside in the toplevel
00012                    directory of the distribution.  Please note that 
00013                    there are parts of t1lib that are subject to
00014                    other licenses:
00015                    The parseAFM-package is copyrighted by Adobe Systems
00016                    Inc.
00017                    The type1 rasterizer is copyrighted by IBM and the
00018                    X11-consortium.
00019   ----- Warranties:  Of course, there's NO WARRANTY OF ANY KIND :-)
00020   ----- Credits:     I want to thank IBM and the X11-consortium for making
00021                      their rasterizer freely available.
00022                    Also thanks to Piet Tutelaers for his ps2pk, from
00023                    which I took the rasterizer sources in a format
00024                    independent from X11.
00025                      Thanks to all people who make free software living!
00026 --------------------------------------------------------------------------*/
00027   
00028 
00029 #include "t1misc.h"
00030 
00031 
00032 /* Following struct will allow all accesses to font data! */
00033 struct FONTBASE
00034 {
00035   int t1lib_flags;    /* Global library flags */
00036   int no_fonts_ini;   /* The number of fonts initially declared in
00037                       Font database file. */
00038   int no_fonts;       /* The number of currently allocated fonts including
00039                       logical fonts produced by T1_CopyFont() */
00040   int no_fonts_limit; /* The maximum number of font for which is memory
00041                       currently available. */
00042   int bitmap_pad;     /* The value to which bitmap-scanlines are padded */
00043   int endian;         /* 1 if little endian representation and 0 otherwise */
00044   char **default_enc; /* The default encoding vector */
00045   FONTPRIVATE *pFontArray; /* Points to first element of font pointer array */
00046 } FontBase;
00047 struct FONTBASE *pFontBase=NULL;
00048 
00049 
00050 
00051 /* Further we need a struct where to save device dependent data such as
00052    resolution. The values in this struct may be altered using
00053    T1_SetDeviceRes(x_res,y_res). Generally, the fontsize is to be specified
00054    in BigPoints ("bp")---this is the default PostScript unit. It is
00055    1in=72bp.
00056    */
00057 typedef struct 
00058 {
00059   float x_resolution;              /* Value must be specified in DPI */
00060   float y_resolution;              /* Value must be specified in DPI */
00061   float scale_x;                   /* horizontal scale-value to get a
00062                                   matrix scaled to 1b */
00063   float scale_y;                   /* vertical scale-value to get a
00064                                   matrix scaled to 1b */
00065 } DEVICESPECIFICS;
00066 
00067 DEVICESPECIFICS DeviceSpecifics = { DEFAULT_RES,
00068                                 DEFAULT_RES,
00069                                 DEFAULT_RES/BIGPOINTSPERINCH,
00070                                 DEFAULT_RES/BIGPOINTSPERINCH
00071 };
00072 
00073 
00074 
00075 struct stat filestats; /* A structure where fileinfo is stored */
00076 char linebuf[BUF_SIZE];   /* A buffer for reading files line
00077                                         by line */
00078 int T1_Up=0;     /* This one is for initialization-checking */
00079 
00080 /* The width of AA-pixels */
00081 int T1aa_bpp;
00082 
00083 /* The follwoing variable allows the primary rastering functions
00084    to check for the caller */
00085 int SetFuncRequestID=0;
00086 
00087 /* The following variable allows to suppress rastering at 1000 bp
00088    for getting a correct bounding box for slanted characters -->
00089    should only internally be used */
00090 int ForceAFMBBox=0;
00091 
00092 extern struct XYspace *IDENTITY; 
00093 
00094 int errornumber;  /* for debugging purposes */
00095  
00096 /* The following pointers should be set to path-strings--used for locating
00097    type1, afm and encoding files */
00098 char** T1_PFAB_ptr=NULL;
00099 char** T1_AFM_ptr=NULL;
00100 char** T1_ENC_ptr=NULL;
00101 char** T1_FDB_ptr=NULL;
00102 
00103 /* We use a uchar buffer for error and warning messages: */
00104 char err_warn_msg_buf[1024];
00105 
00106 /* file pointer for log-file */
00107 FILE *t1lib_log_file=NULL;
00108 int  t1lib_log_level=2;
00109 
00110 /* The errno for t1lib */
00111 int T1_errno=0;
00112 
00113 /* A variable for saving stack info */
00114 jmp_buf stck_state;
00115