是否可以在段落样式中设置字母/字符间距?
我尝试使用spaceShrinkage
但这没有任何区别
最佳答案
根据official documentation ,p。 30:
The
setCharSpace
method adjusts one of the parameters of text -- the inter-character spacing.
后面是一个代码示例:
def charspace(canvas):
from reportlab.lib.units import inch
textobject = canvas.beginText()
textobject.setTextOrigin(3, 2.5*inch)
textobject.setFont("Helvetica-Oblique", 10)
charspace = 0
for line in lyrics:
textobject.setCharSpace(charspace)
textobject.textLine("%s: %s" %(charspace,line))
charspace = charspace+0.5
关于ReportLab 段落中的字母间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51707607/