Bug 688841

Summary: Rangecheck error with the CJK unicode font
Product: Ghostscript Reporter: Subrahmanyan K.H. <subrahmanyan-h.kalathur>
Component: GeneralAssignee: Ray Johnston <ray.johnston>
Status: NOTIFIED FIXED    
Severity: blocker    
Priority: P4    
Version: 8.54   
Hardware: All   
OS: All   
Customer: 130 Word Size: ---
Attachments: PostScript document with CJK font reference
Error text file

Description Subrahmanyan K.H. 2006-08-20 22:37:39 UTC
Hi,
	We have a Unicode CJK font, when we use that in PostScript with 
selectfont and try to view the Postscript document with GhostScrpt, we are 
getting the 'rangecheck' error. This is happening both on windows and unix, in 
gs 8.54 and 8.53.

Thanks
Subbu.
Comment 1 Subrahmanyan K.H. 2006-08-20 22:41:31 UTC
Created attachment 2420 [details]
PostScript document with CJK font reference

PostScript document, which refers to the CJK font and has the problem.
Comment 2 Subrahmanyan K.H. 2006-08-20 22:44:27 UTC
Created attachment 2421 [details]
Error text file

This is the error we get when we try to view the PS file with GS.
Comment 3 Subrahmanyan K.H. 2006-08-20 22:54:55 UTC
Initially we had only one font (amwt_f1.ttf). To improve the PS transformation, 
we requested our font vendor to split the font.
They split the font into 2 subsets, one with all CJK characters and one with 
non-CJK characters. Now with the CJK font we are getting the 'rangecheck' error 
while loading the font. 
Please provide the FTP site details, so that I can upload the font.
Comment 4 Ray Johnston 2006-08-21 09:07:33 UTC
I've modified the test file to use AMWT_F1_CJK_test.TTF and the file fails
with the same error message, so I do not require the 'test2' font.
Comment 5 Ray Johnston 2006-08-21 09:39:16 UTC
The problem was an 'off by one' condition in the "get_from_stringarray" procedure.

*** /HEAD/lib/gs_ttf.ps Wed Aug  2 12:04:50 2006
--- ./gs_ttf.ps Mon Aug 21 09:37:10 2006
***************
*** 493,499 ****
      get
    } {
      exch {                % o ()
!       2 copy length gt {
          length sub
        } {
          exch get exit
--- 493,499 ----
      get
    } {
      exch {                % o ()
!       2 copy length ge {
          length sub
        } {
          exch get exit
Comment 6 Ray Johnston 2008-09-03 08:53:47 UTC
Update customer ID for tracker