Subject: | Typesetting a no-break space with ps_textbox results in incorrect PostScript output |
Hi Leo
I'm afraid PostScript::BasicTypesetter 0.04 contains a bug regarding the handling of no-break spaces. I use a Latin1 encoding, and when I use the ps_textbox method, the resulting PostScript code contains missing text and syntax errors. The problem is due to the fact that the no-break space maps to 'space' in the EncodingVector. In the PostScript::FontMetrics::kstring it is assumed that typesetting a space always results in a kerning value being pushed onto the @res stack; not true however for a no-break space.
On line 381 `` $res[$#res] += $kw; '' you then add a numeric value to an array element containing text. There are several ways to solve this problem, and currently I use a work-around in my own code by manipulating the EncodingVector before calling ps_textbox.
Should you have any questions, or if you want me to make a patch, please contact me.
Regards
Roel