Blue Smoke, a BBQ restaurant in NYC, was working with their designer to develop a new menu format. To identify whether certain menu items were gluten free, nut free or vegetarian, their designer, Eric Baker, created a set of icons to be inserted next to those menu items. I was initially requested to simply add the icons to their font so they could be inserted via the glyphs palette. After some discussion I realized it was the restaurant staff that was going to update the menus on a semi-regular basis using Microsoft Word. It would be a time consuming process for them to insert and precisely place the extra text boxes in Word. To make things simpler I suggested that we used an OpenType feature, which could be enabled in the template styles, to automatically substitute in the correct icon if the letters "GF" "NF" or "V" were typed into the menu.
Adding the icons to the font was relatively straightforward, and then the OpenType feature was coded to allow the user to easily sub in either of the two versions of the icons, using stylistic sets.
With the substitution feature turned on, it would have been possible for the icons to show up in unwanted locations—every time the letters "GF," "NF," and "V" appeared. The example below shows a few words that would cause the icons to show up in these unwanted places.
To account for this I modified the substitution program to prevent substitution of the icons if letters were present on either side of the key input characters. The project could have been wrapped up with the simple substitution but the goal was to have the OpenType feature be easy to use; it should work without errors, even for non-designers.