gdevpdt.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* Copyright (C) 2002 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gdevpdt.h,v 1.2 2003/04/08 16:31:56 igor Exp $ */
  14. /* Interface for pdfwrite text and fonts */
  15. #ifndef gdevpdt_INCLUDED
  16. # define gdevpdt_INCLUDED
  17. /*
  18. * This file defines a largely opaque interface to the text and font
  19. * handling code for pdfwrite. This is the only file that pdfwrite code
  20. * outside the text and font handling subsystem (pdftext.dev) should
  21. * #include.
  22. *
  23. * The declarations in this file deliberately duplicate declarations in
  24. * various other header files of the pdfwrite text/font subsystem.
  25. * This allows the compiler to check them for consistency.
  26. */
  27. /* ================ Procedures ================ */
  28. /* ---------------- Utility (for gdevpdf.c) ---------------- */
  29. /*
  30. * Allocate and initialize text state bookkeeping.
  31. */
  32. pdf_text_state_t *pdf_text_state_alloc(gs_memory_t *mem);
  33. /*
  34. * Allocate and initialize the text data structure.
  35. */
  36. pdf_text_data_t *pdf_text_data_alloc(gs_memory_t *mem); /* gdevpdts.h */
  37. /*
  38. * Reset the text state at the beginning of the page.
  39. */
  40. void pdf_reset_text_page(pdf_text_data_t *ptd); /* gdevpdts.h */
  41. /*
  42. * Reset the text state after a grestore.
  43. */
  44. void pdf_reset_text_state(pdf_text_data_t *ptd); /* gdevpdts.h */
  45. /*
  46. * Update text state at the end of a page.
  47. */
  48. void pdf_close_text_page(gx_device_pdf *pdev); /* gdevpdti.h */
  49. /*
  50. * Close the text-related parts of a document, including writing out font
  51. * and related resources.
  52. */
  53. int pdf_close_text_document(gx_device_pdf *pdev); /* gdevpdtw.h */
  54. /* ---------------- Contents state (for gdevpdfu.c) ---------------- */
  55. /*
  56. * Transition from stream context to text context.
  57. */
  58. int pdf_from_stream_to_text(gx_device_pdf *pdev); /* gdevpdts.h */
  59. /*
  60. * Transition from string context to text context.
  61. */
  62. int pdf_from_string_to_text(gx_device_pdf *pdev); /* gdevpdts.h */
  63. /*
  64. * Close the text aspect of the current contents part.
  65. */
  66. void pdf_close_text_contents(gx_device_pdf *pdev); /* gdevpdts.h */
  67. /* ---------------- Bitmap fonts (for gdevpdfb.c) ---------------- */
  68. /* Return the Y offset for a bitmap character image. */
  69. int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);/* gdevpdti.h */
  70. /* Begin a CharProc for an embedded (bitmap) font. */
  71. int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
  72. int y_offset, gs_id id, pdf_char_proc_t **ppcp,
  73. pdf_stream_position_t * ppos); /* gdevpdti.h */
  74. /* End a CharProc. */
  75. int pdf_end_char_proc(gx_device_pdf * pdev,
  76. pdf_stream_position_t * ppos); /* gdevpdti.h */
  77. /* Put out a reference to an image as a character in an embedded font. */
  78. int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
  79. const gs_matrix * pimat); /* gdevpdti.h */
  80. #endif /* gdevpdt_INCLUDED */