diff options
author | L Peter Deutsch <lpd@ghostscript.com> | 2002-06-21 22:41:16 +0000 |
---|---|---|
committer | L Peter Deutsch <lpd@ghostscript.com> | 2002-06-21 22:41:16 +0000 |
commit | a34953b71bdb8a3525e4b07f87450f52a5c1c94b (patch) | |
tree | f93dab46cdc316ac5b1df32a2aa9b57d64335ca0 | |
parent | a9618ac4b1708d1abe6ce3b2e34645477fdf64f0 (diff) | |
download | ghostpdl-a34953b71bdb8a3525e4b07f87450f52a5c1c94b.tar.gz |
Makes pdf_write_font_bbox public, for use by the new pdfwrite text code.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2784 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r-- | gs/src/gdevpdfu.c | 19 | ||||
-rw-r--r-- | gs/src/gdevpdfw.c | 18 | ||||
-rw-r--r-- | gs/src/gdevpdfx.h | 5 |
3 files changed, 24 insertions, 18 deletions
diff --git a/gs/src/gdevpdfu.c b/gs/src/gdevpdfu.c index d0b011cdb..ab17f735a 100644 --- a/gs/src/gdevpdfu.c +++ b/gs/src/gdevpdfu.c @@ -1140,3 +1140,22 @@ pdf_write_function(gx_device_pdf *pdev, const gs_function_t *pfn, long *pid) *pid = value.contents.object->id; return 0; } + +/* Write a FontBBox dictionary element. */ +int +pdf_write_font_bbox(gx_device_pdf *pdev, const gs_int_rect *pbox) +{ + stream *s = pdev->strm; + /* + * AR 4 doesn't like fonts with empty FontBBox, which + * happens when the font contains only space characters. + * Small bbox causes AR 4 to display a hairline. So we use + * the full BBox. + */ + int x = pbox->q.x + ((pbox->p.x == pbox->q.x) ? 1000 : 0); + int y = pbox->q.y + ((pbox->p.y == pbox->q.y) ? 1000 : 0); + + pprintd4(s, "/FontBBox[%d %d %d %d]", + pbox->p.x, pbox->p.y, x, y); + return 0; +} diff --git a/gs/src/gdevpdfw.c b/gs/src/gdevpdfw.c index 51f76b8f4..73b529285 100644 --- a/gs/src/gdevpdfw.c +++ b/gs/src/gdevpdfw.c @@ -66,24 +66,6 @@ pdf_write_Widths(gx_device_pdf *pdev, int first, int last, return 0; } -/* Write a FontBBox dictionary element. */ -private int -pdf_write_font_bbox(gx_device_pdf *pdev, const gs_int_rect *pbox) -{ - stream *s = pdev->strm; - /* AR 4 doesn't like fonts with empty FontBBox which - * happens when the font contains only space characters. - * Small bbox causes AR 4 to display a hairline. So we use - * the full BBox. - */ - int x= pbox->q.x + ((pbox->p.x == pbox->q.x) ? 1000 : 0); - int y= pbox->q.y + ((pbox->p.y == pbox->q.y) ? 1000 : 0); - - pprintd4(s, "/FontBBox[%d %d %d %d]", - pbox->p.x, pbox->p.y, x, y); - return 0; -} - /* Write a synthesized bitmap font resource. */ private int pdf_write_synthesized_type3(gx_device_pdf *pdev, const pdf_font_t *pef) diff --git a/gs/src/gdevpdfx.h b/gs/src/gdevpdfx.h index 1b1ff7a81..1f3bc2e97 100644 --- a/gs/src/gdevpdfx.h +++ b/gs/src/gdevpdfx.h @@ -717,6 +717,11 @@ int pdf_function_scaled(gx_device_pdf *pdev, const gs_function_t *pfn, int pdf_write_function(gx_device_pdf *pdev, const gs_function_t *pfn, long *pid); +/* ------ Fonts ------ */ + +/* Write a FontBBox dictionary element. */ +int pdf_write_font_bbox(gx_device_pdf *pdev, const gs_int_rect *pbox); + /* ---------------- Exported by gdevpdfm.c ---------------- */ /* |