Reportlab change font size in drawString

1k Views Asked by At

I tried to do everything, but I really can't get a way, how to change font size in drawString element. See the example below please

<illustration width="20" height="20">
            <image file="checkbox.png" x="10" y="20" width="7" preserveAspectRatio="true" /> 
<drawString x="20" y="20">YES</drawString>

            <image file="checkbox.png" x="10" y="10" width="7" preserveAspectRatio="true" /> 
<drawString x="20" y="10">NO</drawString>
        </illustration>

This is my code, however I have really no idea where the font-size comes from. And I am unable to find how to change font size for words "YES" and "NO". Can anybody help? Thank you a lot

1

There are 1 best solutions below

0
Mego On

The problem can be resolved by using

<setFont name="fnt1" size="11"/>

before element.