I'm trying to reproduce a blurred/text-shadow effect using reportlab. Something like this.
So far my approach was to work with the filling color (the text itself or the background), but I don't think I'm going to be successful if I follow this path because the class
only accepts an opacity (alpha
) paramater besides the ones that defines the color itself. Now I'm trying to find some font that will mimic this effect.
So, It's possible to reproduce the desirable effect with reportlab
? If yes, which approach should I use to achieve it?
Thank you very much!
I don't see any straightforward way to achieve a blurry effect as you can achieve with CSS or even with the PIL library using reportlab.
You can try one of the following fonts that more-less mimic this effect: Acidic, ExtraBlur, Erthqake Font, Static Buzz Font
, vtks trunkset Font and use the pdfmetrics.registerFont()
and TTFont()
methods (e.g. using the Static Buzz Font):
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen.canvas import Canvas
canvas = Canvas('temp.pdf')
pdfmetrics.registerFont(TTFont('StaticBuzz', '/path/to/TTF-file/StaticBuzz.ttf')) #Change the path to the .ttf file.
canvas.setFont('StaticBuzz', 32)
canvas.drawString(0, 700, "Sample usage of StaticBuzz Font.")
canvas.save()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With