make-ffmpeg: Use actual font size in fit_title
This commit is contained in:
parent
825ecf13b0
commit
32e4f830fc
1 changed files with 8 additions and 8 deletions
|
@ -193,20 +193,20 @@ def fit_text(string: str, frame_width):
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
||||||
def fit_title(string: str):
|
def fit_title(string: str, fontsize: int, x_offset: int):
|
||||||
global translation_font
|
global translation_font
|
||||||
translation_font = ImageFont.truetype(
|
translation_font = ImageFont.truetype(
|
||||||
font_t, size=80, encoding="unic")
|
font_t, size=fontsize, encoding="unic")
|
||||||
title = fit_text(string, 1080)
|
title = fit_text(string, (1920-x_offset-100))
|
||||||
|
|
||||||
return title
|
return title
|
||||||
|
|
||||||
|
|
||||||
def fit_speaker(string: str):
|
def fit_speaker(string: str, fontsize: int, x_offset: int):
|
||||||
global translation_font
|
global translation_font
|
||||||
translation_font = ImageFont.truetype(
|
translation_font = ImageFont.truetype(
|
||||||
font_s, size=50, encoding="unic")
|
font_s, size=fontsize, encoding="unic")
|
||||||
speaker = fit_text(string, 1080)
|
speaker = fit_text(string, (1920-x_offset-100))
|
||||||
|
|
||||||
return speaker
|
return speaker
|
||||||
|
|
||||||
|
@ -226,9 +226,9 @@ def enqueue_job(event):
|
||||||
event_title = event_title.replace('\'', '')
|
event_title = event_title.replace('\'', '')
|
||||||
event_personnames = event_personnames.replace('"', '\\"')
|
event_personnames = event_personnames.replace('"', '\\"')
|
||||||
|
|
||||||
t = fit_title(event_title)
|
t = fit_title(event_title, int(title_fontsize), int(title_x))
|
||||||
t = t.replace(':', "\:") # the ffmpeg command needs colons to be escaped
|
t = t.replace(':', "\:") # the ffmpeg command needs colons to be escaped
|
||||||
s = fit_speaker(event_personnames)
|
s = fit_speaker(event_personnames, int(speaker_fontsize), int(speaker_x))
|
||||||
|
|
||||||
if args.debug:
|
if args.debug:
|
||||||
print('Title: ', t)
|
print('Title: ', t)
|
||||||
|
|
Loading…
Add table
Reference in a new issue