Yeah the jumping at the face can be a problem, especially if som ebody else like a kid tries to pat.
I was taught ensure that your hand is in the way if you bend over to pat, so that the dog is prevented from jumping but is rewarded with a pat. Also IIRC do not bend over the dog from the front, as this is an invitation, but stand to one side (if the darn dog doesn't keep turning around , in which case you need to train patting while on lead.) and pat that way. But yeah, sometimes just pushing down and saying "No" is what has to be done if the habit is strong. IME many people start out thinking it's cute and even encourage it, and by the time they realise it's sometimes dangerous PITA, they have a huge habit to crack.
I was lucky way back. I had a dog (15 kilos I might add) that would jump onto my arms, but only if asked and I was ready to catch. It was actually quite a trust bonding thing. I caught her, and she jumped to land just right, not knocking me over and not scratching. At other times, jumping was not a problem.