Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting for specifying font (path) #53

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ overlay_save_folder: overlays/
# PATTRMM will ATTEMPT to create it.
# Default location is the default PMM 'overlays' folder and does not need specified.

font_path: fonts/Juventus-Fans-Bold.ttf
# Specify a path to a font file to use for the overlays. Your PMM config folder
# (where your config.yml is), will always be the BASE location.
# Default font path is 'fonts/Juventus-Fans-Bold.ttf' and does not need specified.

trakt_list_privacy: private
# Specify public/private trakt list privacy for returning soon list. Can be set per library.
# Default is private and does not need specified.
Expand Down
12 changes: 11 additions & 1 deletion pattrmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def log_setup():
trakt_list_privacy: private
save_folder: "metadata/"
overlay_save_folder: "overlays/"
font_path: "fonts/Juventus-Fans-Bold.ttf"
refresh: 30 # Full-refresh delay for library
days_ahead: 30 # How far ahead to consider 'Returning Soon'
extensions:
Expand Down Expand Up @@ -920,6 +921,12 @@ def librarySetting(library, value):
entry = pref['libraries'][library]['overlay_save_folder']
except KeyError:
entry = 'overlays/'

if value == 'font_path':
try:
entry = pref['libraries'][library]['font_path']
except KeyError:
entry = 'fonts/Juventus-Fans-Bold.ttf'

if value == 'trakt_list_privacy':
try:
Expand Down Expand Up @@ -1486,6 +1493,9 @@ def get_missing_episodes_count(self, series_id):
# overlay template path
rs_overlay_template_file = "./preferences/" + library_clean_path + "-status-template.yml"

# font file path (font folder and font file)
rs_overlay_font_path = vars.librarySetting(library, 'font_path')


# Just some information
print("Checking folder structure for " + library + ".")
Expand Down Expand Up @@ -1603,7 +1613,7 @@ def get_missing_episodes_count(self, series_id):
horizontal_align: <<horizontal_align>>
vertical_offset: <<vertical_offset>>
vertical_align: <<vertical_align>>
font: config/fonts/Juventus-Fans-Bold.ttf
font: config/{rs_overlay_font_path}
font_size: <<font_size>>
font_color: <<color>>
group: <<group>>
Expand Down
6 changes: 6 additions & 0 deletions vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,12 @@ def librarySetting(library, value):
entry = pref['libraries'][library]['save_folder']
except KeyError:
entry = ''

if value == 'font_path':
try:
entry = pref['libraries'][library]['font_path']
except KeyError:
entry = 'fonts/Juventus-Fans-Bold.ttf'

if value == 'overlay_save_folder':
try:
Expand Down
Loading