Can you fence with glasses? Mine fog up under the mask.
You can absolutely fence in glasses, plenty of fencers at every level do, and the mask fully protects them from impact. The real enemy isn't safety, it's fog and slippage, and there are proven fixes for both.
For fog: anti-fog spray or wipes made for sports goggles (or the swimmer's trick, a tiny smear of baby shampoo, buffed off) works for most people. Fog happens when your warm breath hits cold lenses, so it's worst the first ten minutes; many fencers find it disappears once they're warmed up and the lens temperature rises.
For slipping: a sports strap that snugs the temples, or swapping to a frame with straight temple arms. Some fencers put a thin sweatband across the brow line to keep sweat off the lenses.
The upgrade paths, in order of cost: daily contacts just for practice days (the most popular solution among competitive fencers); prescription sports inserts; or, the option most people don't know, fencing masks are roomy enough that a cheap, slightly-small backup pair of glasses often fits better than your daily pair. If your prescription is mild, some fencers simply fence without correction; your opponent is a torso-sized target three feet away.