Airport signs

Airport sign labels can be formatted using the Background formatting tag. This tag provides the unique flexibility to change the look of text backgrounds for airport signage.

The image below shows an airport sign composed of two different backgrounds, one with an outline and one without.

Airport sign created with formatting tags

To create airport sign labels, follow these steps:

  1. Ensure labels are enabled for the layer.
  2. Use the default font, Tahoma Regular. Change the size of the label to 24 point.
  3. Use the formatting tags to create a background for the label.
    • A simple example label expression to place formatting tags around the text. The label is A2 26-8.

      "<CLR red='255' green='236' blue='0' alpha='100'><BGD red='0' green='0' blue='0' alpha='100' outline_red='255' outline_green='236' outline_blue='0' outline_alpha='100' width='1' padding='-2'>" + "A2 " + "</BGD></CLR><CLR red='255' green='255' blue='255' alpha='100'><BGD red='230' green='0' blue='0' alpha='100'>" + " 26-8" + "</BGD></CLR>"

    • A more complex example label expression that contains logic to pull the label from a field in the data and determine the background and outline colors from that information.

      This expression relies on the data being formatted following the examples below. The number in brackets ([ ]) specifies the formatting used for the text. A value of [3] equals yellow text on a black background.

      • [4]9-27[3]B10
      • [7]5
      • [12]
      • [4]9-27[3]B4[0]56
      • [0]←B4

      Arcade label expression
      var yellow = [255,236,0,100]
      var red    = [230,0,0,100]
      var blue   = [0,180,230,100]
      var black  = [0,0,0,100]
      var white  = [255,255,255,100]
      var none   = [0,0,0,0]
      
      var textFontName = "Frutiger";
      var textFontStyle = "65 Bold";
      
      var signFontName = "Esri Airport Sign"
      var signFontStyle = ""
      
      function FormatBO(background, outline, width, padding, txt){
        var attr = ""
        if(background != none && count(background) == 4){
         attr += " red='"   + background[0] + "'"
          attr += " green='" + background[1] + "'"
          attr += " blue='"  + background[2] + "'"
          attr += " alpha='" + background[3] + "'"
        }
        if(outline != none && count(outline) == 4){
          attr += " outline_red='"    + outline[0] + "'"
          attr += " outline_green='"  + outline[1] + "'"
          attr += " outline_blue='"   + outline[2] + "'"
          attr += " outline_alpha='"  + outline[3] + "'"
          attr += " width='" + width + "'"
          attr += " padding='" + padding + "'"
        }
        return "<BGD" + attr + ">" + txt + "</BGD>"
      }
      
      function SetTextColor(rgba, txt)
      {
        var r = rgba[0]
        var g = rgba[1]
        var b = rgba[2]
        var a = rgba[3]
        return "<CLR red='" + r + "' green='" + g + "' blue='" + b + "' alpha='" + a + "'>" + txt + "</CLR>"; 
      }
      
      function FormatFont(label, name, style, size)
      {
        var tagName = iif(name=="", "", " NAME='"+name+"'")
        var tagStyle = iif(style=="", "", " STYLE='"+style+"'")
        var tagSize = iif(size==0, "", " SIZE='"+size+"'")
        return "<FNT" + tagName + tagStyle + tagSize + ">" + label + "</FNT>"
      }
      
      var testExpr = $feature.AIRPORTSIGNMSGFRONT
      // e.g. "[0]←D[3]F"
      
      var splitExpr = Split(testExpr,"[")
      // e.g. ["", "0]←D ", "3]F"]
      
      var typeTextPairArray = [["",""]]
      for (var index in splitExpr){
        var pair = Split(splitExpr[index],"]")
        typeTextPairArray[index] = pair
      } 
      // e.g. [[""], ["0","←D"], ["3","F"]]
      
      var expression = "";
      var indices = [0]
      for (var index in typeTextPairArray){
        indices[index] = index;
        var pairCount = count(typeTextPairArray[index])
        if(pairCount != 2){
          expression += iif(pairCount >= 1, typeTextPairArray[index][0], "")
          continue;
        }
        
        var type = number(typeTextPairArray[index][0])
        var newText = typeTextPairArray[index][1]
      
        if(type == 0) // "DIRECTION")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, newText));
        else if(type == 1) // "INFO_ACFT")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, FormatFont(newText, textFontName, textFontStyle, 0)));
        else if(type == 2) //"INFO_VEH")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, FormatFont(newText, textFontName, textFontStyle, 5)));
        else if(type == 3) // "LOCATION")
          expression += SetTextColor(yellow, FormatBO(black, yellow, 1, -2, FormatFont(" " + newText + " ", textFontName, textFontStyle, 0)));
        else if(type == 4) // "MANDATORY")
          expression += SetTextColor(white, FormatBO(red, none, 0, 0, FormatFont(newText, textFontName, textFontStyle, 0)));
        else if(type == 5) // "NO_ENTRY")
          expression += SetTextColor(red, FormatBO(white, none, 0, 0, FormatFont("O", signFontName, "", 16)));
        else if(type == 6) // "RWY_CRITICAL")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, FormatFont("IIIII", signFontName, "", 0)));
        else if(type == 7) // "RWY_DIST_REMAIN")
          expression += SetTextColor(white, FormatBO(black, none, 0, 0, FormatFont(newText, textFontName, textFontStyle, 0)));
        else if(type == 8) //"RWY_SAFETY")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, FormatFont("RRRRR", signFontName, "", 0)));
        else if(type == 9) //"TAXIWAY_END")
          expression += SetTextColor(black, FormatBO(yellow, none, 0, 0, FormatFont("TTT", signFontName, "", 0)));
        else if(type == 10) //"TERMINAL")
          expression += SetTextColor(white, FormatBO(blue, none, 0, 0, FormatFont(newText, textFontName, textFontStyle, 0)));
        else if(type == 11) //"VEH_STOP")
          expression += SetTextColor(red, FormatBO(white, none, 0, 0, FormatFont("S", signFontName, "", 16)));
        else if(type == 12) //"VEH_YIELD")
          expression += SetTextColor(red, FormatBO(white, none, 0, 0, FormatFont("Y", signFontName, "", 16)));
        else
          expression += newText
      }
      
      return expression
  4. Set the Background callout margins.
    1. On the Labeling tab, in the Label Placement group, click Label Placement Properties Launcher.
    2. In the Labeling pane, click Symbol and click General.
    3. Expand Callout.
    4. Click the Callout drop-down menu and choose Background.
    5. Set the margins as follows:
      • Left margin—10 pt
      • Right margin—10 pt
      • Top margin—5 pt
      • Bottom margin—5 pt

Related topics