I am not sure about the linear gradient as shadow (your first example). I can't see any gradient. Did you mean that the dark gray filling would instead be a gradient? That can be done using a gradient scanner (BGRAGradientScanner unit) and provide it instead of a solid color to the filling method.
Regarding the outer shadow, as lainz explains, you need to compute the shape in a separate bitmap and blur it. You will find a sample function TextShadow in BGRATextFX unit.
About the inner shadow to make 3D effect, I am not sure, is it that the two inner shadows have a different offset?