use font file only if exists

This commit is contained in:
jb-alvarado 2020-09-09 22:05:42 +02:00
parent 24e893f908
commit a1f1390b8e

View File

@ -31,11 +31,14 @@ from .utils import _global, _pre, _text
def text_filter():
filter_chain = []
font = ''
if _text.add_text and _text.over_pre:
if _text.fontfile and os.path.isfile(_text.fontfile):
font = ":fontfile='{}'".format(_text.fontfile)
filter_chain = [
"null,zmq=b=tcp\\\\://'{}',drawtext=text='':fontfile='{}'".format(
_text.address.replace(':', '\\:'), _text.fontfile)]
"null,zmq=b=tcp\\\\://'{}',drawtext=text=''{}".format(
_text.address.replace(':', '\\:'), font)]
return filter_chain