Ampersand within a string not being displayed

I'm trying to use DrawFormattedText to display on the screen a string that includes an ampersand, like 'Abercrombie & Fitch'. However, what it displays instead is:

Abercrombie Fitch.

Note the two spaces between "Abercrombie" and "Fitch," i.e., the ampersand isn't appearing altogether, although the spaces to either side of it are being displayed.

I think this is a problem with PsychToolbox, and not a problem with Matlab, because within the Matlab command window, if I type:

A = 'Abercrombie & Fitch';
A

It then spits out:

A =
Abercrombie & Fitch

Therefore, Matlab seems to be processing the ampersand within the string just fine. It just isn't working when I use DrawFormattedText within PsychToolbox. Has anyone else ever had this problem? What can I do to fix it? Any help would be greatly appreciated. Thank you very much.
If it's Windows, try using two ampersands: Abercrombie && Fitch

Windows uses one ampersand to indicate that the next letter should be
underlined (this is useful for menus).

> -----Original Message-----
> From: Mario Kleiner [mailto:mario.kleiner@...]
> Sent: Sunday, April 19, 2009 9:35 PM
> To: psychtoolbox@yahoogroups.com
> Subject: [psychtoolbox] Re: Ampersand within a string not being
> displayed
>
>
> No such problem when testing with DrawFormattedTextDemo
> on OS/X. All &'s in that demo text displayed correctly.
> Which operating system? Does that demo work with &'s?
>
> Could it be that you have selected a font or text style that simply
> doesn't have the & symbol in its character set?
>
> In such a case, it would probably jus print a blank instead of
> the requested character.
>
> -mario
>
>
> --- In psychtoolbox@yahoogroups.com, "nxnw98" <nxnw98@...> wrote:
> >
> > I'm trying to use DrawFormattedText to display on the screen a
> string that includes an ampersand, like 'Abercrombie & Fitch'.
> However, what it displays instead is:
> >
> > Abercrombie Fitch.
> >
> > Note the two spaces between "Abercrombie" and "Fitch," i.e.,
> the ampersand isn't appearing altogether, although the spaces to
> either side of it are being displayed.
> >
> > I think this is a problem with PsychToolbox, and not a problem
> with Matlab, because within the Matlab command window, if I type:
> >
> > A = 'Abercrombie & Fitch';
> > A
> >
> > It then spits out:
> >
> > A =
> > Abercrombie & Fitch
> >
> > Therefore, Matlab seems to be processing the ampersand within
> the string just fine. It just isn't working when I use
> DrawFormattedText within PsychToolbox. Has anyone else ever had
> this problem? What can I do to fix it? Any help would be
> greatly appreciated. Thank you very much.
> >
>
>
>
> ------------------------------------
>
> Post your message to: psychtoolbox@yahoogroups.com
> Please indicate OS9, OSX, or WIN version, and include your full name.
> Denis Pelli, David Brainard, and Allen Ingling.
> http://psychtoolbox.org
> Yahoo! Groups Links
>
>
>
I did try it with DrawFormattedTextDemo, and it still won't display the ampersands. I'm using WinXP, and I'm pretty sure that my chosen font, Times New Roman, includes an ampersand in its character set. Does anyone have any other tips? Thanks.


--- In psychtoolbox@yahoogroups.com, "Mario Kleiner" <mario.kleiner@...> wrote:
>
> No such problem when testing with DrawFormattedTextDemo
> on OS/X. All &'s in that demo text displayed correctly.
> Which operating system? Does that demo work with &'s?
>
> Could it be that you have selected a font or text style that simply
> doesn't have the & symbol in its character set?
>
> In such a case, it would probably jus print a blank instead of the requested character.
>
> -mario
>
>
> --- In psychtoolbox@yahoogroups.com, "nxnw98" <nxnw98@> wrote:
> >
> > I'm trying to use DrawFormattedText to display on the screen a string that includes an ampersand, like 'Abercrombie & Fitch'. However, what it displays instead is:
> >
> > Abercrombie Fitch.
> >
> > Note the two spaces between "Abercrombie" and "Fitch," i.e., the ampersand isn't appearing altogether, although the spaces to either side of it are being displayed.
> >
> > I think this is a problem with PsychToolbox, and not a problem with Matlab, because within the Matlab command window, if I type:
> >
> > A = 'Abercrombie & Fitch';
> > A
> >
> > It then spits out:
> >
> > A =
> > Abercrombie & Fitch
> >
> > Therefore, Matlab seems to be processing the ampersand within the string just fine. It just isn't working when I use DrawFormattedText within PsychToolbox. Has anyone else ever had this problem? What can I do to fix it? Any help would be greatly appreciated. Thank you very much.
> >
>
Thanks Alan,

that was the bug (verified on Windows). I've added an updated
DrawFormattedText.m to the Files section of the forum for
those who need a fix before the next beta release happens.

-mario

--- In psychtoolbox@yahoogroups.com, "nxnw98" <nxnw98@...> wrote:
>
> I did try it with DrawFormattedTextDemo, and it still won't display the ampersands. I'm using WinXP, and I'm pretty sure that my chosen font, Times New Roman, includes an ampersand in its character set. Does anyone have any other tips? Thanks.
>
>
> --- In psychtoolbox@yahoogroups.com, "Mario Kleiner" <mario.kleiner@> wrote:
> >
> > No such problem when testing with DrawFormattedTextDemo
> > on OS/X. All &'s in that demo text displayed correctly.
> > Which operating system? Does that demo work with &'s?
> >
> > Could it be that you have selected a font or text style that simply
> > doesn't have the & symbol in its character set?
> >
> > In such a case, it would probably jus print a blank instead of the requested character.
> >
> > -mario
> >
> >
> > --- In psychtoolbox@yahoogroups.com, "nxnw98" <nxnw98@> wrote:
> > >
> > > I'm trying to use DrawFormattedText to display on the screen a string that includes an ampersand, like 'Abercrombie & Fitch'. However, what it displays instead is:
> > >
> > > Abercrombie Fitch.
> > >
> > > Note the two spaces between "Abercrombie" and "Fitch," i.e., the ampersand isn't appearing altogether, although the spaces to either side of it are being displayed.
> > >
> > > I think this is a problem with PsychToolbox, and not a problem with Matlab, because within the Matlab command window, if I type:
> > >
> > > A = 'Abercrombie & Fitch';
> > > A
> > >
> > > It then spits out:
> > >
> > > A =
> > > Abercrombie & Fitch
> > >
> > > Therefore, Matlab seems to be processing the ampersand within the string just fine. It just isn't working when I use DrawFormattedText within PsychToolbox. Has anyone else ever had this problem? What can I do to fix it? Any help would be greatly appreciated. Thank you very much.
> > >
> >
>