@yunianhzuang had the same need than you:
Here’s an updated PG:
Note that I have set the alpha value to 0 for the clear color in the dynamic texture:
dynamicTexture.drawText(text, null, null, font, "#000000", "#ffffff00", true);
If you don’t do it, you will get some white color everywhere, which is not what you want I think.