Back to index

tetex-bin  3.0
ptexlib.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
00003 
00004 This file is part of pdfTeX.
00005 
00006 pdfTeX is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 pdfTeX is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with pdfTeX; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 $Id: //depot/Build/source.development/TeX/texk/web2c/pdftexdir/ptexlib.h#24 $
00021 */
00022 
00023 #ifndef PDFTEXLIB
00024 #define PDFTEXLIB
00025 
00026 /* WEB2C macros and prototypes */
00027 #if !defined(PDFTEXCOERCE) && !defined(PDFETEXCOERCE) && !defined(PDFXTEXCOERCE)
00028 #ifdef pdfTeX
00029 #undef pdfTeX /* to avoid warning about redefining pdfTeX in pdftexd.h */
00030 #endif /* pdfTeX */
00031 #define EXTERN extern
00032 #include "pdftexd.h"
00033 #endif
00034 
00035 /* pdftexlib macros */
00036 #include "ptexmac.h"
00037 
00038 /* pdftexlib type declarations */
00039 typedef struct {
00040     const char *pdfname;
00041     const char *t1name;
00042     float value;
00043     boolean valid;
00044 } key_entry;
00045 
00046 typedef struct {
00047     boolean loaded;                 /* the encoding has been loaded? */
00048     boolean updated;                /* glyph names have been updated for 0--32 chars? */
00049     internalfontnumber firstfont;   /* first font that has accessed to this
00050                                        encoding; move chars 0--32 to higher
00051                                        area according to this font */
00052     char *name;                     /* encoding file name */
00053     integer objnum;                 /* object number */
00054     char **glyph_names;
00055 } enc_entry;
00056 
00057 typedef struct {
00058     char *tfm_name;             /* TFM file name */
00059     char *ps_name;              /* PostScript name */
00060     integer flags;              /* font flags */
00061     char *ff_name;              /* font file name */
00062     char *subset_tag;           /* pseudoUniqueTag for subsetted font */
00063     enc_entry *encoding;        /* pointer to corresponding encoding */
00064     internalfontnumber tfm_num; /* number of the TFM refering this entry */
00065     unsigned short type;        /* font type (T1/TTF/...) */
00066     short slant;                /* SlantFont */
00067     short extend;               /* ExtendFont */
00068     integer ff_objnum;          /* FontFile object number */
00069     integer fn_objnum;          /* FontName/BaseName object number */
00070     integer fd_objnum;          /* FontDescriptor object number */
00071     char *charset;              /* string containing used glyphs */
00072     boolean all_glyphs;         /* embed all glyphs? */
00073     unsigned short links;       /* link flags from tfm_tree and ps_tree */
00074     short tfm_avail;            /* flags whether a tfm is available */
00075 } fm_entry;
00076 
00077 typedef struct {
00078     char *ff_name;              /* base name of font file */
00079     char *ff_path;              /* full path to font file */
00080 } ff_entry;
00081 
00082 typedef short shalfword ;
00083 typedef struct {
00084    integer charcode,
00085            cwidth, 
00086            cheight,
00087            xoff, 
00088            yoff, 
00089            xescape,
00090            rastersize;
00091    halfword *raster;
00092 } chardesc;
00093 
00094 /* pdftexlib variable declarations */
00095 extern boolean fontfile_found;
00096 extern boolean is_otf_font;
00097 extern boolean true_dimen;
00098 extern boolean write_ttf_glyph_names;
00099 extern char **t1_glyph_names, *t1_builtin_glyph_names[];
00100 extern char *cur_file_name;
00101 extern const char notdef[];
00102 extern fm_entry *fm_cur;
00103 extern integer t1_length1, t1_length2, t1_length3;
00104 extern integer ttf_length;
00105 extern internalfontnumber tex_font;
00106 extern key_entry font_keys[];
00107 extern strnumber last_tex_string;
00108 extern size_t last_ptr_index;
00109 extern char fontname_buf[];
00110 
00111 /* pdftexlib function prototypes */
00112 
00113 /* epdf.c */
00114 extern integer get_fontfile_num(int);
00115 extern integer get_fontname_num(int);
00116 extern void epdf_free(void);
00117 
00118 /* mapfile.c */
00119 extern char *mk_basename(char *);
00120 extern char *mk_exname(char *, int);
00121 extern fm_entry * lookup_fontmap(char *);
00122 extern boolean hasfmentry(internalfontnumber);
00123 extern internalfontnumber tfmoffm(fmentryptr);
00124 extern void checkextfm(strnumber, integer);
00125 extern void fm_free(void);
00126 extern void fm_read_info(void);
00127 extern ff_entry * check_ff_exist(fm_entry *);
00128 extern void pdfmapfile(integer);
00129 extern void pdfmapline(integer);
00130 
00131 /* papersiz.c */
00132 extern integer myatodim(char **);
00133 extern integer myatol(char **);
00134 
00135 /* pkin.c */
00136 extern int readchar(boolean, chardesc *);
00137 
00138 /* utils.c */
00139 extern boolean str_eq_cstr(strnumber, char *);
00140 extern char *makecstring(integer);
00141 extern int xfflush(FILE *);
00142 extern int xgetc(FILE *);
00143 extern int xputc(int, FILE *);
00144 extern scaled extxnoverd(scaled, scaled, scaled);
00145 extern size_t xfwrite(void *, size_t size, size_t nmemb, FILE *);
00146 extern strnumber getresnameprefix(void);
00147 extern strnumber maketexstring(const char *);
00148 extern integer fb_offset(void);
00149 extern void fb_flush(void);
00150 extern void fb_putchar(eightbits b);
00151 extern void fb_seek(integer);
00152 extern void libpdffinish(void);
00153 extern void make_subset_tag(fm_entry *, char **);
00154 extern void pdf_printf(const char *,...);
00155 extern void pdf_puts(const char *);
00156 extern void pdftex_fail(const char *,...);
00157 extern void pdftex_warn(const char *,...);
00158 extern void setjobid(int, int, int, int, int, int);
00159 extern void tex_printf(const char *, ...);
00160 extern void writestreamlength(integer, integer);
00161 extern char *convertStringToPDFString(char *in);
00162 extern void printID(strnumber);
00163 
00164 /* vfpacket.c */
00165 extern eightbits packetbyte(void);
00166 extern integer newvfpacket(internalfontnumber);
00167 extern void poppacketstate(void);
00168 extern void pushpacketstate(void);
00169 extern void startpacket(internalfontnumber, integer);
00170 extern void storepacket(integer, integer, integer);
00171 extern void vf_free(void);
00172 
00173 /* writeenc.c */
00174 extern boolean get_enc(fm_entry *);
00175 extern boolean indexed_enc(fm_entry *);
00176 extern enc_entry *add_enc(char *);
00177 extern void enc_free(void);
00178 extern void read_enc(enc_entry *);
00179 extern void setcharmap(internalfontnumber);
00180 extern void write_enc(char **, enc_entry *, integer);
00181 
00182 /* writefont.c */
00183 extern void dopdffont(integer, internalfontnumber);
00184 extern void update_enc(internalfontnumber, char **);
00185 
00186 /* writeimg.c */
00187 extern boolean checkimageb(integer);
00188 extern boolean checkimagec(integer);
00189 extern boolean checkimagei(integer);
00190 extern boolean ispdfimage(integer);
00191 extern integer epdforigx(integer);
00192 extern integer epdforigy(integer);
00193 extern integer imageheight(integer);
00194 extern integer imagepages(integer);
00195 extern integer imagewidth(integer);
00196 extern integer imagexres(integer);
00197 extern integer imageyres(integer);
00198 extern integer readimage(strnumber, integer, strnumber, integer, integer, integer, integer);
00199 extern void deleteimage(integer);
00200 extern void img_free(void) ;
00201 extern void updateimageprocset(integer);
00202 extern void writeimage(integer);
00203 
00204 /* writet1.c */
00205 extern boolean t1_read_enc(fm_entry *);
00206 extern boolean t1_subset(char *, char *, unsigned char *);
00207 extern void load_enc(char *, char **);
00208 extern void writet1(void);
00209 extern void t1_free(void);
00210 
00211 /* writet3.c */
00212 extern void writet3(int, internalfontnumber);
00213 extern scaled getpkcharwidth(internalfontnumber, scaled);
00214 
00215 /* writettf.c */
00216 extern void writettf(void);
00217 extern void writeotf(void);
00218 
00219 /* writezip.c */
00220 extern void writezip(boolean);
00221 
00222 /* avlstuff.c */
00223 extern void avlputobj(integer, integer);
00224 extern integer avlfindobj(integer, integer, integer);
00225 
00226 #endif  /* PDFTEXLIB */