diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2003-04-11 17:54:39 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2003-04-11 17:54:39 +0000 |
commit | c301b46322fb8579ba91e4ccaec1256bdb0c0b88 (patch) | |
tree | a7010b13b14aa00f336f65ab2e6f54ef3c297c4d /gs/src/gdevpdtb.h | |
parent | db7ee12e8fd035a4a723bde0e3580f9e05e861e6 (diff) |
Fix (pdfwrite) : Generate pseudo-random font names for subset fonts
from the glyph usage array.
Bug 686807 A "subset fonts" error in Adobe Acrobat from files made by GS8.00
DETAILS :
Since the revision 1.9 of gdevpdtb.c (Sun Sep 8 20:20:12 2002 UTC)
subset font names were deterministic to simplify the debugging.
The names were derived from resource IDs, and could cause a conflict
when merging documents. This patch generates different font names
hashing the glyph usage bitmask. Now the conflict can happen
with a very small probablility, when different subsets give same
hash value.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@3813 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdtb.h')
-rw-r--r-- | gs/src/gdevpdtb.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gs/src/gdevpdtb.h b/gs/src/gdevpdtb.h index b6d89023b..545715322 100644 --- a/gs/src/gdevpdtb.h +++ b/gs/src/gdevpdtb.h @@ -90,6 +90,11 @@ gs_string *pdf_base_font_name(pdf_base_font_t *pbfont); gs_font_base *pdf_base_font_font(const pdf_base_font_t *pbfont, bool complete); /* + * Check for subset font. + */ +bool pdf_base_font_is_subset(const pdf_base_font_t *pbfont); + +/* * Drop the copied complete font associated with a base font. */ void pdf_base_font_drop_complete(pdf_base_font_t *pbfont); @@ -104,9 +109,18 @@ int pdf_base_font_copy_glyph(pdf_base_font_t *pbfont, gs_glyph glyph, gs_font_base *font); /* - * Determine whether a copied font should be subsetted. Note that if the - * font is subsetted, this procedure modifies the copied font by adding the - * XXXXXX+ font name prefix and clearing the UID. + * Determine whether a font is a subset font by examining the name. + */ +bool pdf_has_subset_prefix(const byte *str, uint size); + +/* + * Add the XXXXXX+ prefix for a subset font. + */ +int pdf_add_subset_prefix(const gx_device_pdf *pdev, gs_string *pstr, + byte *used, int count); + +/* + * Determine whether a copied font should be subsetted. */ bool pdf_do_subset_font(gx_device_pdf *pdev, pdf_base_font_t *pbfont, gs_id rid); |