visit
visit copied to clipboard
Can no longer include special characters in VisIt Text Annotation - since VisIt 2.7.0
The ability to produce certain special characters such as (mu) seems to havedisappeared with VisIt 2.7.0 (which moved to VTK 6.0), and in later versions. With VisIt 2.6.3 and before, there were a few different ways to get certainspecial characters (32-255) into a Text Annotation. e.g. 1) In a Python script using the hex representation of the character. (see for example xfd) Txt2D = CreateAnnotationObject("Text2D") Txt2D.text = "size 10\xb5m" would produce: size 10m 2) You could also get the same result using a Unicode specification: TxtU2D = CreateAnnotationObject("Text2D") TxtU2D.text = "size 10" u'\N{MICRO SIGN}'.encode('latin1') + "m" 3) Using a combination of keystrokes to type in the special character: On my keyboard at least, I can get mu by typing the right hand AltGr and m -> This character can either be: 3a) Typed directly into the Text field of an Annotation Object. or: 3b) Typed into a script. (Note however that you then also need to put a special encoding comment into the top of the script so that the Python pre-processor will interpret the source file correctly.) ** coding: latin1 -** ... TxtM2D = CreateAnnotationObject("Text2D") TxtM2D.text = "size 10m" With the newer versions of VisIt (2.7.0 onwards), whatever method you use,the special character just seems to get filtered out and the string closes up. (With a future development version, the whole string seems to disappear if aspecial character is found in it) We are wondering if the ability was lost with the move to VTK 6.0.(Could it be as simple a some extra configuration flag ?)
-----------------------REDMINE MIGRATION----------------------- This ticket was migrated from Redmine. As such, not all information was able to be captured in the transition. Below is a complete record of the original redmine ticket.
Ticket number: 1748 Status: Pending Project: VisIt Tracker: Bug Priority: Low Subject: Can no longer include special characters in VisIt Text Annotation - since VisIt 2.7.0 Assigned to: - Category: - Target version: - Author: Matthew Wheeler Start: 02/24/2014 Due date: % Done: 0% Estimated time: Created: 02/24/2014 11:14 am Updated: 03/25/2014 12:41 pm Likelihood: 2 - Rare Severity: 2 - Minor Irritation Found in version: 2.7.0 Impact: Expected Use: OS: Linux Support Group: Any Description: The ability to produce certain special characters such as (mu) seems to havedisappeared with VisIt 2.7.0 (which moved to VTK 6.0), and in later versions. With VisIt 2.6.3 and before, there were a few different ways to get certainspecial characters (32-255) into a Text Annotation. e.g. 1) In a Python script using the hex representation of the character. (see for example xfd) Txt2D = CreateAnnotationObject("Text2D") Txt2D.text = "size 10\xb5m" would produce: size 10m 2) You could also get the same result using a Unicode specification: TxtU2D = CreateAnnotationObject("Text2D") TxtU2D.text = "size 10" u'\N{MICRO SIGN}'.encode('latin1') + "m" 3) Using a combination of keystrokes to type in the special character: On my keyboard at least, I can get mu by typing the right hand AltGr and m -> This character can either be: 3a) Typed directly into the Text field of an Annotation Object. or: 3b) Typed into a script. (Note however that you then also need to put a special encoding comment into the top of the script so that the Python pre-processor will interpret the source file correctly.) ** coding: latin1 -** ... TxtM2D = CreateAnnotationObject("Text2D") TxtM2D.text = "size 10m" With the newer versions of VisIt (2.7.0 onwards), whatever method you use,the special character just seems to get filtered out and the string closes up. (With a future development version, the whole string seems to disappear if aspecial character is found in it) We are wondering if the ability was lost with the move to VTK 6.0.(Could it be as simple a some extra configuration flag ?)
Comments:
Moving out of reviewed state for reconsideration since this came up on Teams. User was able to paste 'μs', but saving a session file with this text annotation didn't restore correctly.
I tried myself, and here's what was actually saved in the session file:
<Field name="text" type="stringVector">"μs" </Field>
Too funny, I cut & pasted from the session file, and it looks correct here.
In my text editor looking at the session file the μ
is a black square.
to resolve this we should escape unicode chars, would require us to scan our strings as we write out