本文整理汇总了Python中pgmagick.api.Draw.text_decoration方法的典型用法代码示例。如果您正苦于以下问题:Python Draw.text_decoration方法的具体用法?Python Draw.text_decoration怎么用?Python Draw.text_decoration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pgmagick.api.Draw
的用法示例。
在下文中一共展示了Draw.text_decoration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DrawTestCase
# 需要导入模块: from pgmagick.api import Draw [as 别名]
# 或者: from pgmagick.api.Draw import text_decoration [as 别名]
#.........这里部分代码省略.........
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(150, 150, 150, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_skew(self):
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.im.draw(self.d)
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.d.skewx(40)
self.im.draw(self.d)
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.d.skewy(40)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_antialias(self):
self.d.stroke_color('black')
self.d.stroke_width(20)
self.d.stroke_antialias(True)
self.d.line(10, 10, 40, 200)
self.d.stroke_antialias(False)
self.d.line(50, 10, 80, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_linecap(self):
self.d.stroke_color('lime')
self.d.stroke_linecap('butt')
self.d.stroke_linecap('round')
self.d.stroke_linecap('square')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_linejoin(self):
self.d.stroke_color('lime')
self.d.stroke_linejoin('round')
self.d.stroke_linejoin('bevel') # FIXME: Unit Test Error
self.d.stroke_linejoin('miter')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_color(self):
self.d.stroke_color('lime')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_width(self):
self.d.stroke_width(20)
self.d.line(20, 20, 50, 210)
self.im.draw(self.d)
self.im.write('t.png')
def test_text(self):
self.d.text(30, 30, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_text_antialias(self):
self.d.font('courier', weight='bold')
self.d.pointsize(70)
self.d.text_antialias(False)
self.d.text(30, 100, "hello pgmagick")
self.d.text_antialias(True)
self.d.text(30, 200, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_text_decoration(self):
self.d.pointsize(70)
self.d.text_decoration('overline')
self.d.text(30, 100, "hello pgmagick")
self.d.text_decoration('linethrough')
self.d.text(30, 200, "hello pgmagick")
self.d.text_decoration('underline')
self.d.text(30, 300, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_text_undercolor(self):
self.d.pointsize(70)
self.d.text_undercolor('lime')
self.d.text(30, 100, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_translate(self):
self.d.translate(10, 200)
self.im.draw(self.d)
self.im.write('t.png')