[GIS] How to prevent automatic new line when labeling point feature class

arcgis-10.0arcgis-desktoparcmapjavascriptlabeling

I have a point feature class that I am labelling with the string "EXIT" for a majority of points, but some points will be longer, such as "EXIT into Pacific".

I wrote a labeling script that will create a new line after "EXIT", but not after "into" because I want to keep "into Pacific" on one line.

I want the label to show up like this:

     EXIT
 into Pacific

But instead, it automatically creates a new line and shows up like this:

     EXIT
     into
    Pacific

Is there a way to keep ArcMap from automatically creating a new line for the label? Or is there a good invisible character that will make the program think that "into Pacific" is one string with no white space?

Here's my script:

function FindLabel ([TYPE]){
var exitSlice
var intoSlice
intoSlice = ""
var label
var field
field = [TYPE]
exitSlice = field.slice(0, 4)
if (field.length > 4) {
    intoSlice = field.slice(5)
    label = exitSlice + "\n" + "<ITA><FNT name='Melior' size='8'>" + intoSlice + "</FNT></ITA>"
    }
else {
    label = exitSlice
    }
return label}

I'm pretty confident the script isn't causing the extra newline between "into" and "Pacific".

Best Answer

I answered this over in this other question, with a reference back to this one. Short version is that with Maplex, you can probably do it, but I don't think that there's a solution you can apply to an individual label, unless you're willing to make annotation on a case-by-case basis (editorial comment:ick).

Related Question