Skip to content

Commit

Permalink
Added documentation for font_variant() [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 7, 2015
1 parent 7a798f8 commit fb3fe4b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ def getmask2(self, text, mode="", fill=Image.core.fill):
return im, offset

def font_variant(self, font=None, size=None, index=None, encoding=None):
"""
Create a copy of this FreeTypeFont object,
using any specified arguments to override the settings.
Parameters are identical to the parameters used to initialize this object,
minus the deprecated 'file' argument.
:return: A FreeTypeFont object.
"""
return FreeTypeFont(font = self.path if font == None else font,
size = self.size if size == None else size,
index = self.index if index == None else index,
Expand Down

0 comments on commit fb3fe4b

Please sign in to comment.