moviepy.video.VideoClip.
TextClip
(text=None, filename=None, size=None, color='black', bg_color='transparent', font_size=None, font='Courier', stroke_color=None, stroke_width=1, method='label', kerning=None, align='center', interline=None, tempfilename=None, temptxt=None, transparent=True, remove_temp=True, print_cmd=False)[source]¶Bases: moviepy.video.VideoClip.ImageClip
Class for autogenerated text clips.
Creates an ImageClip originating from a script-generated text image. Requires ImageMagick.
A string of the text to write. Can be replaced by argument
filename
.
The name of a file in which there is the text to write,
as a string or a path-like object.
Can be provided instead of argument txt
Size of the picture in pixels. Can be auto-set if method=’label’, but mandatory if method=’caption’. the height can be None, it will then be auto-determined.
Color of the background. See TextClip.list('color')
for a list of acceptable names.
Color of the text. See TextClip.list('color')
for a
list of acceptable names.
Name of the font to use. See TextClip.list('font')
for
the list of fonts you can use on your computer.
Color of the stroke (=contour line) of the text. If None
,
there will be no stroke.
Width of the stroke, in pixels. Can be a float, like 1.5.
Either ‘label’ (default, the picture will be autosized so as to fit
exactly the size) or ‘caption’ (the text will be drawn in a picture
with fixed size provided with the size
argument). If caption,
the text will be wrapped automagically (sometimes it is buggy, not
my fault, complain to the ImageMagick crew) and can be aligned or
centered (see parameter align
).
Changes the default spacing between letters. For
instance kerning=-1
will make the letters 1 pixel nearer from
ach other compared to the default spacing.
center | East | West | South | North . Will only work if method
is set to caption
True
(default) if you want to take into account the
transparency in the image.
Methods
|
Returns a list of all valid entries for the |
|
Returns the of all valid entries which contain |