gdevpdti.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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: gdevpdti.h,v 1.3 2003/04/08 16:31:56 igor Exp $ */
  14. /* Bitmap font interface for pdfwrite */
  15. #ifndef gdevpdti_INCLUDED
  16. # define gdevpdti_INCLUDED
  17. #include "gdevpdt.h"
  18. /*
  19. * Bitmap fonts are Type 3 fonts created internally by pdfwrite. Their
  20. * CharProc consists of a single bitmap image at "device" resolution.
  21. */
  22. /* ================ Types and structures ================ */
  23. #ifndef pdf_bitmap_fonts_DEFINED
  24. # define pdf_bitmap_fonts_DEFINED
  25. typedef struct pdf_bitmap_fonts_s pdf_bitmap_fonts_t;
  26. #endif
  27. /* ================ Procedures ================ */
  28. /* Exported for gdevpdf.c */
  29. /*
  30. * Update text state at the end of a page.
  31. */
  32. void pdf_close_text_page(gx_device_pdf *pdev);
  33. /* Exported for gdevpdfb.c */
  34. /* Return the Y offset for a bitmap character image. */
  35. int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);
  36. /* Begin a CharProc for an embedded (bitmap) font. */
  37. int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
  38. int y_offset, gs_id id, pdf_char_proc_t **ppcp,
  39. pdf_stream_position_t * ppos);
  40. /* End a CharProc. */
  41. int pdf_end_char_proc(gx_device_pdf * pdev, pdf_stream_position_t * ppos);
  42. /* Put out a reference to an image as a character in an embedded font. */
  43. int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
  44. const gs_matrix * pimat);
  45. /* Only used within text code */
  46. /*
  47. * Allocate and initialize bookkeeping for bitmap fonts.
  48. */
  49. pdf_bitmap_fonts_t *pdf_bitmap_fonts_alloc(gs_memory_t *mem);
  50. /*
  51. * Write the Encoding for bitmap fonts, if needed.
  52. */
  53. int pdf_write_bitmap_fonts_Encoding(gx_device_pdf *pdev);
  54. /* Write the contents of a Type 3 bitmap font resource. */
  55. int pdf_write_contents_bitmap(gx_device_pdf *pdev, pdf_font_resource_t *pdfont);
  56. #endif /* gdevpdti_INCLUDED */