~ubuntu-branches/ubuntu/jaunty/cups/jaunty

« back to all changes in this revision

Viewing changes to debian/local/filters/pdf-filters/filter/fontembed/embed.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2009-02-15 18:39:03 UTC
  • mfrom: (6.1.30 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090215183903-i0nhvqyqj4vyn52a
Tags: 1.3.9-13
[ Till Kamppeter ]
* debian/local/filters/pdf-filters/filter/imagetopdf.c: Added support for
  the new "fit-to-page" option (new, more intuitive name for "fitplot").
* debian/filters/pstopdf: Only apply paper size if the "fitplot" or the
  "fit-to-page" option is set.
* debian/local/filters/cpdftocps: Only the last digit of the number of
  copies was used (LP: #309314).
* debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Do not preceed the
  PDF output with a newline (LP: #303691). Only impose the page size from
  the PPD file to all pages if the "fitplot" or the "fit-to-page" option is 
  set. This prevented from automatic paper tray switching to the correct paper
  sizes when a multiple-page-size document is printed (partial fix for
  LP: #310575).
* debian/patches/pdftops-cups-1.4.dpatch: Updated from CUPS 1.4 SVN. Contains
  fixes for multiple-page-size document printing (partial fix for
  LP: #310575).
* debian/patches/pdftops-dont_fail_on_cancel.dpatch: Removed, should be
  fixed in the new upstream version of pdftops.

[ Martin Pitt ]
* debian/patches/pdftops-cups-1.4.dpatch: Add definition of
  HAVE_PDFTOPS and CUPS_PDFTOPS, so that the filter actually gets
  again built with pdftops support. (Fixes Till's change from above).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef EMBED_H
 
2
#define EMBED_H
 
3
 
 
4
#include "bitset.h"
 
5
#include "fontfile.h"
 
6
#include "iofn.h"
 
7
 
 
8
typedef enum { EMB_INPUT_T1,     // type1-lib, with AFM/PFM,PFA/PFB
 
9
               EMB_INPUT_TTF,    // sfnt-lib, for TTF(glyf)
 
10
               EMB_INPUT_OTF,    // sfnt-lib + cff-lib, for OTF
 
11
               EMB_INPUT_CFF,    // cff-lib, for raw CFF
 
12
               EMB_INPUT_STDFONT // don't embed (already present)
 
13
               } EMB_INPUT_FORMAT;
 
14
typedef enum { EMB_OUTPUT_T1,    // original type1
 
15
               EMB_OUTPUT_TTF,   // ttf(glyf)
 
16
               EMB_OUTPUT_CFF,   // raw cff
 
17
               EMB_OUTPUT_SFNT   // OpenType (cff or glyf)
 
18
               } EMB_OUTPUT_FORMAT;
 
19
typedef enum { EMB_DEST_NATIVE,  // just subsetting/conversion
 
20
               EMB_DEST_PS, 
 
21
               EMB_DEST_PDF16  // TODO? PDF13
 
22
               } EMB_DESTINATION;
 
23
 
 
24
typedef enum { EMB_RIGHT_FULL=0, EMB_RIGHT_NONE=0x02,
 
25
               EMB_RIGHT_READONLY=0x04, 
 
26
               EMB_RIGHT_NO_SUBSET=0x0100,
 
27
               EMB_RIGHT_BITMAPONLY=0x0200 } EMB_RIGHT_TYPE;
 
28
 
 
29
typedef enum { EMB_A_MULTIBYTE=0x01,    // embedd as multibyte font?
 
30
               EMB_A_SUBSET=0x02,       // do subsetting?
 
31
               EMB_A_CONVERT_CFF=0x04,  // convert Type1 to CFF?
 
32
               EMB_A_WRAP_SFNT=0x08,    // wrap in sfnt? (OTF)
 
33
 
 
34
               EMB_A_CLOSE_FONTFILE=0x8000
 
35
               } EMB_ACTIONS;
 
36
 
 
37
typedef struct _EMB_PARAMS {
 
38
  EMB_INPUT_FORMAT intype;
 
39
  EMB_OUTPUT_FORMAT outtype;
 
40
  EMB_DESTINATION dest;
 
41
 
 
42
  EMB_ACTIONS plan;
 
43
 
 
44
  // font infos
 
45
  FONTFILE *font;
 
46
  EMB_RIGHT_TYPE rights;
 
47
// public:
 
48
  BITSET subset;
 
49
 
 
50
} EMB_PARAMS;
 
51
 
 
52
typedef enum { EMB_C_MUST_SUBSET=0x01,     // (fail, when not possible)
 
53
               EMB_C_EDITABLE_SUBSET=0x02, // (...)
 
54
               EMB_C_NEVER_SUBSET=0x04,    // (...)
 
55
 
 
56
               EMB_C_FORCE_MULTIBYTE=0x08, // always use multibyte fonts
 
57
 
 
58
               EMB_C_PDF_OT=0x10, // output CFF and even TTF as OpenType (for PDF)
 
59
               EMB_C_KEEP_T1=0x20, // don't convert T1 to CFF
 
60
 
 
61
               EMB_C_TAKE_FONTFILE=0x8000 // take ownership of fontfile
 
62
               } EMB_CONSTRAINTS;
 
63
 
 
64
EMB_PARAMS *emb_new(FONTFILE *font,EMB_DESTINATION dest,EMB_CONSTRAINTS mode);
 
65
int emb_embed(EMB_PARAMS *emb,OUTPUT_FN output,void *context); // returns number of bytes written
 
66
void emb_close(EMB_PARAMS *emb);
 
67
 
 
68
/*** PDF out stuff ***/
 
69
// all the necessary information for pdf font embedding
 
70
typedef struct {
 
71
  char *fontname;
 
72
  unsigned int flags;
 
73
 
 
74
  // for the following: 0=not set/invalid
 
75
  int bbxmin,bbymin,bbxmax,bbymax;
 
76
  int italicAngle;    // >=90: not set/invalid
 
77
  int ascend;
 
78
  int descend;
 
79
  int capHeight;
 
80
  int stemV;
 
81
  // optional, default=0:
 
82
  int xHeight;
 
83
  int avgWidth;
 
84
 
 
85
  // CID-additions:
 
86
  char *panose; // 12 bytes
 
87
  char *registry,*ordering;
 
88
  int supplement;
 
89
 
 
90
  char data[]; // used for storing e.g. >fontname
 
91
} EMB_PDF_FONTDESCR;
 
92
 
 
93
typedef struct {
 
94
  // normal font
 
95
  int first,last;
 
96
  int *widths;
 
97
 
 
98
  // multibyte font
 
99
  int default_width;
 
100
  int *warray; // format: len c w ... w   if (len<0) { c1 (c2=c1+(-len)) w } else { c w[len] }, terminated by len==0
 
101
 
 
102
  int data[];
 
103
} EMB_PDF_FONTWIDTHS;
 
104
 
 
105
const char *emb_pdf_get_font_subtype(EMB_PARAMS *emb);
 
106
const char *emb_pdf_get_fontfile_key(EMB_PARAMS *emb);
 
107
const char *emb_pdf_get_fontfile_subtype(EMB_PARAMS *emb);
 
108
 
 
109
EMB_PDF_FONTDESCR *emb_pdf_fontdescr(EMB_PARAMS *emb);
 
110
EMB_PDF_FONTWIDTHS *emb_pdf_fontwidths(EMB_PARAMS *emb);
 
111
 
 
112
char *emb_pdf_simple_fontdescr(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,int fontfile_obj_ref);
 
113
char *emb_pdf_simple_font(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,EMB_PDF_FONTWIDTHS *fwid,int fontdescr_obj_ref);
 
114
char *emb_pdf_simple_cidfont(EMB_PARAMS *emb,const char *fontname,int descendant_obj_ref);
 
115
char *emb_pdf_simple_stdfont(EMB_PARAMS *emb);
 
116
 
 
117
#endif