Erasing Lettering on Food
The prohibition against "erasing" (“mochek”) on Shabbat includes opening packages in a manner that causes words or lettering to be ripped in the process. Even eating food that contains letters or wording on its surface can be problematic, as well. This is frequently the case with birthday cakes and cookies that have words baked or formed upon their surface. In some cases it might be forbidden to "erase" such wording even though one's intention in doing so is simply to enjoy the food. If it is simply not possible to open a food item without ripping the lettering on the package, one should open it in an awkward or irregular manner.
Nevertheless, many authorities permit cutting, breaking, and eating food items (not their packaging) that contain wording on their surface. According to this approach, the prohibition against erasing does not apply when the "erasing" is done in the course of eating. This is because the erasing is indirect, destructive, and with no intention to benefit from the erasing itself. Indeed, a number of authorities rule that erasing done in the course of eating is always permitted, though some disagree.
According to all authorities, one is permitted to cut foods between one letter and the next even if doing so ruins a complete word. So too, one is permitted to remove individual letters or even entire words from the icing of a cake if some of the cake is also removed in the process. One is permitted to break or cut through letters that are baked into the body of the food, such as on a cookie. One may separate pieces of a cake that contain words on them if the cake was cut before Shabbat. This is true even though it appears that one is now “erasing” the letters or words. Rav Ovadia Yosef rules that a food item that contains writing that is made of cream or food coloring may be broken or cut by hand. It is preferable, however, to “erase” the writing with one’s mouth, in the course of eating the food, if possible. There is no need to prevent children from “erasing” writing on food items.
The consensus of most authorities is that there is no problem with cutting, breaking, or eating foods that have been formed into a special design or shape, such as a gingerbread man cookie.
 Mishna Berura 340:41; Shaar Hatziun 340:76.
 Rema, OC 340:3; Shulchan Aruch Harav, OC 458:8.
 Taz OC 340:2.
 Az Nidberu 10:8.
 Kitzur Shulchan Aruch, 80:63; Dagul Mirvava, OC 340.
 Mishna Berura 340:17.
 Shulchan Aruch Harav, OC 458:8.
 Shemirat Shabbat K'hilchata 9 note 48.
 Mishna Berura 340:15.
 Shemirat Shabbat K'hilchata 11 note 30.
 Yabia Omer 4:38.
 Mishna Berura 340:14; Shulchan Aruch Harav, OC 340:4, 343:10.
 Magen Avraham 340:6; Mishna Berura 340:16.