The character $\langle$ and $\rangle$ cannot be rendered correctly

Hi,

This is indeed the same problem I mentioned earlier:
https://www.wavemetrics.com/forum/general/igor-characters-messed-betwee…

By then I was using Igor 6 and 7, and I didn't know what caused the problem, but now I think I have pinned it down to the character $\langle$ and $\rangle$.
With Igor 8 x64, the below is what it looks like in Igor where it shows correctly.

Correct

When exported to PDF/EPS (or other vector graphics):

Bad

 

The computer I am using runs Windows 7 x64 Enterprise, and I didn't touch any system locale setting. It is English (Canada) as I just checked.
I have no idea how to solve this, appreciated if you have any ideas.

You might want to read the following help topic:

DisplayHelpTopic "Symbols with EPS and Igor PDF"

 

In reply to by aclight

Thanks for pointing out the help file, unfortunately I still need help with it.

First, it suggests 

On Macintosh, three of the characters (row 8, columns 5, 6 and 7) display as boxes. Those characters are copyright and similar signs. For some reason, Symbol font in Unicode on Macintosh does not support these characters.
Many more of the characters listed above fail to display on Windows in any commonly available font. The reason for this is unknown.

So it seems that's unsolved. However, I do see the langle and rangle being rendered correctly in Igor.
Does it mean something happen when I am exporting? Is there a way to choose the encoding when exporting PDF for example?

Try using a different font, one that is NOT one of the pdf/epsf standards, to ensure the glyphs are embedded. You can use the TrueType outlines example experiment to try different fonts. I am on an iPad at the moment without access to Igor, but I think it is in the feature demo area.

 

Using Igor 8 on Windows 10, I created a graph and executed the following command to create a text box:

TextBox/C/N=text0 "\\[0\\F'Symbol'〈\\F]0 test \\[0\\F'Symbol'〉\\F]0"

I then selected the File->Save Graphics menu item. I selected PDF as the format. If I uncheck Embed Fonts and save the PDF, or if I check Embed Fonts AND Except Standard Fonts, I get a .pdf file in which the angle brackets look correct when I view the .pdf file in Chrome.

You haven't provided the actual Igor command that you're using in your annotation, so I don't know to reproduce the problem you're describing.

In reply to by aclight

Hello,

Thanks for your check, your command line actually works properly even in my case.

As it turns out, the font "Symbol" is what I needed to use to make them export correctly (Open Sans didn't work, maybe it's another "standard font"), at least that's one option. Then generating a PDF file with unchecking Embed Fonts and saving the PDF it works.

 

Space
I tried to use your line to set the range where the "Symbol" font type is applying to, but somehow I got an extra space in front of the first I. I attached the experiment file for the graph, would you mind kindly taking a look to see what could be wrong?
Alternatively, this is the line of code generating the text:

Legend/C/N=text0/J "\\Z24\\s(III),\\s(fit_III) \\[0\\F'Symbol'〈\\F]0I\\B1\\M\\Z24I\\B2\\M\\Z24I\\B3\\M\\Z24\\[0\\F'Symbol'〉\\F]0\\Z24"

 

Test file for the LR bracketing (6.38 KB)

In the experiment you attached, you're not specifying the Symbol font at all, so upon export to PDF the characters get garbled.

If I execute the Legend command you included in your last post and then export as pdf without embedding fonts, I don't see any extra space before the first I. So, again, I don't understand what the problem is. Clearly in the image you provided in the last message there is a space, but without knowing exactly the command you executed, I can't explain the space.

In reply to by aclight

Sorry, it's my fault I didn't save the file after the editing.

But as you mentioned, the attached code is the updated one. Interestingly, on another computer running Windows 10, I downloaded the experiment file, and applied the line of code I attached, it worked perfectly without space.

Please kindly considered this solved, it could be something wrong with the previous Windows 7 system. I just have to do the final bit of editing with the Win10 computer for now.

Hmm... here, on Windows 10 with Igor 8 it works fine when I embed fonts (i.e., with SavePICT/E=-8/EF=1 ). I am actually use one of the 8.05 nightlies, though (build 36314). Do you really use Igor version 8.00? You should at least update to the latest stable version and see how this goes.

Graph0_0.pdf (1.44 KB)

Marcel: Using Igor 8.04, I get the same correct results with your Experiment as I described in my earlier comment (https://www.wavemetrics.com/comment/17277#comment-17277). Make sure that you either uncheck Embed Fonts, which gives you this command :

SavePICT/O/E=-8

or check both Embed Fonts AND Except Standard Fonts, which gives this command:

SavePICT/O/E=-8/EF=1

In my testing, it is only if you check Embed Fonts and uncheck Except Standard Fonts (/EF=2) that produces a pdf with the missing character boxes.

Also, for what it's worth, Igor Pro 9, currently in beta, generates a PDF with the correct characters regardless of what value you use for /EF (or if you use it at all). This is due to our use of updated code to generate Igor PDF output in IP9.

OK, If I don't embed or embed except standard fonts, it works;

Now more difficult: what about if I want to put a delta between these brackets? I tried:

\Z18\[0\F'Symbol'〈\F]0 \F'Times New Roman'δ \[0\F'Symbol'〉\F]0

and the PDF export fails, whatever the options!

Note that I just upgrade to Igor 8.04.

 

Igor file (7.41 KB)

You are discovering what a mess exporting special characters is :)

Please execute the following commands to read the two help topics that discuss this situation:

DisplayHelpTopic "Symbols with EPS and Igor PDF"
DisplayHelpTopic "Font Embedding (Windows)"
DisplayHelpTopic "PostScript Font Names (Windows)"

As the last paragraph in the first topic says:

Be sure to specify either Symbol or a font that will be embedded because it is likely that the current default font is one of the EPS or PDF standard supported fonts. These are not Unicode and the result will not be what you expect.

As mentioned in the last help topic mentioned, "Times New Roman" is a "standard" font. That means that your delta character will not be embedded (it uses a standard font) but the standard "Times" font does not actually contain the delta character because it is not a Unicode font. When Igor displays that text in a graph, it asks the OS to draw the delta character using Times New Roman font. But the OS is smart enough to realize that the font does not contain that character, so it finds another font that contains that character and draws that character using the fallback font. However the PDF embedding code is not smart enough to do that, so you end up with a missing character or junk when you use a delta character with Times New Roman font and embed only standard fonts.

Note that if you export using /EF=2, your delta character is displayed correctly in the PDF output, but the 〈 and 〉 characters are not. This is due to this sentence in the first help topic (emphasis added):

In the case of Symbol font, Igor translates the Unicode code point to the corresponding Symbol single byte code (unless you have specified that even standard fonts be embedded) ...

The solution to this problem is to use either Symbol font for the delta character, or to specify a font that actually contains a glyph for that Unicode character, such as Lucida Sans Unicode.

Either of these commands will create a text box that exports correctly using /EF=1.

TextBox/C/N=text0 "\\Z18\\[0\\F'Symbol'〈δ〉\\F]0"
TextBox/C/N=text0 "\\Z18\\[0\\F'Symbol'〈\\F]0 \\F'Lucida Sans Unicode'δ \\[0\\F'Symbol'〉\\F]0"

 

You can use the demo experiment mentioned in the second help topic I gave to determine which fonts contain a certain symbol. You're looking for ones in which the "outline" displayed in the panel is correct.

I realize that it is unreasonable to expect users to understand the convoluted logic involved here to get correct output. As I mentioned earlier, this is all much easier in Igor Pro 9.