summaryrefslogtreecommitdiff
path: root/gs/src/gdevpdtx.h
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2002-06-25 01:51:32 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2002-06-25 01:51:32 +0000
commit0ecf8cbb41632d1c042146df35a7a9dd10cd5dbc (patch)
tree8f2fc60c2af1f2246038c0460a2bd479ebd0be28 /gs/src/gdevpdtx.h
parent1524b2fdb7fffec9dcd4c0b77334d72ecacb32ee (diff)
Adds a complete rewrite of the font and text code in pdfwrite, based on
copying fonts incrementally to stable memory rather than trying to deal with fonts being freed at unpredictable times. Should fix a large number of current SourceForge bugs when completed: however, the code is currently in pre-alpha state and is not usable on any realistic input. The API is compatible with the previous pdfwrite text code; the choice of which set to use is controlled by a single, documented line in src/devs.mak. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2804 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdtx.h')
-rw-r--r--gs/src/gdevpdtx.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/gs/src/gdevpdtx.h b/gs/src/gdevpdtx.h
new file mode 100644
index 000000000..4925dea9a
--- /dev/null
+++ b/gs/src/gdevpdtx.h
@@ -0,0 +1,95 @@
+/* Copyright (C) 2002 Aladdin Enterprises. All rights reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ For more information about licensing, please refer to
+ http://www.ghostscript.com/licensing/. For information on
+ commercial licensing, go to http://www.artifex.com/licensing/ or
+ contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+*/
+
+/* $Id$ */
+/* Shared implementation definitions for pdfwrite text and fonts */
+
+#ifndef gdevpdtx_INCLUDED
+# define gdevpdtx_INCLUDED
+
+#include "gdevpdt.h"
+
+/*
+ * The pdfwrite text code is designed in layers. Each layer uses only
+ * facilities defined in that layer and those below it. The layers and the
+ * code files that define them are:
+ *
+ * Text processing
+ * gdevpdtt.c - main text processing and utilities
+ * gdevpdtc.c - processing for composite and CID-based fonts
+ * gdevpdte.c - processing for Encoding-based (i.e., all other) fonts
+ * gdevpdts.c - text state bookkeeping
+ * gdevpdt[st].h - definitions shared by the above
+ * Font resources
+ * gdevpdtf.h - interface and public definitions
+ * gdevpdtf.c - implementation of font resources, except for writing
+ * gdevpdtw.[hc] - font resource writing
+ * Font descriptors
+ * gdevpdtd.h - interface and public definitions
+ * gdevpdtd.c - implementation of font descriptors
+ * Base fonts
+ * gdevpdtb.h - interface and public definitions
+ * gdevpdtb.c - implementation of base fonts
+ *
+ * There is also a module for bitmap font processing:
+ * gdevpdti.h - interface and public definitions
+ * gdevpdti.c - implementation of bitmap fonts
+ * This handles both text processing and font resource management for
+ * Type 3 bitmap fonts, which don't fit into the layer structure very well.
+ */
+
+/* ================ Types and structures ================ */
+
+/*
+ * Define the structure for managing the text and font state. This is
+ * made up of several individually opaque components.
+ */
+
+#ifndef pdf_bitmap_fonts_DEFINED
+# define pdf_bitmap_fonts_DEFINED
+typedef struct pdf_bitmap_fonts_s pdf_bitmap_fonts_t;
+#endif
+#ifndef pdf_outline_fonts_DEFINED
+# define pdf_outline_fonts_DEFINED
+typedef struct pdf_outline_fonts_s pdf_outline_fonts_t;
+#endif
+#ifndef pdf_text_state_DEFINED
+# define pdf_text_state_DEFINED
+typedef struct pdf_text_state_s pdf_text_state_t;
+#endif
+
+/*typedef struct pdf_text_data_s pdf_text_data_t;*/ /* gdevpdfx.h */
+struct pdf_text_data_s {
+ pdf_outline_fonts_t *outline_fonts; /* gdevpdtf.c */
+ pdf_bitmap_fonts_t *bitmap_fonts; /* gdevpdti.c */
+ pdf_text_state_t *text_state; /* gdevpdts.c */
+};
+#define private_st_pdf_text_data() /* gdevpdt.c */\
+ gs_private_st_ptrs3(st_pdf_text_data, pdf_text_data_t, "pdf_text_data_t",\
+ pdf_text_data_enum_ptrs, pdf_text_data_reloc_ptrs,\
+ outline_fonts, bitmap_fonts, text_state)
+
+/* ================ Procedures (internal utilities) ================ */
+
+/* The typedef will eventually move to gdevpdfx.h. */
+typedef struct pdf_font_resource_s pdf_font_resource_t;
+
+/* ---------------- Font accessing ---------------- */
+
+/* Get the object ID of a font resource. */
+long pdf_font_id(const pdf_font_resource_t *pdfont);
+
+#endif /* gdevpdtx_INCLUDED */