Name of the font is extracted with double quotes and thus induce spurious missing font dialog
| Project: | Word Wrap Control Text |
| Version: | IGOR.6.01.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
I used ACL_WordWrapControlText on a Macintosh
After some work in order to understand GroupBox and TitleBox, I started to test your procedure.
(manual call from command line) However, as soon as I changed the default font for my TitleBox,
I started to get the "missing font dialog". I understood that the reason was the following line in your Code
fontName = StringByKey("font", S_recreation, "=", ",")
Which produce the string "Optima" (for example) instead of Optima. In other words, the double quotes are
included inside the string while it should not.
Workaround : I then changed the line to
fontName = RemoveEnding(StringByKey("font=", S_recreation, "\"", ","))
Which produce the string Optima without quotes. Note the change from "=" to "\"" inside StringByKey.
Then your procedure worked as expected.
When I open your Demo experiment (see my other bug report), I get exactly the same problem.
When I substitute my corrected version, your demo works as intended.
If I accept the font substitution (with the initial version), I got user font substitutions like
"Optima" -> Optima
and the procedure then works for this particular font (but not for others).
Updates
| Status: | active | » fixed |
It looks like WM must have changed how the font name is stored in the recreation macro. I've fixed this problem in commit #549 by adding a regular expression check that pulls out the name of the font without any escaped double quotes. Thanks for pointing this out.
Hello, on my side, I tested my proposed fix and found its weakness when the recreation macro contains more than one line
and the name of the font is at the end of one line. I finally came with the following solution :
splitstring/E="\"(.+)\"" S_recreation, fontName
which is similar to the new version. Thank you for the project and the very quick fix !!
| Status: | fixed | » closed |
