[gs-devel] Long cmap table in TT font.

Alex Cherepanov alexcher at quadnet.net
Mon Jun 19 07:35:56 PDT 2006


Hi All,

I'm looking into the bug http://bugs.ghostscript.com/show_bug.cgi?id=688688

The font has an extra-long cmap table that doesn't fit into a string,
which is used in the current implementation. An obvious approach would
be to use an array of strings. In this case an access operation
changes to something like:

% get operation for the array of strings. Untested.
/long_get {
   1 index type /stringtype eq
  { get
  }{
    exch //true exch {  % i true ()
       exch pop
       2 copy length % i () i len
       lt {
         exch get //false exit
       } {
         length sub //true
       } ifelse
    } forall {
      % add error handling here
    } if
  } ifelse
} bind def

Running loops in the low level access function is likely to be quite
slow.


Ghostscript also has limited support of .bytestring, a string type free 
of 64k byte limit. Unfortunately, most string operations are not yet
implemented for .bytestring .

Ghostscript was not the 1st PS interpreter to encounter a 64K limit on 
the string size. PostScript 3 introduced reusable streams to
support large blocks of data. The cmap handling code can be re-written
using reusable streams instead of strings.

Does anybody have any comments?

Regards,
Alex Cherepanov





More information about the gs-devel mailing list