Tk Source Code

View Ticket
Login
Ticket UUID: 1202684
Title: Postscript output does not support all UNICODE characters
Type: Bug Version: 8.4.9, 8.6.0
Submitter: arjenmarkus Created on: 2005-05-16 06:31:21
Subsystem: 06. Canvas Postscript Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2026-10-22 17:22:34
Resolution: Fixed Closed By: serhiy.storchaka
    Closed on: 2026-09-22 10:22:06
Description:
The following script produces a square-root sign on the 
canvas, but the postscript file contains a ?. This seems 
to occur for any character outside the ordinary ASCII 
table:

pack [canvas .c]
.c create text 100 100 -text \u221a
.c postscript -file sqrt.ps

Excerpt from the postscript file:

100 168 [
[(?)]
] 13 -0.5 0.5 0 false DrawText

(a question mark instead of whatever UNICODE 221a 
ought to be)
User Comments: serhiy.storchaka added on 2026-09-22 10:22:14:

The test is in [4a5871f978].


serhiy.storchaka added on 2026-09-22 10:22:06:

Fixed since 8.6.0 by [961ae24a3f]: the text was converted to the system encoding first, so a character outside it became "?". Now every non-ASCII character with an Adobe glyph name is output as the glyph name (√ as /radical, é as /eacute, й as /afii10075, € as /Euro), and Ghostscript renders Latin, Cyrillic and Greek text correctly. Characters without such a name, e.g. CJK, are still omitted; supporting them would need CID-keyed fonts. Added test canvPs-7.1 in [] (branch canvps-glyph-names-test).


dkf added on 2005-05-17 14:57:06:
Logged In: YES 
user_id=79902

A quick google indicates that
http://www.cl.cam.ac.uk/~mgk25/ucs/utf2ps.c is a potentially
useful reference for being at least able to represent a
larger fraction of UTF-8, even if it's still a long way short.