Highlighted

Getting an em dash

Avatar

21-03-2006

How can I get an em dash to show up in a static text field as an em dash instead of two hyphens?



Is it even possible?

Replies

Highlighted

Avatar

22-03-2006

I copied/pasted an em dash from a website into a static text field and it worked fine. What font are you using? I used Myriad Pro. I would assume that as long as you use a font with a symbol for it it should work.



Chris

Adobe Enterprise Developer Support
Highlighted

Avatar

22-03-2006

I have tried using Myriad Pro and Arial Unicode MS and all I ever get are two hyphens. I have been going into the Character Map utility and selecting an em dash and copying it then pasting it in but nothing works. I thought that would work but apparently not. I'm going to try and copy an em dash from a web site and see how that works as you did.
Highlighted

Avatar

22-03-2006

There's another way to do this but it's a little tricky: You can get the emDash character (—) by inserting it's HTML Character Code into the XML Source for the static text field's value.



Try doing this:



1. The first thing to do is force the text in your static text field to be rich text. If it isn't already (if it doesn't include any special formatting on a subset of characters), you can do this by placing a normal dash (hyphen) where you'd like the emDash to be, highlight it and make it bold. This will force the static text object's value to be rich text.



2. Make sure the static text object is selected and go to the XML Source tab. When you do this, the XML Source view will scroll down to the static text object so you don't have to look for it.



Say you had set the text as, "Left - Right", and set the "-" as bold. The XML Source for the static text object's value would look like this:



<value>

<exData maxLength="0" contentType="text/html">

<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.5.6080.0">

<p style="text-decoration:none">Left<span style="xfa-spacerun:yes"> </span>
<span style="font-weight:bold">-</span> Right</p>

</body>

</exData>

</value>


You can see in there that the dash is bold with the following mark-up:



<span style="font-weight:bold">-</span>


3. To get your emDash in there, replace the mark-up for the bolded dash (above) with the emDash character's HTML Character Code (must be in HEX) as follows:






The resulting value should look like this:



<value>

<exData maxLength="0" contentType="text/html">

<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.5.6080.0">

<p style="text-decoration:none">Left<span style="xfa-spacerun:yes"> </span>
Right</p>

</body>

</exData>

</value>


4. Return to the Body Pages tab and apply your changes to the XML Source. You should now see the text, "Left — Right", in the static text object, with the dash replaced by an emDash.



Stefan

Adobe Systems
Highlighted

Avatar

Avatar

doncrawley

Avatar

doncrawley

doncrawley

20-09-2020

Just press Alt+0151 (on the numeric keypad). That's for a PC. There's probably something similar on a Mac.