Bug 684120 - pdfwrite : GlyphNames2Unicode
Summary: pdfwrite : GlyphNames2Unicode
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: All All
: P1 normal
Assignee: Igor Melichev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-10 11:33 UTC by Igor Melichev
Modified: 2007-12-13 18:05 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Melichev 2003-02-10 11:33:21 UTC
Originally reported by: igorm@users.sourceforge.net
GlyphNames2Unicode is an undocumented feature that 
Adobe PS driver uses to communicate with Adobe 
Distiller. It is a dictionary which stores a map from glyph 
indices to Unicode codes for an incremental 
CIDFontType 2. The dictionary is stored into FontInfo.

I can see 2 ways to implement it :

1.  Add a new function to gs_font_procs; Access 
GlyphNames2Unicode or zfont_glyph_to_unicode 
depending on font type.

2. Enhance the function zfont_glyph_to_unicode with an 
additional argument for passing the font; access 
GlyphNames2Unicode or Unicode Decoding depending 
on font type.

The way 1 looks more etraightforward, unless we have 
obstacles for enlarging gs_font_procs.

A test file is attached.
Comment 1 Igor Melichev 2003-02-10 14:20:07 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

I'm sorry, I was some wrong. I have no CIDFontType 2 
examples. I've only got Type 3 and Type 42 examples with 
GlyphNames2Unicode. The attached t.ps is type 3.
Comment 2 Igor Melichev 2003-02-11 04:49:30 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

I desided to enhance the functionality of 
gs_font_procs::glyph_info instead adding a new virtual 
method. It must be safe for PCL interpreter.
Comment 3 Igor Melichev 2003-02-11 11:14:26 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

Type 3 with GlyphNames2Unicode is used only for 
interpreters which cannot handle Type 32.
Comment 4 Igor Melichev 2003-02-11 15:10:45 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

With Type 3/32, if the interpreter maintains Type 32 (the 
fragment "32 /FontType resourcestatus" returns true), 
GlyphNames2Unicode are not created. This is how the 
generated document behaves. Only way to obtain the codes 
is to signal the absence of Type 32 support (Idioms cannot 
help because 'bind' is not applied to the check).
Comment 5 Igor Melichev 2003-02-12 03:58:25 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

I shall introduce a new function to gs_font_procs, because 
enhancing gs_font_procs::glyph_info causes multiple 
redundant code. It would be nice to use C++ templates...
Comment 6 Igor Melichev 2003-02-12 06:41:35 UTC
Comment originally by igorm@users.sourceforge.net
Logged In: YES 
user_id=79484

Patches 

http://www.ghostscript.com/pipermail/gs-cvs/2003-
February/002932.html

http://www.ghostscript.com/pipermail/gs-cvs/2003-
February/002934.html

http://www.ghostscript.com/pipermail/gs-cvs/2003-
February/002935.html