Shadows only occur in a lit environment. If you have an unlit surface a shadow won't/can't exist.
Therefore your background has to have some illumination for the presence of a light blocking shadow.
If I wanted to project a black square, I would actually be projecting an illuminated frame that causes the eye to perceive the inside square as black. Not project a black square...
If your b/g is black and your shadow is black-how can you see that?
- at this point you would only see "shadows" that lie between the gray (lit) areas.
So if you have a lit object it should be emitting light on the surrounding surface to be realistic, as well as an object blocking this light which would cause your "shadow" to appear.
Or your text has an external light source, with some light passing through the holes/spaces within the text to create the lit background, and the light blocked by the text creating shadow.
good luck.