| Summary: | [SWT Mac OS X] path.addString does not appear to handle unicode properly | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michel Parisien <codingkriggs> | ||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | eclipse.felipe, remy.suen, Silenio_Quarti | ||||||
| Version: | 4.2 | ||||||||
| Target Milestone: | 3.8 M5 | ||||||||
| Hardware: | Macintosh | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Michel Parisien
Created attachment 208981 [details]
A program to replicate the issue
Run this with the proper SWT library (I am using cocoa 64 bit).
Created attachment 208982 [details]
Produced shell on Mac OS X Cocoa 64 bit from attached source code
Screenshot of what is produced when the attached source code is run.
The problem, I suspect, is that the glyph index for the Kanji character is the index in some other font (not in "Times New Roman"). This happen because of font substitution. I little research indicates this is indeed the problem: http://www.cocoabuilder.com/archive/cocoa/171193-nsglyph-from-unicode.html Fixed http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1bccd9551405353b093a48e5b41738e24b6850d6 While investigating this problem, I found another problem in GC.drawString(). The commit includes a fix for this problem as well. GC.drawString() would not draw the last glyph when using the string below in the sample. The problem is that NSLayoutManager.numberOfGlyphs() returns the wrong number of glyphs if NSLayoutManager.glyphRangeForTextContainer() is not called. private static final String s = "\u4E94\u0644\u0632\u0E19\u0E49\u0E33"; |