1 #ifndef EMBED_PDF_H
2 #define EMBED_PDF_H
3 
4 // all the necessary information for pdf font embedding
5 typedef struct {
6   char *fontname;
7   unsigned int flags;
8 
9   // for the following: 0=not set/invalid
10   int bbxmin,bbymin,bbxmax,bbymax;
11   int italicAngle;    // >=90: not set/invalid
12   int ascent;
13   int descent;
14   int capHeight;
15   int stemV;
16   // optional, default=0:
17   int xHeight;
18   int avgWidth;
19 
20   // CID-additions:
21   char *panose; // 12 bytes
22   char *registry,*ordering;
23   int supplement;
24 
25   char data[1]; // used for storing e.g. >fontname
26 } EMB_PDF_FONTDESCR;
27 
28 typedef struct {
29   // normal font
30   int first,last;
31   int *widths;
32 
33   // multibyte font
34   int default_width;
35   int *warray; // format: (len c w ... w)*   if (len<0) { c1 (c2=c1+(-len)) w } else { c w[len] }, terminated by len==0
36 
37   int data[1];
38 } EMB_PDF_FONTWIDTHS;
39 
40 const char *emb_pdf_get_font_subtype(EMB_PARAMS *emb);
41 const char *emb_pdf_get_fontfile_key(EMB_PARAMS *emb);
42 const char *emb_pdf_get_fontfile_subtype(EMB_PARAMS *emb);
43 
44 EMB_PDF_FONTDESCR *emb_pdf_fontdescr(EMB_PARAMS *emb);
45 EMB_PDF_FONTWIDTHS *emb_pdf_fontwidths(EMB_PARAMS *emb);
46 
47 /** TODO elsewhere **/
48 char *emb_pdf_simple_fontdescr(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,int fontfile_obj_ref);
49 char *emb_pdf_simple_font(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,EMB_PDF_FONTWIDTHS *fwid,int fontdescr_obj_ref);
50 char *emb_pdf_simple_cidfont(EMB_PARAMS *emb,const char *fontname,int descendant_obj_ref);
51 char *emb_pdf_simple_stdfont(EMB_PARAMS *emb);
52 
53 #endif
54